whatyouhide/xandra

Missing support to wait for schema agreement

Opened this issue · 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?

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

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.

Please take a look to our PoC:

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

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

@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 :)