You are viewing a plain text version of this content. The canonical link for it is here.
Posted to pr@cassandra.apache.org by GitBox <gi...@apache.org> on 2021/08/27 22:01:55 UTC

[GitHub] [cassandra] maedhroz commented on a change in pull request #1173: CASSANDRA-16883 Weak visibility guarantees of Accumulator can lead to failure to recognize digest mismatches

maedhroz commented on a change in pull request #1173:
URL: https://github.com/apache/cassandra/pull/1173#discussion_r697740846



##########
File path: src/java/org/apache/cassandra/service/ReadCallback.java
##########
@@ -158,7 +158,14 @@ public void response(MessageIn<ReadResponse> message)
         int n = waitingFor(message.from)
               ? recievedUpdater.incrementAndGet(this)
               : received;
-        if (n >= blockfor && resolver.isDataPresent())
+
+        /*
+         * Ensure that data is present and the response accumulator has properly published the
+         * responses it has received. This may result in not signaling immediately when we receive
+         * the minimum number of required results, but it guarantees at least the minimum will
+         * be accessible when we do signal. (see rdar://77320313)
+         */
+        if (n >= blockfor && resolver.responses.size() >= blockfor && resolver.isDataPresent())

Review comment:
       For reviewers: remove this line and run the attached test. You should eventually get an assertion error.




-- 
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: pr-unsubscribe@cassandra.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: pr-unsubscribe@cassandra.apache.org
For additional commands, e-mail: pr-help@cassandra.apache.org