mirror of
https://github.com/GreptimeTeam/greptimedb.git
synced 2026-01-07 13:52:59 +00:00
fix: invalidate cache after altering (#2239)
This commit is contained in:
@@ -150,10 +150,7 @@ impl DistInstance {
|
||||
}
|
||||
);
|
||||
|
||||
// Since the table information created on meta does not go through KvBackend, so we
|
||||
// manually invalidate the cache here.
|
||||
//
|
||||
// TODO(fys): when the meta invalidation cache mechanism is established, remove it.
|
||||
// Invalidates local cache ASAP.
|
||||
self.catalog_manager
|
||||
.invalidate_table(
|
||||
&table_name.catalog_name,
|
||||
@@ -193,10 +190,7 @@ impl DistInstance {
|
||||
.await
|
||||
.context(CatalogSnafu)?;
|
||||
|
||||
// Since the table information dropped on meta does not go through KvBackend, so we
|
||||
// manually invalidate the cache here.
|
||||
//
|
||||
// TODO(fys): when the meta invalidation cache mechanism is established, remove it.
|
||||
// Invalidates local cache ASAP.
|
||||
self.catalog_manager()
|
||||
.invalidate_table(
|
||||
&table_name.catalog_name,
|
||||
@@ -556,6 +550,11 @@ impl DistInstance {
|
||||
.await
|
||||
.context(error::RequestMetaSnafu)?;
|
||||
|
||||
// Invalidates local cache ASAP.
|
||||
self.catalog_manager()
|
||||
.invalidate_table(catalog_name, schema_name, table_name, table_id)
|
||||
.await;
|
||||
|
||||
Ok(Output::AffectedRows(0))
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user