You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@hbase.apache.org by "Apache9 (via GitHub)" <gi...@apache.org> on 2023/06/05 14:40:55 UTC
[GitHub] [hbase] Apache9 commented on a diff in pull request #5252: HBASE-27881 The sleep time in checkQuota of replication WAL reader sh…
Apache9 commented on code in PR #5252:
URL: https://github.com/apache/hbase/pull/5252#discussion_r1218173169
##########
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:
We will reset current everytime here, so the `EnvironmentEdgeManager.currentTime() - current >= logQuotaThrottleInterval` condition will never be met?
--
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: issues-unsubscribe@hbase.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org