You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ozone.apache.org by GitBox <gi...@apache.org> on 2022/03/23 18:15:44 UTC
[GitHub] [ozone] adoroszlai opened a new pull request #3231: HDDS-6429. getContainerReplicas should respect client version
adoroszlai opened a new pull request #3231:
URL: https://github.com/apache/ozone/pull/3231
## What changes were proposed in this pull request?
Pass current version from `ContainerOperationClient` to SCM. Let SCM use it during datanode details proto conversion, instead of its own current client version.
https://issues.apache.org/jira/browse/HDDS-6429
## How was this patch tested?
Regular CI:
https://github.com/adoroszlai/hadoop-ozone/actions/runs/1999677055
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org
[GitHub] [ozone] sodonnel commented on pull request #3231: HDDS-6429. getContainerReplicas should respect client version
Posted by GitBox <gi...@apache.org>.
sodonnel commented on pull request #3231:
URL: https://github.com/apache/ozone/pull/3231#issuecomment-1077567323
Thanks for fixing this. The change LGTM, but I have a general question about the need for this "client version" in this case.
I see in the server side code, the logic is like:
```
for (Port port : ports) {
if (handlesUnknownPorts || Name.V0_PORTS.contains(port.getName())) {
builder.addPorts(port.toProto());
} else {
if (LOG.isDebugEnabled()) {
LOG.debug("Skip adding {} port {} to proto message for client v{}",
port.getName(), port.getValue(), clientVersion);
}
}
}
```
So we skip emitting various ports of the client is too old to understand them. However in the proto, the port is passed as a string. So proto supports us sending any port name. The general philosophy is that proto messages are backward compatible as we never remove old files and only add new fields, as the client will not attempt to access fields it does not know how to translate.
In this case, I guess it would have been better if the proto message looked like:
```
optional Port ratisPort = 4;
optional Port replicationPort = 5;
...
```
Ie a distinct set of values rather than a repeated Ports ield. That would have avoided this whole problem. We could even have deprecated the original ports field and added the above instead and ensure the original port list was in the deprecated field. The forward compatibility would have been maintained without passing the client version string around, right? I do admit this is not as nice to work with as a list, as if you want to display the list of ports, you can no-longer just loop over them.
Even without this, could we not have solved this problem when de-serializing the proto object by simply skipping any ports we don't know about on the client, rather than omitting them on the server (again avoiding the need to pass the client version around)? I suspect this original change came about due to an unknown enum error on de-serialize.
Note I am not suggesting we change this now - I am trying to understand why things are this way, as I feel its easy to miss these things as I did when I made the original change, and it looks like there could have been better ways to solve this that look simpler to me.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org
[GitHub] [ozone] sodonnel commented on pull request #3231: HDDS-6429. getContainerReplicas should respect client version
Posted by GitBox <gi...@apache.org>.
sodonnel commented on pull request #3231:
URL: https://github.com/apache/ozone/pull/3231#issuecomment-1077756058
> The server-side change is needed for existing clients already out there.
Ah, of course. Had the de-serialize code correctly handled unknown String -> ENum conversions, we could have added the new ports without issue, correct?
This makes me think that anywhere in the code were we take proto value and convert it to an enum, we need to handle an "unknown enum" type of condition. I doubt there is an easy way to find this sort of code. It really is a bug "waiting to happen" to take a String from an serialized message and put it straight into an enum without a catch for `IllegalArgumentException`. This is probably something we should make the wider team aware of and watch out for in reviews, and ensure there are unit tests for etc.
I would not like to see a lot of usage of these CLIENT VERSIONS and less careful use of protobuf changes. Is the only place this is used right now to handle this port issue? I guess we only have the one version defined in `VERSION_HANDLES_UNKNOWN_DN_PORTS`.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org
[GitHub] [ozone] adoroszlai merged pull request #3231: HDDS-6429. getContainerReplicas should respect client version
Posted by GitBox <gi...@apache.org>.
adoroszlai merged pull request #3231:
URL: https://github.com/apache/ozone/pull/3231
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org
[GitHub] [ozone] adoroszlai commented on pull request #3231: HDDS-6429. getContainerReplicas should respect client version
Posted by GitBox <gi...@apache.org>.
adoroszlai commented on pull request #3231:
URL: https://github.com/apache/ozone/pull/3231#issuecomment-1077574726
Thanks @sodonnel for the review.
> could we not have solved this problem when de-serializing the proto object by simply skipping any ports we don't know about on the client, rather than omitting them on the server
We did change the client just like that (hence new client version: `VERSION_HANDLES_UNKNOWN_DN_PORTS=1`). The server-side change is needed for existing clients already out there.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org