Skip to content

HDDS-15889. Show failed MoveResult breakdown in ozone admin containerbalancer status -v - #10938

Draft
sreejasahithi wants to merge 1 commit into
apache:masterfrom
sreejasahithi:HDDS-15889
Draft

HDDS-15889. Show failed MoveResult breakdown in ozone admin containerbalancer status -v#10938
sreejasahithi wants to merge 1 commit into
apache:masterfrom
sreejasahithi:HDDS-15889

Conversation

@sreejasahithi

Copy link
Copy Markdown
Contributor

What changes were proposed in this pull request?

Improves observability of Container Balancer move failures in ozone admin containerbalancer status -v.

Previously, verbose status only showed aggregate counts (“Failed to move containers”, “Failed to move containers by timeout”) with no breakdown of why moves failed, so users had to dig through SCM logs.

This change tracks per-iteration move failures on the SCM side and surfaces them in the CLI:

  • Failure breakdown — counts grouped by reason (e.g. REPLICATION_FAIL_TIME_OUT, PRE_MOVE_CONTAINER_NOT_FOUND, ITERATION_MOVE_TIMEOUT, plus other MoveResult values)
  • Failed move details — sample failed moves with container ID and source/target datanode UUIDs (capped at 100 total, 10 per reason; counts are not capped)

What is the link to the Apache JIRA

HDDS-15889

How was this patch tested?

Added test cases.
Tested in docker ozone-balancer cluster:

bash-5.1$ ozone admin containerbalancer start \
  -t 0.1 -d 100 -i 2 \
  --move-replication-timeout-minutes 1 \
  --move-timeout-minutes 16 \
  --balancing-iteration-interval-minutes 1
Container Balancer started successfully.
bash-5.1$
bash-5.1$ ozone admin containerbalancer status --verbose --history
ContainerBalancer is Running.
Started at: 2026-08-03 05:04:17
Balancing duration: 5m 49s

Container Balancer Configuration values:
Key                                                Value
Threshold                                          0.1
Max Datanodes to Involve per Iteration(percent)    100
Max Size to Move per Iteration                     500GB
Max Size Entering Target per Iteration             26GB
Max Size Leaving Source per Iteration              26GB
Number of Iterations                               2
Time Limit for Single Container's Movement         16min
Time Limit for Single Container's Replication      1min
Interval between each Iteration                    1min
Whether to Enable Network Topology                 false
Whether to Trigger Refresh Datanode Usage Info     false
Container IDs to Include in Balancing              None
Container IDs to Exclude from Balancing            None
Datanodes Specified to be Balanced                 None
Datanodes Excluded from Balancing                  None

Current iteration info:
Key                                                Value
Iteration number                                   2
Iteration duration                                 1m 15s
Iteration result                                   -
Size scheduled to move                             300 MB
Moved data size                                    0 B
Scheduled to move containers                       3
Already moved containers                           0
Failed to move containers                          0
Failed to move containers by timeout               0
Entered data to nodes
750e0c27-4d66-4e98-96e2-62a6d4351b52 <- 100 MB
df26a64a-da07-4207-8310-f6aa427c9e8d <- 100 MB
9d674491-0530-438c-90a5-7f7c833edc86 <- 100 MB
Exited data from nodes
8768b1cf-8397-4f31-883f-3222e7abde05 -> 100 MB
700868a5-6c48-4139-949e-58697d21a14e -> 100 MB
86f4d3f6-7da3-4a41-8b2e-f582519d30fd -> 100 MB

Completed iteration history:
Key                                                Value
Iteration number                                   1
Iteration duration                                 3m 34s
Iteration result                                   ITERATION_COMPLETED
Size scheduled to move                             300 MB
Moved data size                                    0 B
Scheduled to move containers                       3
Already moved containers                           0
Failed to move containers                          0
Failed to move containers by timeout               3
Failure breakdown
  REPLICATION_FAIL_TIME_OUT                        3
Failed move details
  REPLICATION_FAIL_TIME_OUT
    container 1  source 700868a5-6c48-4139-949e-58697d21a14e  target 750e0c27-4d66-4e98-96e2-62a6d4351b52
    container 2  source 8768b1cf-8397-4f31-883f-3222e7abde05  target df26a64a-da07-4207-8310-f6aa427c9e8d
    container 3  source 86f4d3f6-7da3-4a41-8b2e-f582519d30fd  target 9d674491-0530-438c-90a5-7f7c833edc86
Entered data to nodes
750e0c27-4d66-4e98-96e2-62a6d4351b52 <- 100 MB
df26a64a-da07-4207-8310-f6aa427c9e8d <- 100 MB
9d674491-0530-438c-90a5-7f7c833edc86 <- 100 MB
Exited data from nodes
8768b1cf-8397-4f31-883f-3222e7abde05 -> 100 MB
700868a5-6c48-4139-949e-58697d21a14e -> 100 MB
86f4d3f6-7da3-4a41-8b2e-f582519d30fd -> 100 MB


bash-5.1$

Green CI : https://github.com/sreejasahithi/ozone/actions/runs/30628368322

@sreejasahithi

Copy link
Copy Markdown
Contributor Author

@ashishkumar50 could you please review this PR.

@ashishkumar50 ashishkumar50 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.

@sreejasahithi Thanks for working on this, Please update the patch wrt count instead of showing containerids. Here are the initial comments.

optional int64 count = 2;
}

message ContainerMoveFailureDetailProto {

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.

I think Failure breakdown and Failed move details should be merged. Also instead of showing containerids, we should show count of failures for source and target, otherwise it will be too verbose. Issue generally happens at DN level(like slow/unhealthy etc), so count is enough to know which dn is problematic.

}

private String formatFailureBreakdown(List<ContainerMoveFailureSummaryProto> summaries) {
List<ContainerMoveFailureSummaryProto> sortedSummaries = summaries.stream()

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.

The proto already sorts failure summaries, then the CLI sorts them again which is not required. Remove from server side sort.

*/
public final class ContainerMoveFailureTracker {
public static final int DEFAULT_MAX_FAILURE_DETAILS = 100;
public static final int DEFAULT_MAX_FAILURE_DETAILS_PER_REASON = 10;

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.

Please update as per dn count suggestion and remove these limits.


private final int maxFailureDetails;
private final int maxFailureDetailsPerReason;
private final Map<String, Long> failuresByReason = new HashMap<>();

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.

Use enum FailureReason instead of plain string.

failureDetails.add(new ContainerMoveFailureDetail(
containerId.getId(),
source.getUuidString(),
target.getUuidString(),

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.

Source or target can be null.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants