HBASE-30110 Fix for flapper in TestZooKeeper by AI#8116
Open
haridsv wants to merge 1 commit intoapache:masterfrom
Open
HBASE-30110 Fix for flapper in TestZooKeeper by AI#8116haridsv wants to merge 1 commit intoapache:masterfrom
haridsv wants to merge 1 commit intoapache:masterfrom
Conversation
Ran for 20 times in a loop to verify. AI tool: Claude Code AI Model: Sonnet 4.5 (reverified using Opus 4.6 (1M context)) Prompt: You need to diagnose the HBase test TestZooKeeper that is flapping. It had multiple failures and errors in the PR validation build, but none when I ran locally. The source code is at @../../src/apache/hbase/ and the logs for good run is at @Good-Run and bad run is at @bad-run. Can you compare the logs and try to understand why the run failed and look at the code for a potential fix? Here is the AI summary for the fix: **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: 1. Starts Mini DFS Cluster (line 71) 2. Starts Mini ZK Cluster (line 72) 3. Configures settings (lines 73-77) 4. 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`.
Apache9
approved these changes
Apr 24, 2026
liuxiaocs7
approved these changes
Apr 24, 2026
Contributor
|
Ah, TestZooKeeper still failed in the pre commit check... |
Contributor
|
TEST-org.apache.hadoop.hbase.TestZooKeeper.xml Checked the xml, the inconsistent state happened in rerun, the failure for the first run is timeout. |
Contributor
|
This is the root cause, when reassigning meta region after region server crash, the thread is blocked... |
Contributor
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Ran for 20 times in a loop to verify.
AI tool: Claude Code
AI Model: Sonnet 4.5 (reverified using Opus 4.6 (1M context))
Prompt: You need to diagnose the HBase test TestZooKeeper that is flapping. It had multiple failures and errors in the PR validation build, but none when I ran locally. The source code is at @../../src/apache/hbase/ and the logs for good run is at @Good-Run and bad run is at @bad-run. Can you compare the logs and try to understand why the run failed and look at the code for a potential fix?
Here is the AI summary for the fix:
Problem Identified:
TEST_UTIL.startMiniDFSCluster(2)Why it was flaky:
namespaceIDFix Applied:
Removed the duplicate call on line 78. The test now properly:
This matches the pattern used in other similar tests like
TestClusterBootOrderand 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
TestZooKeeperno longer fails withInconsistentFSStateException.