Copilot commented on code in PR #11096:
URL: https://github.com/apache/ozone/pull/11096#discussion_r3840241407
##########
hadoop-ozone/ozone-manager/src/test/java/org/apache/hadoop/ozone/om/ratis/TestOzoneManagerRatisServer.java:
##########
@@ -275,4 +277,23 @@ public void
verifyRaftGroupIdGenerationWithCustomOmServiceId(@TempDir Path metaD
assertEquals(raftGroupId.toByteString().size(), 16);
newOmRatisServer.stop();
}
+
+ @Test
+ public void testRetryCacheExpiryTime(@TempDir Path ratisDir) {
+ assertEquals(300_000, retryCacheExpiryMillis(new OzoneConfiguration(),
ratisDir));
+
+ OzoneConfiguration currentKeyConf = new OzoneConfiguration();
+ currentKeyConf.set(OMConfigKeys.OZONE_OM_HA_PREFIX +
".raft.server.retrycache.expirytime", "42s");
+ assertEquals(42_000, retryCacheExpiryMillis(currentKeyConf, ratisDir));
Review Comment:
Avoid hardcoding the Ratis key segment in this test; using
RaftServerConfigKeys.PREFIX makes the test resilient if the Ratis prefix ever
changes and matches the pattern used elsewhere in the codebase.
##########
hadoop-hdds/common/src/main/java/org/apache/hadoop/hdds/conf/OzoneConfiguration.java:
##########
@@ -318,6 +318,8 @@ private static void addDeprecatedKeys() {
+ RaftServerConfigKeys.PREFIX + "." + "rpcslowness.timeout",
HDDS_DATANODE_RATIS_PREFIX_KEY + "."
+ RaftServerConfigKeys.PREFIX + "." + "rpc.slowness.timeout"),
+ new DeprecationDelta("ozone.om.ratis.server.retry.cache.timeout",
+ "ozone.om.ha.raft.server.retrycache.expirytime"),
Review Comment:
The replacement key is currently hardcoded as a full string. Building it
with RaftServerConfigKeys.PREFIX avoids duplicating the Ratis prefix and
reduces the chance of typos in future edits.
--
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]