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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]