[ 
https://issues.apache.org/jira/browse/CASSANDRA-19471?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17829919#comment-17829919
 ] 

Brandon Williams commented on CASSANDRA-19471:
----------------------------------------------

I believe the root cause is that direct mode initially allocates only the block 
size on disk (4k in this case) while legacy allocates the full segment size 
(1MB).  This leaves legacy mode with enough headroom for mutations like schema 
changes without changing the on-disk size, while direct mode will reflect them.

This is good news though, because it shows the test is faulty.  First, it 
shouldn't begin measuring the CL until _after_ the schema is created since 
those mutations are always durable.  Second, it needs to reset the batch mode 
options when it recreates the cluster for the second run, otherwise the CL gets 
an asynchronous flush that breaks the test again.  I've made those changes 
[here|https://github.com/driftx/cassandra-dtest/commit/2499a609b7a8bd750417c3fa56855ab1e9e800f1]
 and 
[here|https://app.circleci.com/pipelines/github/driftx/cassandra/1536/workflows/150c6753-e905-4503-9f58-f6c7e8357881]
 is a circle run with repeats for latest/non-latest to make sure the test still 
works, and a full latest gamut to make sure nothing else was broken by the 
direct CL changes.

> Commitlog with direct io fails test_change_durable_writes
> ---------------------------------------------------------
>
>                 Key: CASSANDRA-19471
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-19471
>             Project: Cassandra
>          Issue Type: Bug
>          Components: Local/Commit Log
>            Reporter: Brandon Williams
>            Assignee: Brandon Williams
>            Priority: Normal
>             Fix For: 5.0-rc, 5.x
>
>
> With the commitlog_disk_access_mode set to direct, and the improved 
> configuration_test.py::TestConfiguration::test_change_durable_writes from 
> CASSANDRA-19465, this fails with either:
> {noformat}
>  AssertionError: Commitlog was written with durable writes disabled
> {noformat}
> Or what appears to be the original exception reported in CASSANDRA-19465:
> {noformat}
>   node1: ERROR [PERIODIC-COMMIT-LOG-SYNCER] 2024-03-14 17:16:08,465 
> StorageService.java:631 - Stopping native transport
>   node1: ERROR [MutationStage-5] 2024-03-14 17:16:08,465 
> StorageProxy.java:1670 - Failed to apply mutation locally :
>   java.lang.IllegalArgumentException: newPosition > limit: (1048634 > 1048576)
>         at java.base/java.nio.Buffer.createPositionException(Buffer.java:341)
>         at java.base/java.nio.Buffer.position(Buffer.java:316)
>         at java.base/java.nio.ByteBuffer.position(ByteBuffer.java:1516)
>         at 
> java.base/java.nio.MappedByteBuffer.position(MappedByteBuffer.java:321)
>         at 
> java.base/java.nio.MappedByteBuffer.position(MappedByteBuffer.java:73)
>         at 
> org.apache.cassandra.db.commitlog.CommitLogSegment.allocate(CommitLogSegment.java:216)
>         at 
> org.apache.cassandra.db.commitlog.CommitLogSegmentManagerStandard.allocate(CommitLogSegmentManagerStandard.java:52)
>         at org.apache.cassandra.db.commitlog.CommitLog.add(CommitLog.java:307)
>         at 
> org.apache.cassandra.db.CassandraKeyspaceWriteHandler.addToCommitLog(CassandraKeyspaceWriteHandler.java:99)
>         at 
> org.apache.cassandra.db.CassandraKeyspaceWriteHandler.beginWrite(CassandraKeyspaceWriteHandler.java:53)
>         at org.apache.cassandra.db.Keyspace.applyInternal(Keyspace.java:612)
>         at org.apache.cassandra.db.Keyspace.apply(Keyspace.java:497)
>         at org.apache.cassandra.db.Mutation.apply(Mutation.java:244)
>         at org.apache.cassandra.db.Mutation.apply(Mutation.java:264)
>         at 
> org.apache.cassandra.service.StorageProxy$4.runMayThrow(StorageProxy.java:1664)
>         at 
> org.apache.cassandra.service.StorageProxy$LocalMutationRunnable.run(StorageProxy.java:2624)
>         at 
> org.apache.cassandra.concurrent.ExecutionFailure$2.run(ExecutionFailure.java:163)
>         at org.apache.cassandra.concurrent.SEPWorker.run(SEPWorker.java:143)
>         at 
> io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
>         at java.base/java.lang.Thread.run(Thread.java:833)
>   node1: ERROR [PERIODIC-COMMIT-LOG-SYNCER] 2024-03-14 17:16:08,470 
> StorageService.java:636 - Stopping gossiper
> {noformat}



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org
For additional commands, e-mail: commits-h...@cassandra.apache.org

Reply via email to