Skip to content

Conversation

ifesdjeen
Copy link
Contributor

@ifesdjeen ifesdjeen commented Sep 23, 2025

This patch introduces SegmentStateTracker, which tracks Mutation Journal allocations and listens to Memtable->SSTable flushes.

SegmentStateTracker logic is largely adapted from CommitLog (i.e. tracking dirty allocation upper bound, and clean/flushed min/max bounds, and checking their intersection to see if entire segment is flushed.

MutationJournal now tracks new allocations per segment (and, within a segment, per table), and listens to Memtable flushes, marking CommitLogPosition bounds reported by the flush as clean.

MutationJournal#replay is added, and serves a purpose similar to CommitLog replay, albeit lacks some of its functionality, such as replay filter, for now (missing pieces documented inline). Only segments holding allocations that were not memtable->sstable flushed are considered for replay.

CASSANDRA-20920 Mutation journal replay

Improvements

  * clean up RecordPointer
  * cache last segment

Implement mutation journal replay

Persist clean/dirty state in metadata component

Add mutation journal replay test, fix several issues, wire in journal into memtable

Add bounce dtest, fix some more tests
@ifesdjeen ifesdjeen force-pushed the CASSANDRA-20919-mutation-journal-replay branch from 431bb91 to 3957151 Compare September 26, 2025 19:11
@ifesdjeen ifesdjeen force-pushed the CASSANDRA-20919-mutation-journal-replay branch from 3957151 to f106fe6 Compare September 26, 2025 19:17
@ifesdjeen ifesdjeen changed the title CASSANDRA-20919 Mutation journal replay CASSANDRA-20920 Mutation journal replay Sep 26, 2025
@iamaleksey
Copy link
Member

The tests could be extended slightly to verify that the offsets are recorded as witnessed by MutationTrackingService. Otherwise LGTM.

Copy link
Member

@iamaleksey iamaleksey left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants