This is an automated email from the ASF dual-hosted git repository.
ifesdjeen pushed a commit to branch cep-15-accord
in repository https://gitbox.apache.org/repos/asf/cassandra.git
The following commit(s) were added to refs/heads/cep-15-accord by this push:
new fb7e29dd42 Fix Journal segment allocation/switch race condition
fb7e29dd42 is described below
commit fb7e29dd4298a5ecf93a3c2404ce0f4409e56627
Author: Alex Petrov <[email protected]>
AuthorDate: Mon Sep 9 15:05:32 2024 +0200
Fix Journal segment allocation/switch race condition
Patch by Alex Petrov; reviewed by Aleksey Yeschenko for CASSANDRA-19866
---
src/java/org/apache/cassandra/journal/Journal.java | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/src/java/org/apache/cassandra/journal/Journal.java
b/src/java/org/apache/cassandra/journal/Journal.java
index c092363af7..50a3058ec9 100644
--- a/src/java/org/apache/cassandra/journal/Journal.java
+++ b/src/java/org/apache/cassandra/journal/Journal.java
@@ -198,6 +198,10 @@ public class Journal<K, V> implements Shutdownable
public boolean isFlushed(RecordPointer recordPointer)
{
+ Segment<K, V> current = currentSegment;
+ if (current.descriptor.timestamp == recordPointer.segment)
+ return current.isFlushed(recordPointer.position);
+
return segments.get().isFlushed(recordPointer);
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]