Xushaohong commented on code in PR #4978:
URL: https://github.com/apache/ozone/pull/4978#discussion_r1244604297
##########
hadoop-ozone/common/src/main/java/org/apache/hadoop/ozone/om/exceptions/OMException.java:
##########
@@ -262,6 +262,7 @@ public enum ResultCodes {
INVALID_SNAPSHOT_ERROR,
CONTAINS_SNAPSHOT,
SSL_CONNECTION_FAILURE,
- RENAME_OPEN_FILE
+ RENAME_OPEN_FILE,
+ UNKNOWN_REQUEST
Review Comment:
Here we can reuse the old one.
https://github.com/apache/ozone/blob/6693f459f153675689eee8611bff15f3b5812021/hadoop-ozone/common/src/main/java/org/apache/hadoop/ozone/om/exceptions/OMException.java#L178
##########
hadoop-ozone/interface-client/src/main/proto/OmClientProtocol.proto:
##########
@@ -488,6 +489,7 @@ enum Status {
CONTAINS_SNAPSHOT = 88;
SSL_CONNECTION_FAILURE = 89;
RENAME_OPEN_FILE = 90;
+ UNKNOWN_REQUEST = 91;
Review Comment:
Same as above
##########
hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/ratis/TestOzoneManagerRatisRequest.java:
##########
@@ -87,4 +89,24 @@ public void testRequestWithNonExistentBucket()
oe.getResult());
}
}
+
+ @Test
+ public void testUnknownRequestHandling() throws IOException {
Review Comment:
It is better to test from
org.apache.hadoop.ozone.protocolPB.OzoneManagerProtocolServerSideTranslatorPB#processRequest.
Need to make sure the case stands for both conditions (non-ratis and ratis).
##########
hadoop-ozone/common/src/main/java/org/apache/hadoop/ozone/OmUtils.java:
##########
@@ -268,6 +268,7 @@ public static boolean isReadOnly(
case SnapshotDiff:
case ListSnapshotDiffJobs:
case TransferLeadership:
+ case TestUnknownCommand:
Review Comment:
This line should be removed, otherwise it will be considered read request
and not go into the ```OzoneManagerRatisUtils#createClientRequest```
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]