You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@hbase.apache.org by "Andrew Kyle Purtell (Jira)" <ji...@apache.org> on 2022/06/16 05:55:00 UTC
[jira] [Closed] (HBASE-8223) [89-FB] Fix race condition between append/sync and HLog.close() work flow.
[ https://issues.apache.org/jira/browse/HBASE-8223?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Andrew Kyle Purtell closed HBASE-8223.
--------------------------------------
Assignee: (was: Rishit Shroff)
> [89-FB] Fix race condition between append/sync and HLog.close() work flow.
> --------------------------------------------------------------------------
>
> Key: HBASE-8223
> URL: https://issues.apache.org/jira/browse/HBASE-8223
> Project: HBase
> Issue Type: Bug
> Affects Versions: 0.89-fb
> Reporter: Rishit Shroff
> Priority: Minor
>
> The RegionServer was performing a shutdown as it got YouAreDeadException. It closed the HLog and was waiting to close all the regions where it got stuck.
> The reason region close is stuck because it's trying to obtain a lock which is occupied by the put op, which in turn is waiting for append to HLog to complete.
> There is race condition here is between append/sync and HLog.close() work flow.
> Scenario:
> Thread 1 => doing the append
> Thread 2 => doing HregionServer shutdown
> Timeline:
> t1> 1: Verifies that LogSyncer is not shutting down and HLog is not closed and calls sync()
> t2> 2: HRegionServer issued HLog.close()
> t3> 2: In HLog.close(), it joins the LogSyncer thread, which signals all the threads waiting on syncDone and exits.
> t4> 1: In sync, it sees that the sync has not complete until its txd, hence adds itself to the syncDone.await queue.
> Note: at t4, it does not check whether the LogSyncer Thread is alive or not, which caused this hang.
--
This message was sent by Atlassian Jira
(v8.20.7#820007)