Skip to content

Commit

Permalink
fix: invalidate cache after altering
Browse files Browse the repository at this point in the history
  • Loading branch information
WenyXu committed Aug 24, 2023
1 parent beb92ba commit dd27bef
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 dd27bef

Please sign in to comment.