chihsuan commented on code in PR #11096:
URL: https://github.com/apache/ozone/pull/11096#discussion_r3878046675


##########
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/ratis/OzoneManagerRatisServer.java:
##########
@@ -847,13 +852,14 @@ private static void setRaftRpcProperties(RaftProperties 
properties, Configuratio
   }
 
   private static void setRaftRetryCacheProperties(RaftProperties properties, 
ConfigurationSource conf) {
-    // Set timeout for server retry cache entry
-    TimeUnit retryCacheTimeoutUnit = 
OMConfigKeys.OZONE_OM_RATIS_SERVER_RETRY_CACHE_TIMEOUT_DEFAULT.getUnit();
-    final TimeDuration retryCacheTimeout = 
TimeDuration.valueOf(conf.getTimeDuration(
-        OMConfigKeys.OZONE_OM_RATIS_SERVER_RETRY_CACHE_TIMEOUT_KEY,
-        
OMConfigKeys.OZONE_OM_RATIS_SERVER_RETRY_CACHE_TIMEOUT_DEFAULT.getDuration(), 
retryCacheTimeoutUnit),
-        retryCacheTimeoutUnit);
-    RaftServerConfigKeys.RetryCache.setExpiryTime(properties, 
retryCacheTimeout);
+    if (conf.get(RETRY_CACHE_TIMEOUT_DEPRECATED_KEY) == null) {
+      return;
+    }
+    final String currentKey = OZONE_OM_HA_PREFIX + "." + 
RaftServerConfigKeys.RetryCache.EXPIRY_TIME_KEY;
+    LOG.warn("{} is deprecated. Instead, use {}.", 
RETRY_CACHE_TIMEOUT_DEPRECATED_KEY, currentKey);

Review Comment:
   I was thinking about the migration path. Someone who sees this warning will 
probably move their value straight over to the new key. If it was written as a 
bare `600000`, that reads as ms here but seconds there. Would printing the 
resolved value in the warning help?
   
   For example:
   
   
   ```java
       final TimeDuration timeout = TimeDuration.valueOf(
           conf.getTimeDuration(RETRY_CACHE_TIMEOUT_DEPRECATED_KEY, 0, 
TimeUnit.MILLISECONDS), TimeUnit.MILLISECONDS);
       LOG.warn("{} is deprecated. Instead, use {} = {}.", 
RETRY_CACHE_TIMEOUT_DEPRECATED_KEY, currentKey, timeout);
    ```



-- 
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]

Reply via email to