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