Hello Kudu Jenkins,

I'd like you to reexamine a change.  Please visit

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

to look at the new patch set (#2).

Change subject: Don't take a reference to a temporary when comparing first and 
last encoded keys
......................................................................

Don't take a reference to a temporary when comparing first and last encoded keys

In DiskRowSeWriter we have a check that makes sure that the first encoded key 
is less
than or equal to the last key. We perform the check by creating slices for the 
keys
and comparing the slices, for 'first_enc_slice' we're building it with a 
reference
to the string returned by key_index_writer()->GetMetaValueOrDie(), which ceases 
to
exist immediately. This because in libc++, returning the std::string copy is 
actually
a new copy of the underlying data, so our Slice points to a temporary bit of 
memory.

By making sure that the string survives the check the crash disappears.

While this doesn't contain a test for the crash it was easily reproducible by 
setting
kFlushDueToTimeMs in tablet_peer_mm_ops.cc to something like 2 and then running 
any
test that performed a reasonable amount of flushes (like create-table-itest). 
With
this fix it isn't reproducible anymore.

I also tested this with a large-ish table (150GBs) which would crash 
semi-regularly
and can't observe the crashes anymore.

Change-Id: Iaa1cbb087c6467bb5da777234270df089a4b3252
---
M src/kudu/tablet/diskrowset.cc
1 file changed, 4 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.cloudera.org:29418/kudu refs/changes/71/2271/2
-- 
To view, visit http://gerrit.cloudera.org:8080/2271
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-MessageType: newpatchset
Gerrit-Change-Id: Iaa1cbb087c6467bb5da777234270df089a4b3252
Gerrit-PatchSet: 2
Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-Owner: David Ribeiro Alves <[email protected]>
Gerrit-Reviewer: Dan Burkert <[email protected]>
Gerrit-Reviewer: Jean-Daniel Cryans
Gerrit-Reviewer: Kudu Jenkins
Gerrit-Reviewer: Todd Lipcon <[email protected]>

Reply via email to