HBASE-22274 Cell size limit check on append considers cell's previous size
This commit is contained in:
parent
8b5b6ce3ec
commit
0132407c3e
|
@ -7989,7 +7989,15 @@ public class HRegion implements HeapSize, PropagatingConfigurationObserver, Regi
|
||||||
break;
|
break;
|
||||||
default: throw new UnsupportedOperationException(op.toString());
|
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);
|
||||||
|
}
|
||||||
// Give coprocessors a chance to update the new cell
|
// Give coprocessors a chance to update the new cell
|
||||||
if (coprocessorHost != null) {
|
if (coprocessorHost != null) {
|
||||||
newCell =
|
newCell =
|
||||||
|
|
|
@ -6454,7 +6454,7 @@ public class TestFromClientSide {
|
||||||
// expected
|
// expected
|
||||||
}
|
}
|
||||||
try {
|
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");
|
fail("Oversize cell failed to trigger exception");
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
// expected
|
// expected
|
||||||
|
|
Loading…
Reference in New Issue