Conversation
…der the sort metric
There was a problem hiding this comment.
🟢 Approval recommended
No unresolved issues were identified that would block approval.
Pull request overview
Updates OM write-path datanode sorting to resolve the client once, delegate unresolved clients to SCM, and preserve pipeline order when topology data is incomplete.
Changes:
- Added client resolution before block allocation.
- Changed skipped write sorting to return
null. - Expanded unit and integration tests for fallback, caching, and topology cases.
File summaries
| File | Description |
|---|---|
| hadoop-ozone/ozone-manager/src/test/java/org/apache/hadoop/ozone/om/request/key/TestOMAllocateBlockRequest.java | Updated as part of this pull request. |
| hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/request/key/OMKeyRequest.java | Updated as part of this pull request. |
| hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/KeyManagerImpl.java | Updated as part of this pull request. |
| hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/KeyManager.java | Updated as part of this pull request. |
| hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/TestOMSortDatanodes.java | Updated as part of this pull request. |
Review details
- Files reviewed: 5/5 changed files
- Comments generated: 0
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| public Node resolveClientForWrite(String clientMachine, NetworkTopology clusterMap) { | ||
| Preconditions.checkArgument(!StringUtils.isEmpty(clientMachine), "clientMachine is empty"); | ||
| Objects.requireNonNull(clusterMap, "clusterMap is null"); | ||
| return captureLatencyNs(metrics.getAllocateBlockSortDatanodesLatencyNs(), |
There was a problem hiding this comment.
Please use a separate metric for client resolution. ConcurrentMutableRate exports one NumOps/AvgTime pair, so recording the once-per-request lookup here and every uncached pipeline sort into AllocateBlockSortDatanodesLatencyNs makes the count and average represent neither operation. Please add AllocateBlockResolveClientLatencyNs and keep the existing metric for sorting.
What changes were proposed?
Follow-up to #10633.
nullwhen OM skips sorting because a pipeline datanode is missing from its topology, preserving the pipeline's order.JIRA
https://issues.apache.org/jira/browse/HDDS-15941
Testing
TestOMAllocateBlockRequestandTestOMSortDatanodespassedhttps://github.com/chihsuan/ozone/actions/runs/34728833801
Generated-by: Claude Code (Claude Opus 5)