aweisberg commented on code in PR #3777:
URL: https://github.com/apache/cassandra/pull/3777#discussion_r1915472079


##########
src/java/org/apache/cassandra/batchlog/BatchlogManager.java:
##########
@@ -454,12 +454,12 @@ public void finish(Set<UUID> hintedNodes)
                 if (accordResult != null)
                 {
                     IAccordService accord = AccordService.instance();
-                    TxnResult.Kind kind = accord.getTxnResult(accordResult, 
true, ConsistencyLevel.QUORUM, accordTxnStart).kind();
+                    TxnResult.Kind kind = 
accord.getTxnResult(accordResult).kind();
                     if (kind == retry_new_protocol)
                         throw new RetryOnDifferentSystemException();
                 }
             }
-            catch 
(WriteTimeoutException|WriteFailureException|RetryOnDifferentSystemException  e)
+            catch (WriteTimeoutException | WriteFailureException | 
RetryOnDifferentSystemException | TopologyMismatch e)

Review Comment:
   I think writing the hint is fine because when we attempt to deliver the hint 
we will split again and then splitting will throw an exception when it finds 
the table doesn't exist.
   
   What you have discovered and what is not fine is that splitting is a 
fallible operation in that way and the error handling is acceptable I think for 
regular requests, but for batchlog and hints the missing error handling for 
splitting could block progress.
   
   I spent a bunch of time looking at how hints and batchlog would respond to 
getting an error back from a dropped table.
   
   The write response handler used by batchlog actually doesn't reveal the 
underlying error for a dropped table it's just a `WriteFailureException` which 
then causes hints to be written so `TopologyMismatch` would behave similar.
   
   Also the batchlog won't replay the batch again once it delegates to hints 
for the rest of delivery. Batchlog in general doesn't have its own retry 
mechanism so the options are only drop on the floor or write the hint.
   
   Hints have an outcome that can be an error or timeout but in either case it 
retries the page! So if it's a dropped table I don't see how hints would avoid 
being stuck sending a hint that can't be applied.
   
   On the hint receiving side it's going to fail at message deserialization 
with `UnknownTableException` which is a subclass of 
`IncompatibleSchemaException` and that will be sent in the error response but 
`HintDispatcher.Callback` doesn't examine the nature of the error at all.
   
   It really looks like batchlog and hints don't play well with dropping tables 
but I haven't validated that experimentally. It 100% looks like they would just 
wedge on the undeliverable hints.



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