diff --git a/src/index_schema.cc b/src/index_schema.cc index 462c1adfe..9f4be6913 100644 --- a/src/index_schema.cc +++ b/src/index_schema.cc @@ -1096,6 +1096,11 @@ vmsdk::BlockedClientCategory IndexSchema::GetBlockedCategoryFromProto() const { } } +bool IndexSchema::IsKeyInFlight(const InternedStringPtr &key) const { + absl::MutexLock lock(&mutated_records_mutex_); + return tracked_mutated_records_.contains(key); +} + bool IndexSchema::InTrackedMutationRecords( const InternedStringPtr &key, const std::string &identifier) const { absl::MutexLock lock(&mutated_records_mutex_); diff --git a/src/index_schema.h b/src/index_schema.h index 1dfd98d2d..4421fa177 100644 --- a/src/index_schema.h +++ b/src/index_schema.h @@ -270,6 +270,8 @@ class IndexSchema : public KeyspaceEventSubscription, bool from_backfill, bool block_client, bool from_multi) ABSL_LOCKS_EXCLUDED(mutated_records_mutex_); + bool IsKeyInFlight(const InternedStringPtr &key) const + ABSL_LOCKS_EXCLUDED(mutated_records_mutex_); std::optional ConsumeTrackedMutatedAttribute( const InternedStringPtr &key, bool first_time) ABSL_LOCKS_EXCLUDED(mutated_records_mutex_);