Details
-
Improvement
-
Status: Resolved
-
Major
-
Resolution: Fixed
-
None
Description
As of now the server side (om, scm) errors are not propagated to the client.
For example if ozone is started with one single datanode:
docker-compose exec ozoneManager ozone sh key put -r THREE /vol1/bucket1/test2 NOTICE.txt Create key failed, error:KEY_ALLOCATION_ERROR
There is no information here about the missing datanodes, or missing pipelines.
There are multiple problems which should be fixed:
1. type safety
In ScmBlockLocationProtocolClientSideTranslatorPB the server (om) side exceptions are transformed to IOException where the original status is added to the message:
For example:
throw new IOException("Volume quota change failed, error:" + resp.getStatus());
In s3 gateway it's very hard to handle the different errors in a proper way. The current code:
if (!ex.getMessage().contains("KEY_NOT_FOUND")) { result.addError( new Error(keyToDelete.getKey(), "InternalError", ex.getMessage()));
2. message
The exception message is not propagated in the om response just the status code
3. status code and error message are handled in a different way
To propagate error code and status code to the client we need to handle them in the same way. But the Status field is part of the specific response objects (CreateVolumeRequest) and not the OMRequest. I propose to put both StatusCode and error message to the OMRequest.
4. The status codes in OzoneManagerProtocol.proto/Status enum is not in sync with OmException.ResultCodes.
It would be easy to use the same strings for both enums. With a unit test we can ensure that they have the same names in the same order.
Attachments
Attachments
Issue Links
- links to