You are viewing a plain text version of this content. The canonical link for it is here.
Posted to pr@cassandra.apache.org by "iamaleksey (via GitHub)" <gi...@apache.org> on 2025/10/03 15:22:45 UTC
[PR] Truncate mutation journal as logs get reconciled [cassandra]
iamaleksey opened a new pull request, #4410:
URL: https://github.com/apache/cassandra/pull/4410
patch by Aleksey Yeschenko; reviewed by Alex Petrov for CASSANDRA-20710
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: pr-unsubscribe@cassandra.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: pr-unsubscribe@cassandra.apache.org
For additional commands, e-mail: pr-help@cassandra.apache.org
Re: [PR] Truncate mutation journal as logs get reconciled [cassandra]
Posted by "iamaleksey (via GitHub)" <gi...@apache.org>.
iamaleksey merged PR #4410:
URL: https://github.com/apache/cassandra/pull/4410
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: pr-unsubscribe@cassandra.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: pr-unsubscribe@cassandra.apache.org
For additional commands, e-mail: pr-help@cassandra.apache.org
Re: [PR] Truncate mutation journal as logs get reconciled [cassandra]
Posted by "ifesdjeen (via GitHub)" <gi...@apache.org>.
ifesdjeen commented on code in PR #4410:
URL: https://github.com/apache/cassandra/pull/4410#discussion_r2410822020
##########
src/java/org/apache/cassandra/journal/Segments.java:
##########
@@ -192,6 +208,13 @@ void selectStatic(Collection<StaticSegment<K, V>> into)
into.add(segment.asStatic());
}
+ void selectStatic(Predicate<StaticSegment<K, V>> filter, Collection<StaticSegment<K, V>> into)
Review Comment:
Should we cache static segments to avoid re-filtering every time?
##########
src/java/org/apache/cassandra/journal/StaticSegment.java:
##########
@@ -135,9 +138,13 @@ static <K, V> StaticSegment<K, V> open(Descriptor descriptor, KeySupport<K> keyS
if (index == null)
index = OnDiskIndex.rebuildAndPersist(descriptor, keySupport, metadata.fsyncLimit());
+ KeyStats.Static<K> keyStats = keyStatsFactory.load(descriptor);
Review Comment:
`OffsetRangesFactory#load` doesn't seem to have any path that would return `null`. Maybe instead of throwing `JournalReadError` we should log it and return null?
##########
src/java/org/apache/cassandra/service/accord/AccordJournal.java:
##########
@@ -134,23 +133,10 @@ public AccordJournal(Params params)
public AccordJournal(Params params, File directory, ColumnFamilyStore cfs)
{
Version userVersion = Version.fromVersion(params.userVersion());
- this.journal = new Journal<>("AccordJournal", directory, params, JournalKey.SUPPORT,
- // In Accord, we are using streaming serialization, i.e. Reader/Writer interfaces instead of materializing objects
- new ValueSerializer<>()
- {
- @Override
- public void serialize(JournalKey key, Object value, DataOutputPlus out, int userVersion)
- {
- throw new UnsupportedOperationException();
- }
-
- @Override
- public Object deserialize(JournalKey key, DataInputPlus in, int userVersion)
- {
- throw new UnsupportedOperationException();
- }
- },
- compactor(cfs, userVersion));
+ this.journal =
Review Comment:
Would be great to extract this portion of the patch and get it committed to `trunk`.
##########
src/java/org/apache/cassandra/journal/Journal.java:
##########
@@ -1279,4 +1297,66 @@ enum State
SHUTDOWN,
TERMINATED
}
+
+ /*
+ * Test helpers
+ */
+
+ @VisibleForTesting
+ public void unsafeConsumeBytesForTesting(int entrySize, Consumer<ByteBuffer> corrupt)
+ {
+ // TODO (require): Find a better way to test unwritten allocations and/or corruption
+ allocate(entrySize).consumeBufferUnsafe(corrupt);
+ }
+
+ @VisibleForTesting
+ public void truncateForTesting()
+ {
+ ActiveSegment<?, ?> discarding = currentSegment;
+ if (!discarding.isEmpty()) // if there is no data in the segement then ignore it
Review Comment:
nit, and I know this is not your code, but `segement`
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: pr-unsubscribe@cassandra.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: pr-unsubscribe@cassandra.apache.org
For additional commands, e-mail: pr-help@cassandra.apache.org