Alexey Serbin has submitted this change and it was merged. ( 
http://gerrit.cloudera.org:8080/14428 )

Change subject: [util] KUDU-2968 Fix RleDecoder::GetNextRun() in case of 
literal runs
......................................................................

[util] KUDU-2968 Fix RleDecoder::GetNextRun() in case of literal runs

RLE encoding may encode "literally" when it doesn't find sufficient
repeated values.

When the number of values are not multiple of 8, literal count is
rounded up to multiple of 8. After reading the last value,
another attempt is made to read the value in GetNextRun() method.
This is beyond the max_bytes in the BitReader which returns false
and causes DCHECK() failure in GetNextRun() method.
For further details see JIRA KUDU-2968.

Fix is to check for the return value of BitReader::_GetValue()
and return without modifying further internal state of RleDecoder.
Similarly if an attempt is made by the caller of
RleDecoder::GetNextRun() to read after having read the last value
then BitReader::GetValue() would also return false again
leading to DCHECK() failure.

Tests:
- Added a test case for various int data types
that inserts wide range of non-repeated values
including non-multiple-of-8 and verfies GetNextRun() method.

Change-Id: If1703efd5307c66e282a2d2d7600dc4658c252df
Reviewed-on: http://gerrit.cloudera.org:8080/14405
Tested-by: Kudu Jenkins
Reviewed-by: Andrew Wong <[email protected]>
(cherry picked from commit 25d92848ad7dc0852b23b9e967aa695005b8b374)
Reviewed-on: http://gerrit.cloudera.org:8080/14428
Tested-by: Alexey Serbin <[email protected]>
Reviewed-by: Alexey Serbin <[email protected]>
---
M src/kudu/util/rle-encoding.h
M src/kudu/util/rle-test.cc
2 files changed, 52 insertions(+), 3 deletions(-)

Approvals:
  Alexey Serbin: Looks good to me, approved; Verified

--
To view, visit http://gerrit.cloudera.org:8080/14428
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: kudu
Gerrit-Branch: branch-1.11.x
Gerrit-MessageType: merged
Gerrit-Change-Id: If1703efd5307c66e282a2d2d7600dc4658c252df
Gerrit-Change-Number: 14428
Gerrit-PatchSet: 2
Gerrit-Owner: Bankim Bhavsar <[email protected]>
Gerrit-Reviewer: Alexey Serbin <[email protected]>

Reply via email to