You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@kudu.apache.org by "Todd Lipcon (Code Review)" <ge...@ip-10-146-233-104.ec2.internal> on 2016/01/21 18:46:43 UTC

[kudu-CR] KUDU-598. Fix a race in concurrent btree which could segfault

Hello Mike Percy, Adar Dembo,

I'd like you to do a code review.  Please visit

    http://gerrit.cloudera.org:8080/1859

to review the following change.

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
---
M src/kudu/tablet/cbtree-test.cc
M src/kudu/tablet/concurrent_btree.h
2 files changed, 61 insertions(+), 28 deletions(-)


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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I0c728a1d8014342bbc06b713a8ffee82ca4aa6bd
Gerrit-PatchSet: 1
Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-Owner: Todd Lipcon <to...@apache.org>
Gerrit-Reviewer: Adar Dembo <ad...@cloudera.com>
Gerrit-Reviewer: Mike Percy <mp...@cloudera.com>