Skip to content

Commit 8de4c92

Browse files
committed
Make Commitlog flush data safely in Direct IO mode
patch by Maxwell Guo; reviewed by Ariel Weisberg for CASSANDRA-20692
1 parent a72dcbc commit 8de4c92

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

CHANGES.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
5.0.5
2+
* Make Commitlog flush data safely in Direct IO mode (CASSANDRA-20692)
23
* Get SAI MemtableIndex refs before SSTableIndex refs at query time (CASSANDRA-20709)
34
* Fix MAX_SEGMENT_SIZE < chunkSize in MmappedRegions::updateState (CASSANDRA-20636)
45
* Full Java 17 support (CASSANDRA-20681)

src/java/org/apache/cassandra/db/commitlog/DirectIOSegment.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,12 @@ public DirectIOSegmentBuilder(AbstractCommitLogSegmentManager segmentManager, in
177177
public DirectIOSegment build()
178178
{
179179
return new DirectIOSegment(segmentManager,
180-
path -> FileChannel.open(path, StandardOpenOption.WRITE, StandardOpenOption.READ, StandardOpenOption.CREATE, ExtendedOpenOption.DIRECT),
180+
path -> FileChannel.open(path,
181+
StandardOpenOption.WRITE,
182+
StandardOpenOption.READ,
183+
StandardOpenOption.CREATE,
184+
StandardOpenOption.DSYNC,
185+
ExtendedOpenOption.DIRECT),
181186
fsBlockSize);
182187
}
183188

0 commit comments

Comments
 (0)