From f2466f2ec279f2fe7e3fcfeb1ea0af23f55067c7 Mon Sep 17 00:00:00 2001 From: "Lei, HUANG" Date: Tue, 26 Nov 2024 01:13:31 -0800 Subject: [PATCH] fix: only remove schema related cache entries --- src/datanode/src/heartbeat.rs | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/datanode/src/heartbeat.rs b/src/datanode/src/heartbeat.rs index 7e5f3d3f0798..9e5e98fee5d4 100644 --- a/src/datanode/src/heartbeat.rs +++ b/src/datanode/src/heartbeat.rs @@ -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; @@ -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::>(); + self.cached_kv_backend - .invalidate(&Context::default(), &caches) + .invalidate(&Context::default(), &schema_caches) .await?; Ok(HandleControl::Done) }