fix: invalidate cache after altering (#2239)

This commit is contained in:
Weny Xu
2023-08-24 11:56:17 +08:00
committed by GitHub
parent 19d2d77b41
commit a7e0e2330e

View File

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