Skip to content

Commit

Permalink
chore: Add logging for cache DeleteKey
Browse files Browse the repository at this point in the history
Bug: 384019226
Change-Id: Ib1e2f16011e30be196e3eec8e417ba7aa8554f02
GitOrigin-RevId: 27d2bbe6f4391c4fd30797631aa6e1133671c0d7
  • Loading branch information
lusayaa authored and copybara-github committed Dec 19, 2024
1 parent 0036115 commit 60579ac
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions components/data_server/cache/key_value_cache.cc
Original file line number Diff line number Diff line change
Expand Up @@ -276,12 +276,18 @@ void KeyValueCache::DeleteKey(
privacy_sandbox::server_common::log::PSLogContext& log_context,
std::string_view key, int64_t logical_commit_time,
std::string_view prefix) {
PS_VLOG(9, log_context) << "Received delete for [" << key << "] at "
<< logical_commit_time;
ScopeLatencyMetricsRecorder<ServerSafeMetricsContext, kDeleteKeyLatency>
latency_recorder(KVServerContextMap()->SafeMetric());
absl::MutexLock lock(&mutex_);
auto max_cleanup_logical_commit_time =
max_cleanup_logical_commit_time_map_[prefix];
if (logical_commit_time <= max_cleanup_logical_commit_time) {
PS_VLOG(1, log_context)
<< "Skipping the update as its logical_commit_time: "
<< logical_commit_time << " is older than the current cutoff time:"
<< max_cleanup_logical_commit_time;
return;
}
const auto key_iter = map_.find(key);
Expand Down

0 comments on commit 60579ac

Please sign in to comment.