[
https://issues.apache.org/jira/browse/HBASE-26833?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Xiaolin Ha reassigned HBASE-26833:
----------------------------------
Assignee: Xiaolin Ha
> 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
> Assignee: Xiaolin Ha
> Priority: Major
> 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)