-
Notifications
You must be signed in to change notification settings - Fork 588
HDDS-14335. Container Balancer status fails due to InvalidProtocolBufferException with old SCM #9586
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
Conversation
…ing required fields: cmdType error with forward client HDDS-14335. Container Balancer status command fails with Message missing required fields: cmdType error with forward client HDDS-14335. Compatibility 1.1.0 command does not exist fix read.robot fix read.robot - 1 test-fix fix
adoroszlai
left a comment
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.
Thanks @sarvekshayr for the patch.
| if (isRunning && balancerStatusInfo != null) { | ||
| Instant startedAtInstant = Instant.ofEpochSecond(balancerStatusInfo.getStartedAt()); | ||
| LocalDateTime dateTime = | ||
| LocalDateTime.ofInstant(startedAtInstant, ZoneId.systemDefault()); |
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.
nit: Let's move these two statements inside isVerbose() (since values are only used there), and add balancerStatusInfo != null check in that if. Then we don't need a new outer else if and duplicate println.
| // HDDS-11120 - Added a rich rebalancing status info | ||
| // Backward compatibility fix - newer clients (2.0 >=) gracefully fallback to the old | ||
| // API when connecting to older servers (< 2.0) that don't support the new enum value. | ||
| if (e.getMessage() != null && e.getMessage().contains("missing required fields")) { |
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 check for the underlying InvalidProtocolBufferException instead? I'm not sure the text message will always be the same.
| ContainerBalancerStatusInfoResponseProto response = | ||
| submitRequest(Type.GetContainerBalancerStatusInfo, | ||
| builder -> builder.setContainerBalancerStatusInfoRequest(request)) | ||
| .getContainerBalancerStatusInfoResponse(); |
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.
nit: please reduce indent of "line continuation" from 8 to 4 while already touching these lines.
sumitagrawl
left a comment
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.
@sarvekshayr This is not required to be fixed, as support compatibility from lower version to higher version. But not support higher version client to lower version server.
siddhantsangwan
left a comment
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.
I think the earlier PR that introduced rich status made some wrong decisions. My suggestion would be to just use the original ContainerBalancerStatusRequestProto and ContainerBalancerStatusResponseProto when verbose mode or the history option is not enabled. Otherwise use the new ContainerBalancerStatusInfoRequestProto and its response proto.
We can change the logic in ContainerBalancerStatusSubcommand to do this. Will be simpler than calling the new unsupported method and then having to handle the exception.
I'll file a separate JIRA for this. |
Why do you think so? We have cross-compatibility tests in both ways. ozone/hadoop-ozone/dist/src/main/compose/xcompat/test-old.sh Lines 28 to 32 in 7c40dde
|
What changes were proposed in this pull request?
HDDS-11120 (PR #6911) introduced a rich rebalancing status info.
This change causes a compatibility issue when an older server (without this change) is used alongside a newer client (with this change) because protobuf enum value (Type.GetContainerBalancerStatusInfo = 44) does not exist in the older server and fails with Message missing required fields: cmdType error.
What is the link to the Apache JIRA
HDDS-14335
How was this patch tested?
acceptance (compat-old) CI: https://github.com/sarvekshayr/ozone/actions/runs/20707622585/job/59441789415