scylla-rust-driver
scylla-rust-driver copied to clipboard
Refresh schema metadata on schema-changing event
When a client performs a schema-altering query, Scylla will send a schema change event so that all clients can learn about the change relatively quickly.
Currently, the schema change event is ignored and new information is fetched by periodic topology updates (60s).
A quick change to process schema change events could be to call refresh_metadata in the ClusterWorker::work() method when the event is of type SchemaChangeEvent and MetadataReader::fetch_schema is true. As the event response contains information on what exactly was changed by the schema, the solution can be optimized to fetch only updated items.