Alexey Serbin has submitted this change and it was merged. ( 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) Reviewed-on: http://gerrit.cloudera.org:8080/22182 Reviewed-by: Mahesh Reddy <[email protected]> Reviewed-by: Abhishek Chennaka <[email protected]> Tested-by: Alexey Serbin <[email protected]> --- 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(-) Approvals: Mahesh Reddy: Looks good to me, but someone else must approve Abhishek Chennaka: Looks good to me, approved Alexey Serbin: Verified -- 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: merged Gerrit-Change-Id: I643907612d43eba2c5f8dbc19d2f74f88bbca869 Gerrit-Change-Number: 22182 Gerrit-PatchSet: 2 Gerrit-Owner: Alexey Serbin <[email protected]> Gerrit-Reviewer: Abhishek Chennaka <[email protected]> Gerrit-Reviewer: Alexey Serbin <[email protected]> Gerrit-Reviewer: Kudu Jenkins (120) Gerrit-Reviewer: Mahesh Reddy <[email protected]>
