databend icon indicating copy to clipboard operation
databend copied to clipboard

tracking: http handler txn support.

Open youngsofun opened this issue 1 year ago • 3 comments

Summary

make sure:

  • without txn
    • old clients can work with new server
    • new clients can work with old server

steps:

  • fix clients
    • [x] databend-go [x] https://github.com/datafuselabs/databend-go/pull/101
    • [x] jdbc [x] https://github.com/datafuselabs/databend-jdbc/pull/162
  • [x] main https://github.com/datafuselabs/databend/pull/14802
  • [x] update bendsql https://github.com/datafuselabs/bendsql/pull/356
    • [x] bump version
  • [x] add tests use new bendsql
    • [x] @youngsofun https://github.com/datafuselabs/databend/pull/14826, https://github.com/datafuselabs/databend/pull/14826
    • [ ] @SkyFan2002
  • [x] update databend-go
    • [x] https://github.com/datafuselabs/databend-go/pull/103
    • [x] https://github.com/datafuselabs/databend-go/pull/102
  • [x] update jdbc https://github.com/datafuselabs/databend-jdbc/pull/168
    • impl Connection::commit(): send 'commit' only when txn_state != null (old server or first query)
  • [ ] decode and save it as JSON Ast instead of struct

youngsofun avatar Feb 29 '24 06:02 youngsofun

  • old server: user get error when exec Begin
  • old client + new server: Begin/ commit / rollback may success, but txn is not working,
    • client may need to send version or capability to resolve this?

for the .session, it is better for clients to decode and save it as JSON Ast instead of struct, and send to server as it is in next query. if some field is needed by the client, decode and get them separately. 2 advantages

  1. not compatibility issue when new field is added to the session state
  2. some field is that client do not care can be ignored when decoding to struct.

I will try this later

youngsofun avatar Feb 29 '24 15:02 youngsofun

  • old server: user get error when exec Begin

  • old client + new server: Begin/ commit / rollback may success, but txn is not working,

    • client may need to send version or capability to resolve this?

for the .session, it is better for clients to decode and save it as JSON Ast instead of struct, and send to server as it is in next query. if some field is needed by the client, decode and get them separately. 2 advantages

  1. not compatibility issue when new field is added to the session state
  2. some field is that client do not care can be ignored when decoding to struct.

I will try this later

@youngsofun Which API need client call when Begin, commit, and rollback? Or use specified SQL ?

hantmac avatar Mar 04 '24 06:03 hantmac

@hantmac use specified SQL

youngsofun avatar Mar 04 '24 11:03 youngsofun