sunhelly commented on code in PR #5252:
URL: https://github.com/apache/hbase/pull/5252#discussion_r1221301091


##########
hbase-server/src/main/java/org/apache/hadoop/hbase/replication/regionserver/ReplicationSourceWALReader.java:
##########
@@ -267,13 +273,20 @@ public Path getCurrentPath() {
   }
 
   // returns false if we've already exceeded the global quota
-  private boolean checkBufferQuota() {
+  private void blockUntilFreeBufferQuota() {
     // try not to go over total quota
-    if (!this.getSourceManager().checkBufferQuota(this.source.getPeerId())) {
-      Threads.sleep(sleepForRetries);
-      return false;
+    long current = EnvironmentEdgeManager.currentTime();
+    while (
+      !this.getSourceManager().checkBufferQuota(this.source.getPeerId()) && 
isReaderRunning()
+    ) {
+      if (EnvironmentEdgeManager.currentTime() - current >= 
logQuotaThrottleInterval) {
+        LOG.warn(
+          "peer={}, source reader check buffer quota failed, current wal is 
{}, will sleep {}ms for next retry",
+          this.source.getPeerId(), this.getCurrentPath(), sleepForQuotaCheck);
+      }
+      Threads.sleep(sleepForQuotaCheck);
+      current = EnvironmentEdgeManager.currentTime();

Review Comment:
   Yes, thanks, it's an obvious bug.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to