Skip to content

Commit

Permalink
fix: invalidate cache after altering (#2239)
Browse files Browse the repository at this point in the history
  • Loading branch information
WenyXu authored Aug 24, 2023
1 parent 19d2d77 commit a7e0e23
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions src/frontend/src/instance/distributed.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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))
}

Expand Down

0 comments on commit a7e0e23

Please sign in to comment.