Skip to content

Commit

Permalink
fix: only remove schema related cache entries
Browse files Browse the repository at this point in the history
  • Loading branch information
v0y4g3r committed Nov 26, 2024
1 parent 84b2e75 commit f2466f2
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/datanode/src/heartbeat.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ use common_meta::heartbeat::handler::{
};
use common_meta::heartbeat::mailbox::{HeartbeatMailbox, MailboxRef};
use common_meta::heartbeat::utils::outgoing_message_to_mailbox_message;
use common_meta::instruction::Instruction;
use common_meta::instruction::{CacheIdent, Instruction};
use common_telemetry::{debug, error, info, trace, warn};
use meta_client::client::{HeartbeatSender, MetaClient};
use meta_client::MetaClientRef;
Expand Down Expand Up @@ -393,8 +393,14 @@ impl HeartbeatResponseHandler for InvalidateSchemaCacheHandler {
"InvalidateSchemaCacheHandler: invalidating caches: {:?}",
caches
);

let schema_caches = caches
.into_iter()
.filter(|i| matches!(i, CacheIdent::SchemaName(_)))
.collect::<Vec<_>>();

self.cached_kv_backend
.invalidate(&Context::default(), &caches)
.invalidate(&Context::default(), &schema_caches)
.await?;
Ok(HandleControl::Done)
}
Expand Down

0 comments on commit f2466f2

Please sign in to comment.