-
Notifications
You must be signed in to change notification settings - Fork 8.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
HDFS-17306. RBF: Router should not return nameservices that does not enable observer nodes in RpcResponseHeaderProto #6385
HDFS-17306. RBF: Router should not return nameservices that does not enable observer nodes in RpcResponseHeaderProto #6385
Conversation
…r namenodes in RpcResponseHeaderProto
💔 -1 overall
This message was automatically generated. |
@@ -85,7 +85,11 @@ public void setResponseHeaderState(RpcResponseHeaderProto.Builder headerBuilder) | |||
return; | |||
} | |||
RouterFederatedStateProto.Builder builder = RouterFederatedStateProto.newBuilder(); | |||
namespaceIdMap.forEach((k, v) -> builder.putNamespaceStateIds(k, v.get())); | |||
namespaceIdMap.forEach((k, v) -> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we have a test for this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done, Thanks
🎊 +1 overall
This message was automatically generated. |
@LiuGuH Thanks for your contribution! We need to fix checkstyle. |
Thanks for review. Fixed |
🎊 +1 overall
This message was automatically generated. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you also check the list in DFS_ROUTER_OBSERVER_READ_OVERRIDES
?
If dfs.namenode.state.context.enabled
is true on the namenode then this change won't have impact on calls to that nameservice, even though observer reads are disabled for it in the router.
I'm okay with saving this optimization for a separate pull request though.
Thanks for review . And I will be add a separate pull request for DFS_ROUTER_OBSERVER_READ_DEFAULT_KEY and DFS_ROUTER_OBSERVER_READ_OVERRIDES check. |
Great. Thanks for the contribution. |
This is implemented in #6412 . Thanks for review @simbadzina |
…enable observer nodes in RpcResponseHeaderProto (apache#6385)
Description of PR
JIRA: HDFS-17306. RBF: Router should not return nameservices that does not enable observer nodes in RpcResponseHeaderProto.
If a cluster has 3 nameservices: ns1, ns2,ns3, and ns1 has observer nodes, and client comminutes with nameservices via DFSRouter.
If DFS_ROUTER_OBSERVER_READ_DEFAULT_KEY enable, the client will receive all nameservices in RpcResponseHeaderProto. And ns2,ns3 statidid is Long.MIN_VALUE,that is not necessary.
We should reduce rpc response size if nameservices don't enable observer nodes.