forked from apache/cassandra-java-driver
-
Notifications
You must be signed in to change notification settings - Fork 37
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
4.x: Make driver invalidate tablets #377
Comments
Bouncheck
added a commit
to Bouncheck/java-driver
that referenced
this issue
Nov 28, 2024
Previously the tablet map would be completely emptied on node removal, necessitating full rebuild of it. With this change the TabletMap will be scanned through on node removals (`RemoveNodeRefresh`) in order to delete only those tablets, that contain removed node as one of the replicas. Additionally we introduce `TabletMapSchemaChangeListener` which will be automatically registered on context initialization as long as schema metadata is enabled. It won't be added if the schema metadata is enabled later at runtime. This listener ensures that relevant tablets will be removed on removals and updates of both keyspaces and tables. The `TabletMapSchemaChangesIT` tests its behaviour. Addresses scylladb#377.
Bouncheck
added a commit
to Bouncheck/java-driver
that referenced
this issue
Nov 28, 2024
Previously the tablet map would be completely emptied on node removal, necessitating full rebuild of it. With this change the TabletMap will be scanned through on node removals (`RemoveNodeRefresh`) in order to delete only those tablets, that contain removed node as one of the replicas. Additionally we introduce `TabletMapSchemaChangeListener` which will be automatically registered on context initialization as long as schema metadata is enabled. It won't be added if the schema metadata is enabled later at runtime. This listener ensures that relevant tablets will be removed on removals and updates of both keyspaces and tables. The `TabletMapSchemaChangesIT` tests its behaviour. Addresses scylladb#377.
dkropachev
pushed a commit
that referenced
this issue
Nov 29, 2024
Previously the tablet map would be completely emptied on node removal, necessitating full rebuild of it. With this change the TabletMap will be scanned through on node removals (`RemoveNodeRefresh`) in order to delete only those tablets, that contain removed node as one of the replicas. Additionally we introduce `TabletMapSchemaChangeListener` which will be automatically registered on context initialization as long as schema metadata is enabled. It won't be added if the schema metadata is enabled later at runtime. This listener ensures that relevant tablets will be removed on removals and updates of both keyspaces and tables. The `TabletMapSchemaChangesIT` tests its behaviour. Addresses #377.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Invalidation on events
SCHEMA_CHANGE
, for targetkeyspace
+table
, for all change types:UPDATED
orDROPPED
drop related tablet records.TOPOLOGY_CHANGE
, forREMOVED_NODE
(and probablychange type, all tablet records that contains this node, to be removed.MOVED_NODE
)Possible optimizations:OnSCHEMA_CHANGE
change types:UPDATED
driver can look at what have changed and if nothing that can trigger tablet migration (say, ks replication factor and tablet feature on the table) is touched, then invalidation to be voidedInvalidation on control connection reconnect
When cc is lost, driver can miss some of the events.
So we need some logic to catch up:
SCHEMA_CHANGE
event.system.peers
to find if any node was removed and do the same what should be done forTOPOLOGY_CHANGE
event.The text was updated successfully, but these errors were encountered: