Skip to content

HDDS-17107. Show startup progress in Datanode web UI - #11611

Draft
smengcl wants to merge 2 commits into
apache:masterfrom
smengcl:HDDS-17107
Draft

smengcl wants to merge 2 commits into
apache:masterfrom
smengcl:HDDS-17107

Conversation

@smengcl

@smengcl smengcl commented Oct 18, 2026 •

Copy link
Copy Markdown
Contributor

Generated-by: Claude Code (Opus 5.5)

What changes were proposed in this pull request?

A datanode with many containers can take a long time to start. Until then, operators can only follow the logs to tell which phase it is in and how much longer it will take.

This PR adds a "Startup Progress" page to the Datanode web UI.

StartupProgress (hdds-server-framework)

A small tracker that can be reused for OM and SCM later.

  • Phases are the constants of an enum, in execution order. Beginning or ending a phase also ends all earlier phases, so a service only needs to mark phase boundaries.
  • A phase can have concurrent steps (e.g. one per volume), each counting done out of total work items.
  • The remaining time of a step is estimated from its rate so far. A phase reports the remaining time of its slowest running step, or unknown when none of its steps is running.
  • Phases and steps are PENDING, RUNNING, COMPLETE or FAILED.
  • Exposed through StartupProgressMXBean, so the data is also available via /jmx.

Datanode

Phases (DatanodeStartupPhase):

  1. Initializing
  2. Waiting for SCM (until the version response is received)
  3. Preparing volumes (VersionEndpointTask#checkVolumeSet: volume format and DB load)
  4. Loading containers (one step per volume, with done / total containers)
  5. Checking volumes
  6. Starting container services (includes Ratis pipeline recovery)

Other changes:

  • ContainerReader counts the container directories of the volume with File#list() up front to get the total, then loads containers with the existing loop. A volume that fails to load is shown as a FAILED step.
  • If container services fail to start, the running phases are marked FAILED.
  • The bean is registered as Hadoop:service=HddsDatanode,name=StartupProgress.
  • New "Startup Progress" navbar entry, using the existing extraNavLinks of the navmenu. The page shows each phase with its per volume steps (status, elapsed time, done / total, estimated remaining time), and refreshes every 2 seconds until startup completes or fails.

The Datanode HTTP server already starts before the slow phases, so their progress is visible while the datanode starts. OM and SCM start their HTTP server near the end of startup, so they are left for a follow-up.

Screenshots

Rendered from this branch's UI code with mocked /jmx data.

Loading containers, with one failed volume:

dn-startup-running

Startup complete:

dn-startup-complete

Starting container services failed:

dn-startup-failed

What is the link to the Apache JIRA

https://issues.apache.org/jira/browse/HDDS-17107

How was this patch tested?

  • New TestStartupProgress: phase transitions, remaining time estimate for concurrent steps, failure marking, and a JMX round trip that checks the attribute names the UI reads.
  • New TestContainerReader#testContainerReaderProgress.
  • TestRunningDatanodeState now checks that a failed container start marks startup as failed, and a successful one does not.
  • The page was rendered in headless Chromium against mocked /jmx responses (screenshots above).
  • CI on this branch passed.

🤖 Generated with Claude Code

Track datanode startup in phases (Initializing, Waiting for SCM, Preparing volumes, Loading containers, Checking volumes, Starting container services) with the elapsed time of each phase. Beginning or ending a phase ends all earlier phases. If container services fail to start, running phases are marked as failed.

Container loading is tracked per volume: the container directories are counted up front to get the total, which is then used to estimate the remaining time. Volumes that failed to load are shown as failed. The remaining time is reported as unknown when none of the steps of a phase are running.

The progress is exposed through the Hadoop:service=HddsDatanode,name=StartupProgress MXBean and shown on a new "Startup Progress" page of the datanode web UI, which refreshes until startup is complete.

The tracker (StartupProgress) lives in hdds-server-framework so that it can be reused for OM and SCM.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@smengcl smengcl added the AI-gen label Oct 18, 2026
Copilot AI lite review requested due to automatic review settings October 18, 2026 13:05
@smengcl smengcl added the AI-gen label Oct 18, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@jojochuang

Copy link
Copy Markdown
Contributor

@spacemonkd please check it out and share your thoughts

@ptlrs ptlrs left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR @smengcl.

It would be helpful if we can get the status of all DNs in one place.

For example, the SCM page shows the status of all DNs today. Perhaps it could be updated to also show the new phase and ETA data?

Image

Comment on lines +63 to +71
public void beginPhase(P phase) {
for (Map.Entry<P, Phase> entry : phases.entrySet()) {
if (entry.getKey() == phase) {
entry.getValue().begin();
return;
}
entry.getValue().end();
}
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps we should disallow beginning a phase which has already ended

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Throwing here would break SCM HA. VersionEndpointTask runs once per SCM, so the 2nd and 3rd SCM call beginPhase(PREPARING_VOLUMES) after the phase has ended, and an exception there shuts down the datanode.

I'd keep it as a no-op. Updated javadoc and added a test.

@smengcl

smengcl commented Oct 21, 2026

Copy link
Copy Markdown
Contributor Author

Thanks @ptlrs for the review.

It would be helpful if we can get the status of all DNs in one place.

That would be work for a separate PR. This one is scoped for individual datanodes and is a big enough diff of itself.

… test

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants