Todd Lipcon has submitted this change and it was merged. Change subject: KUDU-598. Fix a race in concurrent btree which could segfault ......................................................................
KUDU-598. Fix a race in concurrent btree which could segfault This adds a regression test and fix for KUDU-598, which caused an occasional segfault during ConcurrentBTreeTest.TestConcurrentInsert. The issue was that, while inserting a new element into a leaf node, we'd briefly end up with a NULL (or uninitialized) value pointer associated with a valid key. Because the size of the value is stored at the pointed-to location (rather than with the pointer) we accidentally derefenced it before checking that our read of the leaf node was non-racy. The test works by adding a new 'race point' in the insert code path, and adding a new test which exercises of the race points. With the new race test, we hit the SEGV almost every time. With the patch, I was able to loop the new test 1000 times and the old non-racy test 10000 times on GCE without failure. Change-Id: I0c728a1d8014342bbc06b713a8ffee82ca4aa6bd Reviewed-on: http://gerrit.cloudera.org:8080/1859 Tested-by: Internal Jenkins Reviewed-by: Adar Dembo <[email protected]> --- M src/kudu/tablet/cbtree-test.cc M src/kudu/tablet/concurrent_btree.h 2 files changed, 61 insertions(+), 28 deletions(-) Approvals: Adar Dembo: Looks good to me, approved Internal Jenkins: Verified -- To view, visit http://gerrit.cloudera.org:8080/1859 To unsubscribe, visit http://gerrit.cloudera.org:8080/settings Gerrit-MessageType: merged Gerrit-Change-Id: I0c728a1d8014342bbc06b713a8ffee82ca4aa6bd Gerrit-PatchSet: 2 Gerrit-Project: kudu Gerrit-Branch: master Gerrit-Owner: Todd Lipcon <[email protected]> Gerrit-Reviewer: Adar Dembo <[email protected]> Gerrit-Reviewer: Internal Jenkins Gerrit-Reviewer: Mike Percy <[email protected]> Gerrit-Reviewer: Todd Lipcon <[email protected]>
