mirror of
https://github.com/GreptimeTeam/greptimedb.git
synced 2026-05-22 16:00:38 +00:00
fix: fix inconsistent cache
This commit is contained in:
@@ -121,14 +121,15 @@ impl DropTableProcedure {
|
||||
};
|
||||
|
||||
let cache_invalidator = &self.context.cache_invalidator;
|
||||
cache_invalidator
|
||||
.invalidate_table_id(&ctx, self.data.table_id())
|
||||
.await?;
|
||||
|
||||
cache_invalidator
|
||||
.invalidate_table_name(&ctx, self.data.table_ref().into())
|
||||
.await?;
|
||||
|
||||
cache_invalidator
|
||||
.invalidate_table_id(&ctx, self.data.table_id())
|
||||
.await?;
|
||||
|
||||
self.data.state = DropTableState::DatanodeDropRegions;
|
||||
|
||||
Ok(Status::executing(true))
|
||||
|
||||
@@ -123,12 +123,6 @@ impl StatementExecutor {
|
||||
|
||||
let table = DistTable::table(table_info);
|
||||
|
||||
// Invalidates local cache ASAP.
|
||||
self.cache_invalidator
|
||||
.invalidate_table_id(&Context::default(), table_id)
|
||||
.await
|
||||
.context(error::InvalidateTableCacheSnafu)?;
|
||||
|
||||
Ok(table)
|
||||
}
|
||||
|
||||
@@ -154,6 +148,11 @@ impl StatementExecutor {
|
||||
.await
|
||||
.context(error::InvalidateTableCacheSnafu)?;
|
||||
|
||||
self.cache_invalidator
|
||||
.invalidate_table_name(&Context::default(), table_name.clone())
|
||||
.await
|
||||
.context(error::InvalidateTableCacheSnafu)?;
|
||||
|
||||
Ok(Output::AffectedRows(1))
|
||||
}
|
||||
|
||||
@@ -262,6 +261,14 @@ impl StatementExecutor {
|
||||
.await
|
||||
.context(error::InvalidateTableCacheSnafu)?;
|
||||
|
||||
self.cache_invalidator
|
||||
.invalidate_table_name(
|
||||
&Context::default(),
|
||||
TableName::new(catalog_name, schema_name, table_name),
|
||||
)
|
||||
.await
|
||||
.context(error::InvalidateTableCacheSnafu)?;
|
||||
|
||||
Ok(Output::AffectedRows(0))
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user