Alexey Serbin has uploaded this change for review. ( 
http://gerrit.cloudera.org:8080/22182


Change subject: KUDU-613: Don't modify refs when moving entries
......................................................................

KUDU-613: Don't modify refs when moving entries

The current implementation of the SLRU cache temporarily
changes the reference count of entries when moving between
segments of the cache (either during an upgrade or downgrade).
A temporary decrement of the handle's ref count can cause a
concurrent Release call to the entry to think it's the last
reference to the entry and free it when it shouldn't be.

This patch changes this behavior by not modifying the ref
count of entries when moving between segments. A reproduction
scenario to trigger the concurrency error is added to cache-bench.

The existing behavior is to update the mem tracker when moving
entries between segments but that's not necessary. This patch
changes that behavior by not updating the mem tracker for
entries moving between segments.

Change-Id: I643907612d43eba2c5f8dbc19d2f74f88bbca869
Reviewed-on: http://gerrit.cloudera.org:8080/22132
Reviewed-by: Alexey Serbin <[email protected]>
Tested-by: Kudu Jenkins
(cherry picked from commit 5b6aa7f6baac3eb4c14d9d349f81da5f5b8714c1)
---
M src/kudu/util/cache-bench.cc
M src/kudu/util/slru_cache.cc
M src/kudu/util/slru_cache.h
3 files changed, 111 insertions(+), 86 deletions(-)



  git pull ssh://gerrit.cloudera.org:29418/kudu refs/changes/82/22182/1
--
To view, visit http://gerrit.cloudera.org:8080/22182
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: kudu
Gerrit-Branch: branch-1.18.x
Gerrit-MessageType: newchange
Gerrit-Change-Id: I643907612d43eba2c5f8dbc19d2f74f88bbca869
Gerrit-Change-Number: 22182
Gerrit-PatchSet: 1
Gerrit-Owner: Alexey Serbin <[email protected]>
Gerrit-Reviewer: Mahesh Reddy <[email protected]>

Reply via email to