Add Stopped node status - #18596
Open
d-wang-commit wants to merge 1 commit into
Open
Conversation
d-wang-commit
force-pushed
the
node_stopped_status
branch
from
September 8, 2026 10:07
1c9ad42 to
d2eaf42
Compare
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.
Gracefully stopped nodes report their shutdown and are shown as Stopped instead of Unknown: shutdown reports mark Stopped unless the node is Removing, the heartbeat caches keep Stopped sticky against failure-driven Unknown while still allowing revival by a live heartbeat, and every consumer that treats Unknown as unavailable (region allocation candidates, region maintenance retries, failed task transfers, subscription runtime sensitivity, fenced filtering, removal safety checks, runtime writer selection) now treats Stopped the same way.
Why it's done this way
Stoppedmeans "known, intentionally stopped" whileUnknownmeans "cannot tell why it is unreachable". The distinction only refines the displayed diagnosis — every scheduling decision keeps treatingreaches the leader, heartbeat timeout still marks it
Unknown(unchanged fallback).Description
NodeStatus.Stoppedvalue, treated as not readable (likeUnknown).Stoppedunless it isRemoving(Removing keeps the highest priority). If the report never reaches the leader, heartbeat timeout still marks itUnknown(unchanged fallback).
Stoppedsticky: failure-driven or periodicUnknownupdates cannot refresh it, while a live heartbeat (e.g. after restart) revives the node toRunning.Unknownas unavailable now treatStoppedthe same way: region allocation fallback candidates, failed-task region transfer, region-maintenance short retries, subscription runtime sensitivity, fenced DataNode filtering, removal safetychecks, and runtime writer selection.
Tests
NodeCacheTest(sticky / revival / Removing priority for both cache types);ConfigManagerShutdownReportTest(report marks Stopped, skips Removing);ProcedureManagerTest(removal refusedwhen related node isStopped);
RegionBalancerTest;RetryFailedTasksThreadTest;RegionMaintainHandlerTest;SchemaUtilsTest;SubscriptionRuntimeCoordinatorTest;ConfigNodeProcedureEnvTest(Stopped excluded from active runtime writers).IoTDBClusterNodeShutdownHookIT,IoTDBClusterNodeErrorStartUpIT); partition allocation ITs (IoTDBPartitionCreationIT,IoTDBPartitionDurableIT,Io - DataNode / ConfigNode shutdown hooks best-effort report their shutdown; the leader marks the nodeStoppedunless it isRemoving(Removing keeps the highest priority). If the report never reaches the leader, heartbeat timeout still marks itUnknown` (unchanged fallback).Stoppedsticky: failure-driven or periodicUnknownupdates cannot refresh it, while a live heartbeat (e.g. after restart) revives the node toRunning.Unknownas unavailable now treatStoppedthe same way: region allocation fallback candidates, failed-task region transfer, region-maintenance short retries, subscriptionruntime sensitivity, fenced DataNode filtering, removal safety checks, and runtime writer selection.
This PR has:
for an unfamiliar reader.
for code coverage.
Key changed/added classes (or packages if there are too many classes) in this PR