Skip to content

Commit a3d1eb1

Browse files
committed
HBASE-27881 The sleep time in checkQuota of replication WAL reader should be controlled independently
1 parent 22526a6 commit a3d1eb1

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

hbase-server/src/main/java/org/apache/hadoop/hbase/replication/regionserver/ReplicationSourceWALReader.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ class ReplicationSourceWALReader extends Thread {
6969
// position in the WAL to start reading at
7070
private long currentPosition;
7171
private final long sleepForRetries;
72+
private final long sleepForQuotaCheck;
7273
private final int maxRetriesMultiplier;
7374

7475
// Indicates whether this particular worker is running
@@ -102,6 +103,8 @@ public ReplicationSourceWALReader(FileSystem fs, Configuration conf,
102103
int batchCount = conf.getInt("replication.source.nb.batches", 1);
103104
// 1 second
104105
this.sleepForRetries = this.conf.getLong("replication.source.sleepforretries", 1000);
106+
// 300ms
107+
this.sleepForQuotaCheck = this.conf.getLong("replication.source.sleepforquotacheck", 300);
105108
// 5 minutes @ 1 sec per
106109
this.maxRetriesMultiplier = this.conf.getInt("replication.source.maxretriesmultiplier", 300);
107110
this.entryBatchQueue = new LinkedBlockingQueue<>(batchCount);
@@ -270,7 +273,7 @@ public Path getCurrentPath() {
270273
private boolean checkBufferQuota() {
271274
// try not to go over total quota
272275
if (!this.getSourceManager().checkBufferQuota(this.source.getPeerId())) {
273-
Threads.sleep(sleepForRetries);
276+
Threads.sleep(sleepForQuotaCheck);
274277
return false;
275278
}
276279
return true;

0 commit comments

Comments
 (0)