HBASE-22274 Cell size limit check on append considers cell's previous size
change
This commit is contained in:
parent
4d64dd2e82
commit
987d36879c
|
@ -8101,7 +8101,15 @@ public class HRegion implements HeapSize, PropagatingConfigurationObserver, Regi
|
|||
break;
|
||||
default: throw new UnsupportedOperationException(op.toString());
|
||||
}
|
||||
|
||||
int newCellSize = PrivateCellUtil.estimatedSerializedSizeOf(newCell);
|
||||
if (newCellSize > this.maxCellSize) {
|
||||
String msg = "Cell with size " + newCellSize + " exceeds limit of " +
|
||||
this.maxCellSize + " bytes";
|
||||
if (LOG.isDebugEnabled()) {
|
||||
LOG.debug(msg);
|
||||
}
|
||||
throw new DoNotRetryIOException(msg);
|
||||
}
|
||||
cellPairs.add(new Pair<>(currentValue, newCell));
|
||||
// Add to results to get returned to the Client. If null, cilent does not want results.
|
||||
if (results != null) {
|
||||
|
|
|
@ -6417,7 +6417,7 @@ public class TestFromClientSide {
|
|||
// expected
|
||||
}
|
||||
try {
|
||||
t.append(new Append(ROW).addColumn(FAMILY, QUALIFIER, new byte[10 * 1024]));
|
||||
t.append(new Append(ROW).addColumn(FAMILY, QUALIFIER, new byte[2 * 1024]));
|
||||
fail("Oversize cell failed to trigger exception");
|
||||
} catch (IOException e) {
|
||||
// expected
|
||||
|
|
Loading…
Reference in New Issue