[
https://issues.apache.org/jira/browse/CASSANDRA-18710?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17779928#comment-17779928
]
Brandon Williams commented on CASSANDRA-18710:
----------------------------------------------
Before CASSANDRA-17071 (and currently in 4.0) we also force recycled the
commitlog, but sooner in
[Schema.dropTable|https://github.com/apache/cassandra/blob/cassandra-4.0/src/java/org/apache/cassandra/schema/Schema.java#L803],
and it didn't cause small flushes of the active CF. After CASSANDRA-17071
that has moved to CFS.onTableDropped and it seems the timing of this now does
cause the small flushes. I'm not super strong in this area of the code but it
seems like maybe this could be massaged again to prevent this from happening as
before?
Here's a reproduction with additional logging at ERROR showing the drop of
table_00 causing the small flush of table_01 shortly after creation:
{noformat}
[junit-timeout] INFO [main] 2023-10-25 20:12:32,442 ColumnFamilyStore.java:493
- Initializing cql_test_keyspace_alt.table_01
[junit-timeout] DEBUG [main] 2023-10-25 20:12:32,443
DiskBoundaryManager.java:54 - Refreshing disk boundary cache for
cql_test_keyspace_alt.table_01
[junit-timeout] DEBUG [main] 2023-10-25 20:12:32,443
DiskBoundaryManager.java:93 - Got local ranges [] (ringVersion = 0)
[junit-timeout] DEBUG [main] 2023-10-25 20:12:32,447
DiskBoundaryManager.java:57 - Updating boundaries from null to
DiskBoundaries{directories=[DataDirectory{location=build/test/cassandra/data}],
positions=null, ringVersion=0, directoriesVersion=0} for
cql_test_keyspace_alt.table_01
[junit-timeout] INFO [main] 2023-10-25 20:12:32,453 ViewManager.java:127 - Not
submitting build tasks for views in keyspace cql_test_keyspace_alt as storage
service is not initialized
[junit-timeout] DEBUG [OptionalTasks:1] 2023-10-25 20:12:32,459
DefaultSchemaUpdateHandler.java:259 - Schema updated:
SchemaTransformationResult{e9de990e-f2fd-3f3e-97fb-e351f5dae8d3 -->
111d2c16-fe3d-3fcf-9dc1-9cafe8d9b926, diff=KeyspacesDiff{created=[],
dropped=[],
altered=[KeyspaceDiff{before=KeyspaceMetadata{name=cql_test_keyspace,
kind=REGULAR, params=KeyspaceParams{durable_writes=true,
replication=ReplicationParams{class=org.apache.cassandra.locator.SimpleStrategy,
replication_factor=1}}, tables=[cql_test_keyspace.table_00], views=[],
functions=[], types=[]}, after=KeyspaceMetadata{name=cql_test_keyspace,
kind=REGULAR, params=KeyspaceParams{durable_writes=true,
replication=ReplicationParams{class=org.apache.cassandra.locator.SimpleStrategy,
replication_factor=1}}, tables=[], views=[], functions=[], types=[]},
tables=Diff{created=[], dropped=[cql_test_keyspace.table_00], altered=[]},
views=Diff{created=[], dropped=[], altered=[]}, types=Diff{created=[],
dropped=[], altered=[]}, udfs=Diff{created=[], dropped=[], altered=[]},
udas=Diff{created=[], dropped=[], altered=[]}}]}}
[junit-timeout] ERROR [OptionalTasks:1] 2023-10-25 20:12:32,571
ColumnFamilyStore.java:1013 - Bad flush reason: COMMITLOG_DIRTY
[junit-timeout] ERROR [OptionalTasks:1] 2023-10-25 20:12:32,571
ColumnFamilyStore.java:1014 -
[org.apache.cassandra.db.ColumnFamilyStore.logFlush(ColumnFamilyStore.java:1012)
[junit-timeout]
org.apache.cassandra.db.ColumnFamilyStore.switchMemtable(ColumnFamilyStore.java:999)
[junit-timeout]
org.apache.cassandra.db.ColumnFamilyStore.switchMemtableIfCurrent(ColumnFamilyStore.java:981)
[junit-timeout]
org.apache.cassandra.db.ColumnFamilyStore.flushMemtable(ColumnFamilyStore.java:1065)
[junit-timeout]
org.apache.cassandra.db.ColumnFamilyStore.forceFlush(ColumnFamilyStore.java:1040)
[junit-timeout]
org.apache.cassandra.db.commitlog.AbstractCommitLogSegmentManager.flushDataFrom(AbstractCommitLogSegmentManager.java:457)
[junit-timeout]
org.apache.cassandra.db.commitlog.AbstractCommitLogSegmentManager.forceRecycleAll(AbstractCommitLogSegmentManager.java:334)
[junit-timeout]
org.apache.cassandra.db.commitlog.CommitLog.forceRecycleAllSegments(CommitLog.java:261)
[junit-timeout]
org.apache.cassandra.db.ColumnFamilyStore.onTableDropped(ColumnFamilyStore.java:3382)
[junit-timeout] org.apache.cassandra.db.Keyspace.dropCf(Keyspace.java:383)
[junit-timeout] org.apache.cassandra.schema.Schema.dropTable(Schema.java:756)
[junit-timeout]
org.apache.cassandra.schema.Schema.lambda$alterKeyspace$14(Schema.java:672)
[junit-timeout] java.base/java.lang.Iterable.forEach(Iterable.java:75)
[junit-timeout]
org.apache.cassandra.schema.Schema.alterKeyspace(Schema.java:672)
[junit-timeout]
org.apache.cassandra.schema.Schema.lambda$merge$12(Schema.java:655)
[junit-timeout]
com.google.common.collect.ImmutableList.forEach(ImmutableList.java:422)
[junit-timeout] org.apache.cassandra.schema.Schema.merge(Schema.java:655)
[junit-timeout]
org.apache.cassandra.schema.Schema.mergeAndUpdateVersion(Schema.java:607)
[junit-timeout]
org.apache.cassandra.schema.DefaultSchemaUpdateHandler.updateSchema(DefaultSchemaUpdateHandler.java:260)
[junit-timeout]
org.apache.cassandra.schema.DefaultSchemaUpdateHandler.apply(DefaultSchemaUpdateHandler.java:242)
[junit-timeout] org.apache.cassandra.schema.Schema.transform(Schema.java:620)
[junit-timeout]
org.apache.cassandra.cql3.statements.schema.AlterSchemaStatement.execute(AlterSchemaStatement.java:114)
[junit-timeout]
org.apache.cassandra.cql3.statements.schema.AlterSchemaStatement.executeLocally(AlterSchemaStatement.java:71)
[junit-timeout]
org.apache.cassandra.cql3.CQLTester.schemaChange(CQLTester.java:1460)
[junit-timeout] org.apache.cassandra.cql3.CQLTester$2.run(CQLTester.java:471)
[junit-timeout]
org.apache.cassandra.concurrent.ExecutionFailure$1.run(ExecutionFailure.java:133)
[junit-timeout]
org.apache.cassandra.concurrent.ExecutionFailure$1.run(ExecutionFailure.java:133)
[junit-timeout]
java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:539)
[junit-timeout]
java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
[junit-timeout]
java.base/java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:304)
{noformat}
> Test failure:
> org.apache.cassandra.io.DiskSpaceMetricsTest.testFlushSize-.jdk17 (from
> org.apache.cassandra.io.DiskSpaceMetricsTest-.jdk17)
> ------------------------------------------------------------------------------------------------------------------------------------------
>
> Key: CASSANDRA-18710
> URL: https://issues.apache.org/jira/browse/CASSANDRA-18710
> Project: Cassandra
> Issue Type: Bug
> Components: Test/unit
> Reporter: Ekaterina Dimitrova
> Assignee: Brandon Williams
> Priority: Normal
> Fix For: 5.0.x, 5.x
>
> Attachments: org.apache.cassandra.io.DiskSpaceMetricsTest.txt
>
>
> Seen here:
> [https://ci-cassandra.apache.org/job/Cassandra-trunk/1644/testReport/org.apache.cassandra.io/DiskSpaceMetricsTest/testFlushSize__jdk17/]
> h3.
> {code:java}
> Error Message
> expected:<7200.0> but was:<1367.83970468544>
> Stacktrace
> junit.framework.AssertionFailedError: expected:<7200.0> but
> was:<1367.83970468544> at
> org.apache.cassandra.io.DiskSpaceMetricsTest.testFlushSize(DiskSpaceMetricsTest.java:119)
> at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native
> Method) at
> java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
> at
> java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
> {code}
>
--
This message was sent by Atlassian Jira
(v8.20.10#820010)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]