You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hbase.apache.org by "Xiaolin Ha (Jira)" <ji...@apache.org> on 2022/03/14 10:06:00 UTC
[jira] [Created] (HBASE-26833) Avoid waiting to clear buffer usage of ReplicationSourceShipper when aborting the RS
Xiaolin Ha created HBASE-26833:
----------------------------------
Summary: Avoid waiting to clear buffer usage of ReplicationSourceShipper when aborting the RS
Key: HBASE-26833
URL: https://issues.apache.org/jira/browse/HBASE-26833
Project: HBase
Issue Type: Improvement
Components: regionserver, Replication
Affects Versions: 2.4.10
Reporter: Xiaolin Ha
Fix For: 2.5.0, 2.6.0, 3.0.0-alpha-3, 2.4.11
HBASE-24813 introduced the clear of buffer used in replication source shipper, but there is sleep in the method, if the variable sleepForRetries has a large value, and there are many wal groups, the aborting of RS may last a long time, but we should only do some necessary things in the aborting progress.
{code:java}
void clearWALEntryBatch() {
long timeout = System.currentTimeMillis() + this.shipEditsTimeout;
while(this.isAlive() || this.entryReader.isAlive()){
try {
if (System.currentTimeMillis() >= timeout) {
LOG.warn("Shipper clearWALEntryBatch method timed out whilst waiting reader/shipper "
+ "thread to stop. Not cleaning buffer usage. Shipper alive: {}; Reader alive: {}",
this.source.getPeerId(), this.isAlive(), this.entryReader.isAlive());
return;
} else {
// Wait both shipper and reader threads to stop
Thread.sleep(this.sleepForRetries);
}
} catch (InterruptedException e) {
LOG.warn("{} Interrupted while waiting {} to stop on clearWALEntryBatch. "
+ "Not cleaning buffer usage: {}", this.source.getPeerId(), this.getName(), e);
return;
}
}
...... {code}
--
This message was sent by Atlassian Jira
(v8.20.1#820001)