Andrew Kyle Purtell created PHOENIX-8117:
--------------------------------------------

             Summary: Minicluster ITs abort the master when an injected clock 
runs ahead of the WAL roller
                 Key: PHOENIX-8117
                 URL: https://issues.apache.org/jira/browse/PHOENIX-8117
             Project: Phoenix
          Issue Type: Test
          Components: test
    Affects Versions: 5.3.2
            Reporter: Andrew Kyle Purtell
            Assignee: Andrew Kyle Purtell
             Fix For: 5.4.0, 5.3.3


{{TableTTLIT}} had 15 errors in 95 tests. All the errors are in the parameter 
set {{{}multiCF=false, columnEncoded=false, keepDeletedCells=TTL, versions=1, 
ttl=25, tableLevelMaxLookback=15{}}}. The first error is in 
{{{}testMaskingAndMajorCompaction{}}}, at the {{flush}} call:

{{org.apache.hadoop.hbase.exceptions.ConnectionClosedException: ... to the 
master
org.apache.hadoop.hbase.MasterNotRunningException: ... /hbase/master}}

Every later test of the class, and {{{}afterTest{}}}, fails in the same way. 
The HMaster log shows the cause:

{{master:store-WAL-Roller ... IOE in log roller
... could only be written to 0 of the 1 minReplication nodes. There are 1 
datanode(s) running and 1 node(s) are excluded in this operation.}}

The test passed in gate runs 12 and 13. The GitHub CI failure cache has no 
failure of this class.

The failure is a test problem. It comes from two HBase 2.x effects of an 
injected clock.

*The injected clock.* {{TableTTLIT}} injects a {{{}ManualEnvironmentEdge{}}}. 
The random seed is fixed, so the schedule of the clock is the same in each run. 
{{testMaskingAndMajorCompaction}} does 500 iterations. Each iteration moves the 
clock 1 s forward, and some move it {{ttl + maxLookback + 1}} s forward (41 s 
or 51 s). In 5 of the 9 parameter sets, the injected clock gets 17 to 24 
minutes ahead of the wall clock. The mini cluster runs in the same JVM, so its 
servers use the same clock.

*Effect 1: a WAL roll loop.* In HBase 2.5.14, branch-2.5 and branch-2.6, 
{{AbstractWALRoller.run}} checks for a periodic roll with 
{{{}EnvironmentEdgeManager.currentTime(){}}}. It then rolls with 
{{{}System.currentTimeMillis(){}}}, and the roll sets the last roll time from 
the wall clock. When the injected clock is more than one roll period ahead, the 
roller rolls the WAL on each pass. The WAL of the master local region has a 
roll period of 15 minutes 
({{{}hbase.master.store.region.walroll.period.ms{}}}). The class made 6988 
master WAL rolls in gate run 14. Most of the new WALs were empty. The clock mix 
came from the branch-2 backport of HBASE-26552. HBase master uses 
{{EnvironmentEdgeManager}} for both values.

*Effect 2: a false slow datanode.* The async WAL output stream 
({{{}FanOutOneBlockAsyncDFSOutput{}}} and {{{}StreamSlowMonitor{}}}) times 
datanode acknowledgments with {{{}EnvironmentEdgeManager{}}}. When the test 
moves the clock while a WAL packet is in flight, the acknowledgment seems to 
take 41 to 51 s. After 3 such events within 10 minutes, 
{{ExcludeDatanodeManager}} excludes the only datanode for 6 hours. The master 
local region has its own WAL factory and its own exclude cache. The next WAL 
create in the roll loop had no target datanode, and the HMaster aborted.

*Other exposure.* Roll loops also occur in {{{}LogicalTableNameIT{}}}, the 
{{IndexScrutinyTool}} ITs, {{ConditionalTTLExpressionIT}} and 
{{IndexToolForNonTxGlobalIndexIT}} and its subclasses. 



--
This message was sent by Atlassian Jira
(v10.3.26#10030026)

Reply via email to