dcapwell commented on code in PR #3656:
URL: https://github.com/apache/cassandra/pull/3656#discussion_r1831472067


##########
src/java/org/apache/cassandra/tcm/PaxosBackedProcessor.java:
##########
@@ -168,15 +168,31 @@ public ClusterMetadata fetchLogAndWait(Epoch waitFor, 
Retry.Deadline retryPolicy
     }
 
     @Override
-    public LogState getLocalState(Epoch start, Epoch end, boolean 
includeSnapshot, Retry.Deadline retryPolicy)
+    public LogState getLocalState(Epoch start, Epoch end, boolean 
includeSnapshot)
     {
         return log.storage().getLogState(start, end, includeSnapshot);
     }
 
     @Override
     public LogState getLogState(Epoch start, Epoch end, boolean 
includeSnapshot, Retry.Deadline retryPolicy)
     {
-        return DistributedMetadataLogKeyspace.getLogState(start, end, 
includeSnapshot);
+        while (!retryPolicy.reachedMax())
+        {
+            if (Thread.currentThread().isInterrupted())
+            {
+                Thread.currentThread().interrupt();
+                throw new RuntimeException("Can not reconstruct during 
shutdown", new InterruptedException());
+            }
+            try
+            {
+                return DistributedMetadataLogKeyspace.getLogState(start, end, 
includeSnapshot);
+            }
+            catch (RuntimeException e) // honestly best to only retry 
timeouts, but everything gets wrapped in a RuntimeException...

Review Comment:
   My style is to retry things we know are safe, such as timeouts.  Throwable 
could be things like OOM, so prefer to be more focused in the retry.
   
   I "could" always extract the root cause to do the timeout check... that 
would mean any non-timeout related IO would cause us to fail fast



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