xandra icon indicating copy to clipboard operation
xandra copied to clipboard

Missing support to wait for schema agreement

Open bettio opened this issue 4 years ago • 5 comments

Xandra does not allow to wait for schema ageement/consensus after (maybe also before) executing schema changes. Cassandra exports schema_version on system.peers and system.local tables, and some Cassandra database drivers allow to wait for consensus/schema agreement. This feature seems to be required when executing migrations between different schema versions on Cassandra clusters.

  1. Are pull requests with this feature going to be accepted?
  2. Should this API be implemented as an additional module built on top of existing Xandra modules, or should the driver hide this detail to the end user?

bettio avatar Apr 10 '20 14:04 bettio

Can this be built on top of Xandra right now, or does it need to be build inside Xandra?

whatyouhide avatar Apr 11 '20 20:04 whatyouhide

It can be built on top of existing Xandra code (without any change to it), so I'm trying to understand if it would be an useful addition to Xandra.

bettio avatar Apr 15 '20 09:04 bettio

Please take a look to our PoC:

  • https://github.com/bettio/astarte/commit/47a9df0540056d978ea6f4d56dfd54642ec50013
  • https://github.com/bettio/astarte/commit/c0c4602b035ebe112c4d4cfc68f85e28a7894255
  • https://github.com/bettio/astarte/commit/8b208c6991a307e6e6b7bafd6c6c59468ef612c8

Let me know if you would like to see as part of Xandra, if so I will open a PR.

bettio avatar Apr 22 '20 16:04 bettio

Okay, I finally had the time to take a look at this. I'm undecided between the possible APIs:

  • The one you proposed, where you could have Xandra.execute_with_schema_agreement(conn, fun)

  • An option to the various execute functions, such as Xandra.execute(conn, query, wait_for_schema_agreement: 5000) or something like this.

Thoughts? cc @lexmag

whatyouhide avatar Apr 27 '20 14:04 whatyouhide

@bettio sorry, I haven't had cycles to tend to Xandra in a long time. I’m inclined to go with the :wait_for_schema_agreement option. Thoughts? I won't have time to implement anything but I'll try to carve time to review stuff if you're still interested in getting this feature in :)

whatyouhide avatar Nov 02 '20 08:11 whatyouhide