Skip to content

HDDS-9674. Read from non-datanode host should consider topology#5610

Merged
adoroszlai merged 2 commits intoapache:masterfrom
adoroszlai:HDDS-9674
Nov 28, 2023
Merged

HDDS-9674. Read from non-datanode host should consider topology#5610
adoroszlai merged 2 commits intoapache:masterfrom
adoroszlai:HDDS-9674

Conversation

@adoroszlai
Copy link
Contributor

What changes were proposed in this pull request?

Client's node (place in the topology) is looked up via SCMNodeManager.getNodesByAddress. But SCMNodeManager only knows about datanodes. If the request comes from a host which does not run Ozone Datanode, then read will not be topology-aware. While read cannot be host-local in this case, it still could benefit from being rack-local.

Examples where such non-datanode hosts may occur:

  • edge nodes (client-only)
  • dedicated metadata nodes (OM, SCM, etc.)
  • Docker/Kubernetes containers running only one service

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

How was this patch tested?

Added unit test.

Manually tested on ozone-topology environment:

  • added s3g container in docker-compose.yaml with address 10.5.0.73
  • added scm (in rack1) and s3g (in rack2) in topology network-config
  • changed test.sh to run basic/basic.robot and s3/objectputget.robot
  • enabled debug logging for KeyManagerImpl

OM log shows datanodes in the same rack were sorted to head of list for both scm and s3g:

DEBUG om.KeyManagerImpl: Sorted datanodes [8fa9bb3e-3ff4-4f9b-a71e-0ffffcd70be5(ozone-topology_datanode_5_1.ozone-topology_net/10.5.0.8), 04478345-c6ef-4c2b-a688-8819babd5db7(ozone-topology_datanode_2_1.ozone-topology_net/10.5.0.5), a8a8f57f-a0dc-41e5-9bcc-f7278f0ba7c3(ozone-topology_datanode_4_1.ozone-topology_net/10.5.0.7)] for client 10.5.0.71, result: [04478345-c6ef-4c2b-a688-8819babd5db7(ozone-topology_datanode_2_1.ozone-topology_net/10.5.0.5), a8a8f57f-a0dc-41e5-9bcc-f7278f0ba7c3(ozone-topology_datanode_4_1.ozone-topology_net/10.5.0.7), 8fa9bb3e-3ff4-4f9b-a71e-0ffffcd70be5(ozone-topology_datanode_5_1.ozone-topology_net/10.5.0.8)]
DEBUG om.KeyManagerImpl: Sorted datanodes [8fa9bb3e-3ff4-4f9b-a71e-0ffffcd70be5(ozone-topology_datanode_5_1.ozone-topology_net/10.5.0.8), 04478345-c6ef-4c2b-a688-8819babd5db7(ozone-topology_datanode_2_1.ozone-topology_net/10.5.0.5), a8a8f57f-a0dc-41e5-9bcc-f7278f0ba7c3(ozone-topology_datanode_4_1.ozone-topology_net/10.5.0.7)] for client 10.5.0.73, result: [a8a8f57f-a0dc-41e5-9bcc-f7278f0ba7c3(ozone-topology_datanode_4_1.ozone-topology_net/10.5.0.7), 8fa9bb3e-3ff4-4f9b-a71e-0ffffcd70be5(ozone-topology_datanode_5_1.ozone-topology_net/10.5.0.8), 04478345-c6ef-4c2b-a688-8819babd5db7(ozone-topology_datanode_2_1.ozone-topology_net/10.5.0.5)]

CI:
https://github.com/adoroszlai/ozone/actions/runs/6882001098

@adoroszlai adoroszlai self-assigned this Nov 15, 2023
@adoroszlai adoroszlai added the scm label Nov 15, 2023
@kerneltime kerneltime requested a review from ChenSammi November 15, 2023 23:05
@kerneltime
Copy link
Contributor

@tanvipenumudy @vtutrinov @ibrusentsev can you please take a look?

@vtutrinov
Copy link
Contributor

@adoroszlai thanks for the PR, LGTM+

@ibrusentsev
Copy link
Contributor

No objections, LGTM

@adoroszlai adoroszlai requested review from GeorgeJahad and removed request for GeorgeJahad November 16, 2023 18:20
Copy link
Contributor

@tanvipenumudy tanvipenumudy left a comment

Choose a reason for hiding this comment

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

The changes look good to me +1, thank you.

@adoroszlai
Copy link
Contributor Author

@ChenSammi please review

Copy link
Contributor

@sodonnel sodonnel left a comment

Choose a reason for hiding this comment

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

LGTM pending green CI.

@adoroszlai adoroszlai merged commit ee6a4ad into apache:master Nov 28, 2023
@adoroszlai
Copy link
Contributor Author

Thanks @ibrusentsev, @sodonnel, @tanvipenumudy, @vtutrinov for the review.

@adoroszlai adoroszlai deleted the HDDS-9674 branch November 28, 2023 14:20
jojochuang pushed a commit to jojochuang/ozone that referenced this pull request Feb 1, 2024
…topology (apache#5610)

(cherry picked from commit ee6a4ad)
Change-Id: I627ec0c82700bdc357ef5c3ae6fa496eaa8826ae
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants