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

 ##########
 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.min(progress, 99.0);
 
 Review comment:
   I suggest 99.9 instead of 99.0. It allows more room to see a changing number 
that's not "stuck" at 99.0%, but avoids the misleading behavior of being stuck 
at 100% for a long time if we just used 100.0 here.

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