[
https://issues.apache.org/jira/browse/HBASE-30095?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18105337#comment-18105337
]
mazhengxuan edited comment on HBASE-30095 at 8/17/26 6:35 PM:
--------------------------------------------------------------
I investigated the current code and the history of these two
startMiniDFSCluster(2) calls.
The first call is part of the intended staged startup introduced by HBASE-9918:
start MiniDFS and MiniZooKeeper in @BeforeAll, then start only the
MiniHBaseCluster before each test. The second MiniDFS startup was added later
and is unnecessary.
HBaseTestingUtil.startMiniDFSCluster is documented as supporting only one
cluster. Its implementation replaces the existing dfsCluster and
dfsClusterFixer references without shutting down the first cluster. Calling it
twice can therefore leave the first cluster running while both instances use
the same test configuration and storage directories, which provides a direct
mechanism for the reported HDFS namespace conflict.
I propose removing only the second TEST_UTIL.startMiniDFSCluster(2) call from
TestZooKeeper#setUpBeforeClass, without changing the shared testing utility or
production code. I will verify the change by running TestZooKeeper with
Surefire reruns disabled and then repeating the test multiple times.
I could not find an existing HBASE-30095 pull request. If nobody is already
working on this issue, I would like to take it.
was (Author: JIRAUSER298959):
I investigated the current code and the history of these two
startMiniDFSCluster(2) calls.
The first call is part of the intended staged startup introduced by HBASE-9918:
start MiniDFS and MiniZooKeeper in @BeforeAll, then start only the
MiniHBaseCluster before each test. The second MiniDFS startup was added later
and is unnecessary.
HBaseTestingUtil.startMiniDFSCluster is documented as supporting only one
cluster. Its implementation replaces the existing dfsCluster and
dfsClusterFixer references without shutting down the first cluster. Calling it
twice can therefore leave the first cluster running while both instances use
the same test configuration and storage directories, which provides a direct
mechanism for the reported HDFS namespace conflict.
I propose removing only the second TEST_UTIL.startMiniDFSCluster(2) call from
TestZooKeeper#setUpBeforeClass, without changing the shared testing utility or
production code. I will verify the change by running TestZooKeeper with
Surefire reruns disabled and then repeating the test multiple times.
I could not find an existing HBASE-30095 pull request. If nobody is already
working on this issue, I would like to take it.
> Remove duplicated startMiniDFSCluste call in TestZooKeeper
> ----------------------------------------------------------
>
> Key: HBASE-30095
> URL: https://issues.apache.org/jira/browse/HBASE-30095
> Project: HBase
> Issue Type: Sub-task
> Components: test
> Reporter: Duo Zhang
> Priority: Major
>
> Sonnet 4.5(4.6?) summary
> TestZooKeeper
> Problem Identified:
> Line 78 had a duplicate call to TEST_UTIL.startMiniDFSCluster(2)
> This violated the "can only create one" constraint and caused HDFS namespace
> conflicts when tests ran in parallel
> Why it was flaky:
> ✅ Local/isolated runs: Worked because no leftover HDFS state
> ❌ CI/parallel runs: Failed when other ZooKeeper tests ran first, leaving
> behind HDFS data with incompatible namespaceID
> Fix Applied:
> Removed the duplicate call on line 78. The test now properly:
> Starts Mini DFS Cluster (line 71)
> Starts Mini ZK Cluster (line 72)
> Configures settings (lines 73-77)
> Done! (no duplicate cluster start)
> This matches the pattern used in other similar tests like
> TestClusterBootOrder and aligns with the comment's intent: "Test we can first
> start the ZK cluster by itself."
> The test should now be stable across both local and CI environments. You can
> verify by running the test suite again to ensure TestZooKeeper no longer
> fails with InconsistentFSStateException.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)