You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hbase.apache.org by st...@apache.org on 2016/01/21 23:36:49 UTC
hbase git commit: HBASE-15150 Fix TestDurablity in branch-1.1 (Yu Li)
Repository: hbase
Updated Branches:
refs/heads/branch-1.1 5a3e2abc0 -> 15b1f4e09
HBASE-15150 Fix TestDurablity in branch-1.1 (Yu Li)
Project: http://git-wip-us.apache.org/repos/asf/hbase/repo
Commit: http://git-wip-us.apache.org/repos/asf/hbase/commit/15b1f4e0
Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/15b1f4e0
Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/15b1f4e0
Branch: refs/heads/branch-1.1
Commit: 15b1f4e0957fee77dc20525654e7c9619174517b
Parents: 5a3e2ab
Author: stack <st...@apache.org>
Authored: Thu Jan 21 14:36:42 2016 -0800
Committer: stack <st...@apache.org>
Committed: Thu Jan 21 14:36:42 2016 -0800
----------------------------------------------------------------------
.../java/org/apache/hadoop/hbase/regionserver/HRegion.java | 2 +-
.../apache/hadoop/hbase/regionserver/wal/TestDurability.java | 7 +++++++
2 files changed, 8 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/hbase/blob/15b1f4e0/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegion.java
----------------------------------------------------------------------
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 b3b5d22..b40927c 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
@@ -7344,7 +7344,7 @@ public class HRegion implements HeapSize, PropagatingConfigurationObserver, Regi
}
// Request a cache flush. Do it outside update lock.
if (isFlushSize(this.addAndGetGlobalMemstoreSize(accumulatedResultSize))) requestFlush();
- return Result.create(allKVs);
+ return increment.isReturnResults() ? Result.create(allKVs) : null;
}
/**
http://git-wip-us.apache.org/repos/asf/hbase/blob/15b1f4e0/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/wal/TestDurability.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/wal/TestDurability.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/wal/TestDurability.java
index 9ac55bc..a911081 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/wal/TestDurability.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/wal/TestDurability.java
@@ -202,6 +202,9 @@ public class TestDurability {
byte[] row1 = Bytes.toBytes("row1");
byte[] col1 = Bytes.toBytes("col1");
+ // Enable INCREMENT_FAST_BUT_NARROW_CONSISTENCY_KEY
+ String oldFlag = CONF.get(HRegion.INCREMENT_FAST_BUT_NARROW_CONSISTENCY_KEY);
+ CONF.setBoolean(HRegion.INCREMENT_FAST_BUT_NARROW_CONSISTENCY_KEY, true);
// Setting up region
final WALFactory wals = new WALFactory(CONF, null, "testIncrementWithReturnResultsSetToFalse");
byte[] tableName = Bytes.toBytes("testIncrementWithReturnResultsSetToFalse");
@@ -213,6 +216,10 @@ public class TestDurability {
inc1.addColumn(FAMILY, col1, 1);
Result res = region.increment(inc1);
assertNull(res);
+ // cleanup
+ if (oldFlag != null) {
+ CONF.set(HRegion.INCREMENT_FAST_BUT_NARROW_CONSISTENCY_KEY, oldFlag);
+ }
}
private Put newPut(Durability durability) {