HBASE-17112 Prevent setting timestamp of delta operations the same as previous value's (Phil Yang)

This commit is contained in:
tedyu 2016-11-17 09:04:39 -08:00
parent d722b2aab7
commit c6f1b6e624
2 changed files with 4 additions and 4 deletions

View File

@ -7496,7 +7496,7 @@ public class HRegion implements HeapSize, PropagatingConfigurationObserver, Regi
if (idx < results.size()
&& CellUtil.matchingQualifier(results.get(idx), cell)) {
oldCell = results.get(idx);
long ts = Math.max(now, oldCell.getTimestamp());
long ts = Math.max(now, oldCell.getTimestamp() + 1);
// Process cell tags
// Make a union of the set of tags in the old and new KVs
@ -7906,7 +7906,7 @@ public class HRegion implements HeapSize, PropagatingConfigurationObserver, Regi
long ts = now;
if (idx < currentValues.size() && CellUtil.matchingQualifier(currentValues.get(idx), inc)) {
currentValue = currentValues.get(idx);
ts = Math.max(now, currentValue.getTimestamp());
ts = Math.max(now, currentValue.getTimestamp() + 1);
incrementAmount += getLongValue(currentValue);
// Carry forward all tags
tags = Tag.carryForwardTags(tags, currentValue);

View File

@ -6544,7 +6544,7 @@ public class TestHRegion {
region.increment(inc);
result = region.get(new Get(row));
c = result.getColumnLatestCell(fam1, qual1);
assertEquals(c.getTimestamp(), 10L);
assertEquals(c.getTimestamp(), 11L);
assertEquals(Bytes.toLong(c.getValueArray(), c.getValueOffset(), c.getValueLength()), 2L);
}
@ -6569,7 +6569,7 @@ public class TestHRegion {
region.append(a);
result = region.get(new Get(row));
c = result.getColumnLatestCell(fam1, qual1);
assertEquals(c.getTimestamp(), 10L);
assertEquals(c.getTimestamp(), 11L);
byte[] expected = new byte[qual1.length*2];
System.arraycopy(qual1, 0, expected, 0, qual1.length);