iamaleksey commented on code in PR #2982:
URL: https://github.com/apache/cassandra/pull/2982#discussion_r1450504400
##########
src/java/org/apache/cassandra/journal/Flusher.java:
##########
@@ -155,21 +158,23 @@ public void doRun(Interruptible.State state) throws
InterruptedException
private void doFlush()
{
journal.selectSegmentToFlush(segmentsToFlush);
+ segmentsToFlush.sort(comparing(s -> s.descriptor));
+
// only schedule onSuccess callbacks for a segment if the
preceding segments
// have been fully flushed, to preserve 1:1 mapping between
record's position
// in the journal and onSuccess callback scheduling order
boolean scheduleOnSuccessCallbacks = true;
try
{
- for (ActiveSegment<K> segment : segmentsToFlush)
+ for (ActiveSegment<K, V> segment : segmentsToFlush)
{
try
{
scheduleOnSuccessCallbacks = doFlush(segment,
scheduleOnSuccessCallbacks) && scheduleOnSuccessCallbacks;
Review Comment:
See the comment above. Renamed the method to reflect its real intention - to
tell if the segment is now fully completed *and* flushed. It will be flushed
again in the future, in the next iteration following the completion of the last
write to that segment.
--
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]