From 7302142a6c838211294a0d59daaace06cd11e73e Mon Sep 17 00:00:00 2001 From: Phil Yang Date: Wed, 16 Nov 2016 22:59:34 +0800 Subject: [PATCH] HBASE-17112 Prevent setting timestamp of delta operations being same as previous value's --- .../src/main/java/org/apache/hadoop/hbase/regionserver/HRegion.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegion.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegion.java index 831627b..31b2a15 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegion.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegion.java @@ -7512,7 +7512,7 @@ public class HRegion implements HeapSize, PropagatingConfigurationObserver, Regi long ts = now; if (currentValue != null) { tags = TagUtil.carryForwardTags(tags, currentValue); - ts = Math.max(now, currentValue.getTimestamp()); + ts = Math.max(now, currentValue.getTimestamp() + 1); newValue += getLongValue(currentValue); } // Now make up the new Cell. TODO: FIX. This is carnel knowledge of how KeyValues are made... @@ -7538,7 +7538,7 @@ public class HRegion implements HeapSize, PropagatingConfigurationObserver, Regi byte [] row = mutation.getRow(); if (currentValue != null) { tags = TagUtil.carryForwardTags(tags, currentValue); - ts = Math.max(now, currentValue.getTimestamp()); + ts = Math.max(now, currentValue.getTimestamp() + 1); tags = TagUtil.carryForwardTTLTag(tags, mutation.getTTL()); byte[] tagBytes = TagUtil.fromList(tags); // Allocate an empty cell and copy in all parts. -- 2.5.4 (Apple Git-61)