Skip to content

Commit 52d75fd

Browse files
committed
fix merge conflicts
1 parent 372a823 commit 52d75fd

3 files changed

Lines changed: 8 additions & 2 deletions

File tree

hbase-server/src/main/java/org/apache/hadoop/hbase/ipc/ServerCall.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,8 @@ public abstract class ServerCall<T extends ServerRpcConnection> implements RpcCa
9898
// the rest of the bits are for WAL reference count. We can only call release if all of them are
9999
// zero. The reason why we can not use a general reference counting is that, we may call cleanup
100100
// multiple times in the current implementation. We should fix this in the future.
101+
// The refCount here will start as 0x80000000 and increment with every WAL reference and decrement
102+
// from WAL side on release
101103
private final AtomicInteger reference = new AtomicInteger(0x80000000);
102104

103105
@edu.umd.cs.findbugs.annotations.SuppressWarnings(value = "NP_NULL_ON_SOME_PATH",
@@ -174,6 +176,9 @@ public void retainByWAL() {
174176
}
175177

176178
public void releaseByWAL() {
179+
// Here this method of decrementAndGet for releasing WAL reference count will work in both
180+
// cases - i.e. highest bit (cleanup) 1 or 0. We will be decrementing a negative or positive
181+
// value respectively in these 2 cases, but the logic will work the same way
177182
if (reference.decrementAndGet() == 0) {
178183
if (this.reqCleanup != null) {
179184
this.reqCleanup.run();

hbase-server/src/test/java/org/apache/hadoop/hbase/wal/TestFSHLogCorruptionWithMultiPutDueToDanglingByteBuffer.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,7 @@ public static void setUp() throws Exception {
107107
SimpleRpcServer.class.getName());
108108
UTIL.getConfiguration().setInt(ByteBuffAllocator.MAX_BUFFER_COUNT_KEY, 1);
109109
UTIL.getConfiguration().setInt(ByteBuffAllocator.BUFFER_SIZE_KEY, 1024);
110+
UTIL.getConfiguration().setInt(ByteBuffAllocator.MIN_ALLOCATE_SIZE_KEY, 500);
110111
UTIL.startMiniCluster(1);
111112
UTIL.createTable(TABLE_NAME, CF);
112113
UTIL.waitTableAvailable(TABLE_NAME);

hbase-server/src/test/java/org/apache/hadoop/hbase/wal/WALCorruptionWithMultiPutDueToDanglingByteBufferTestBase.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,8 @@ public void test() throws Exception {
6363
ARRIVE = new CountDownLatch(1);
6464
RESUME = new CountDownLatch(1);
6565
try (Table table = UTIL.getConnection().getTable(TABLE_NAME)) {
66-
LOG.info("Put totally 100 rows in batches of 4 with " + Durability.ASYNC_WAL + "...");
67-
int batchSize = 4;
66+
LOG.info("Put totally 100 rows in batches of 5 with " + Durability.ASYNC_WAL + "...");
67+
int batchSize = 5;
6868
List<Put> puts = new ArrayList<>(batchSize);
6969
for (int i = 1; i <= 100; i++) {
7070
Put p = new Put(getBytes("row", i)).addColumn(CF, CQ, getBytes("value", i))

0 commit comments

Comments
 (0)