Alexey Serbin has posted comments on this change. ( http://gerrit.cloudera.org:8080/20607 )
Change subject: KUDU-613: Introduce SLRU cache ...................................................................... Patch Set 17: (1 comment) http://gerrit.cloudera.org:8080/#/c/20607/17/src/kudu/util/slru_cache.cc File src/kudu/util/slru_cache.cc: http://gerrit.cloudera.org:8080/#/c/20607/17/src/kudu/util/slru_cache.cc@543 PS17, Line 543: // Release from either the probationary or the protected shard. : if (!e->protected_segment) { : probationary_shard_->Release(handle); : } else { : protected_shard_->Release(handle); : } : } What guards against the following scenarios: Scenario_0: * thread_A: an instance of Cache::UniqueHandle as a wrapper for entry_X is being destroyed * thread_A: while executing SLRUCacheShardPair::Release(), finds entry_X isn't in the protected shard * thread_B: calls SLRUCacheShardPair::Lookup(), moving entry_X into the protected shard * thread_A: calls Release() on the corresponding probationary shard for entry_X Scenario_1: * thread_A: an instance of Cache::UniqueHandle as a wrapper for entry_X is being destroyed * thread_A: while executing SLRUCacheShardPair::Release(), finds entry_X is in the protected shard * thread_B: calls SLRUCacheShardPair::Lookup() for some other entry_Y which is in the probationary shard, but due to crossing the threshold of lookup operations per entry, it's now being moved into the protected shard, so entry_X is pushed out of the protected shard * thread_A: calls Release() on the corresponding protected shard for entry_X If nothing prevents from having such scenarios, then a few questions: * Does the contents SLRU cache stay consistent after that? * Do metrics of the SLRU cache stay consistent after that? -- To view, visit http://gerrit.cloudera.org:8080/20607 To unsubscribe, visit http://gerrit.cloudera.org:8080/settings Gerrit-Project: kudu Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I45531534a2049dd38c002f4dc7982df9fd46e0bb Gerrit-Change-Number: 20607 Gerrit-PatchSet: 17 Gerrit-Owner: Mahesh Reddy <[email protected]> Gerrit-Reviewer: Abhishek Chennaka <[email protected]> Gerrit-Reviewer: Alexey Serbin <[email protected]> Gerrit-Reviewer: Attila Bukor <[email protected]> Gerrit-Reviewer: Kudu Jenkins (120) Gerrit-Reviewer: Mahesh Reddy <[email protected]> Gerrit-Reviewer: Marton Greber <[email protected]> Gerrit-Reviewer: Tidy Bot (241) Gerrit-Comment-Date: Sat, 11 May 2024 01:09:24 +0000 Gerrit-HasComments: Yes
