You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cassandra.apache.org by "Josh McKenzie (Jira)" <ji...@apache.org> on 2022/05/02 19:13:00 UTC
[jira] [Commented] (CASSANDRA-17416) Test Failure: org.apache.cassandra.db.commitlog.CommitLogSegmentManagerCDCTest.testCDCIndexFileWriteOnSync
[ https://issues.apache.org/jira/browse/CASSANDRA-17416?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17530906#comment-17530906 ]
Josh McKenzie commented on CASSANDRA-17416:
-------------------------------------------
Can't reproduce this one locally but noodling on it for a bit, here's a hypothesis:
{code}
CommitLog.instance.sync(true);
CommitLogSegment currentSegment = CommitLog.instance.segmentManager.allocatingFrom();
int syncOffset = currentSegment.lastSyncedOffset;
// Confirm index file is written
File cdcIndexFile = currentSegment.getCDCIndexFile();
Assert.assertTrue("Index file not written: " + cdcIndexFile, cdcIndexFile.exists());
// Read index value and confirm it's == end from last sync
BufferedReader in = new BufferedReader(new FileReader(cdcIndexFile));
{code}
In general, to my eye the above code is going to be prone to races. The syncOffset we take immediately after sync + getting ref may or may not point to whatever is in the cdcIndexFile as another flush / sync may go on between that first lastSyncedOffset check and creation of the FileReader.
So I'm thinking we check that the value we parse from cdcIndexFile is >= lastSyncedOffset to account for that.
As for the null you saw Ekaterina, no clue. That null indicates it failed to read anything from the cdcIndexFile and it really shouldn't have done that; can't think of a scenario where it'd succeed in writing the index file but have it be completely empty. I can harden that test a bit and have it dump out the entire contents of the index file if it has an integer parse error.
[~yifanc] - since you've dug around a bit in the CDC space, WDYT about the >= comparison instead of equality here? Sound reasonable?
> Test Failure: org.apache.cassandra.db.commitlog.CommitLogSegmentManagerCDCTest.testCDCIndexFileWriteOnSync
> ----------------------------------------------------------------------------------------------------------
>
> Key: CASSANDRA-17416
> URL: https://issues.apache.org/jira/browse/CASSANDRA-17416
> Project: Cassandra
> Issue Type: Bug
> Components: Test/unit
> Reporter: Marcus Eriksson
> Assignee: Josh McKenzie
> Priority: Normal
> Fix For: 4.x
>
>
> [https://ci-cassandra.apache.org/job/Cassandra-trunk/985/testReport/org.apache.cassandra.db.commitlog/CommitLogSegmentManagerCDCTest/testCDCIndexFileWriteOnSync_cdc_3/]
> h3. Error Message
> expected:<1748956> but was:<1749196>
> h3. Stacktrace
> junit.framework.AssertionFailedError: expected:<1748956> but was:<1749196> at org.apache.cassandra.db.commitlog.CommitLogSegmentManagerCDCTest.testCDCIndexFileWriteOnSync(CommitLogSegmentManagerCDCTest.java:160) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
> h3. Standard Output
> INFO [main] 2022-03-02 15:04:59,516 YamlConfigurationLoader.java:103 - Configuration location: file:////home/cassandra/cassandra/build/test/cassandra.cdc.yaml DEBUG [main] 2022-03-02 15:04:59,520 YamlConfigurationLoader.java:124 - Loading settings from file:////home/cassandra/cassandra/build/test/cassandra.cdc.yaml INFO [main] 2022-03-02 15:04:59,674 Config.java:907 - Node configuration:[allocate_tokens_for_keyspace=null; allocate_tokens_for_local_replication_factor=null; allow_extra_insecure_ ...[truncated 4125855 chars]... -02 15:06:57,491 PathUtils.java:73 - Deleting file during startup: /home/cassandra/cassandra/build/test/cassandra/data/system_schema/views-9786ac1cdd583201a7cdad556410c985/nb-11-big-Summary.db DEBUG [MemtableFlushWriter:2] 2022-03-02 15:06:57,496 ColumnFamilyStore.java:1207 - Flushed to [BigTableReader(path='/home/cassandra/cassandra/build/test/cassandra/data/system_schema/keyspaces-abac5682dea631c5b535b3d6cffd0fb6/nb-55-big-Data.db')] (1 sstables, 4.895KiB), biggest 4.895KiB, smallest 4.895KiB
--
This message was sent by Atlassian Jira
(v8.20.7#820007)
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cassandra.apache.org
For additional commands, e-mail: commits-help@cassandra.apache.org