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


##########
src/java/org/apache/cassandra/service/AbstractWriteResponseHandler.java:
##########
@@ -176,7 +183,40 @@ public void get() throws WriteTimeoutException, 
WriteFailureException, RetryOnDi
         }
 
         if (replicaPlan.stillAppliesTo(ClusterMetadata.current()))
+        {
+            if (warningContext != null)
+            {
+                WriteWarningsSnapshot snapshot = warningContext.snapshot();
+                if (!snapshot.isEmpty())
+                {
+                    if (hintOnFailure != null)
+                    {
+                        CoordinatorWriteWarnings.update(hintOnFailure.get(), 
snapshot);
+                    }
+                    else
+                    {
+                        logger.warn("Cannot propagate write warnings to 
coordinator because hintOnFailure is null. " +

Review Comment:
   if you use `grep` or intellij indexes to find where this comes from you will 
see `BatchlogResponseHandler` makes this null; which isn't a programming error. 
 The field also annotates 
   
   ```
       private @Nullable final Supplier<Mutation> hintOnFailure;
   ```
   
   denoted that this is in fact expected behavior
   
   1. `logger.warn` can spam and flood operator logs, be very careful of this 
in the hot path
   2. null looks like expected behavior for batch log, so not being able to 
update is fine



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