ctubbsii commented on a change in pull request #381: ACCUMULO-4413 Avoid 
Copy/Sort column on WAL recovery exceeds 100%
URL: https://github.com/apache/accumulo/pull/381#discussion_r168320345
 
 

 ##########
 File path: 
server/tserver/src/main/java/org/apache/accumulo/tserver/log/LogSorter.java
 ##########
 @@ -242,7 +244,9 @@ public void 
startWatchingForRecoveryLogs(ThreadPoolExecutor distWorkQThreadPool)
         RecoveryStatus status = new RecoveryStatus();
         status.name = entries.getKey();
         try {
-          status.progress = entries.getValue().getBytesCopied() / (0.0 + 
conf.getAsBytes(Property.TSERV_WALOG_MAX_SIZE));
+          double progress = entries.getValue().getBytesCopied() / walBlockSize;
+          // to be sure progress does not exceed 100%
+          status.progress = Math.max(progress, 99.0);
 
 Review comment:
   I think this keeps the status permanently at 99%. I think we want something 
like `Math.min(progress, 99.9)`

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to