scylla-rust-driver icon indicating copy to clipboard operation
scylla-rust-driver copied to clipboard

Refresh schema metadata on schema-changing event

Open Gor027 opened this issue 3 years ago • 0 comments

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.

Gor027 avatar Sep 08 '22 08:09 Gor027