Repository navigation
Refactor node status recovery from DiskFull - #18873
Closed
d-wang-commit wants to merge 1 commit into
Closed
d-wang-commit wants to merge 1 commit into
d-wang-commit wants to merge 1 commit into
Conversation
Move disk recovery checks into CommonConfig and share status updates. Keep recovery limited to ReadOnly/DiskFull and block it once shutdown starts. Add regression tests for shutdown and later status changes.
d-wang-commit
marked this pull request as draft
October 14, 2026 10:15
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.
Description
Centralize disk recovery in CommonConfig
Disk recovery was implemented in
DataNodeInternalRPCServiceImpl.sampleDiskLoad(), while node status and reason updates were managed byCommonConfig. Move the guarded recovery intoCommonConfig.recoverFromDiskFull()and share state assignment and transition logging in a privateupdateNodeStatus()method.Recovery still applies only to ReadOnly/DiskFull. It also checks the stopping flag under the same monitor used by status updates and
setStopping(). This closes the shutdown interval between setting the stopping flag and assigning the Stopping reason, during which a healthy disk sample could previously restore Running.Tests
CommonConfigTest.testDiskRecoveryDoesNotUndoLaterStatusChangeandDataNodeInternalRPCServiceImplDiskTest.testStoppingFlagPreventsDiskRecovery. Existing tests also check disk thresholds and preservation of Manual, UnrecoverableError and Stopping reasons. Both test classes passed: 18 tests, no failures or errors.with-zh-localeand tests skipped passed.Side effects and risks
Disk recovery now intentionally leaves the node read-only once shutdown has started. The stopping setter acquires the existing configuration monitor, serializing it with disk recovery and status updates. The critical section is limited to the state transition and its existing logging. No configuration, storage-format or RPC changes are introduced; read-only reason priorities remain unchanged.
This PR has:
Key changed/added classes (or packages if there are too many classes) in this PR
CommonConfig: owns synchronized disk recovery and serializes it with the stopping flag.DataNodeInternalRPCServiceImpl: delegates healthy-disk recovery toCommonConfig.CommonConfigTest,DataNodeInternalRPCServiceImplDiskTest: cover later status changes and recovery during shutdown.