Skip to content

Introduce MutationJournal for coordinator logs#3914

Merged
iamaleksey merged 1 commit intoapache:cep-45-mutation-trackingfrom
iamaleksey:20353
Feb 24, 2025
Merged

Introduce MutationJournal for coordinator logs#3914
iamaleksey merged 1 commit intoapache:cep-45-mutation-trackingfrom
iamaleksey:20353

Conversation

@iamaleksey
Copy link
Copy Markdown
Member

patch by Aleksey Yeschenko; reviewed by Blake Eggleston for CASSANDRA-20353

@iamaleksey iamaleksey self-assigned this Feb 19, 2025
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I thought we were going to stick with a time based hlc for this?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Most recently we've discussed going back to sequential - or possibly 4 bytes sequential id and 4 bytes for a timestamp component to aid debug-ability.

Sequential has a couple added benefits:

  1. Replicas can close whole ranges even with a coordinator down, if they have the entire sequence among them: with sequential can tell if you aren't missing anything in-between.
  2. Can precisely tell how many mutations behind a replica is wrt a particular coordinator log.

Either way, this is something that can be easily switched back/forth at any point in the future.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Ah ok I didn’t realize. Yeah it should also be easier to encode ranges of them as well.

So the benefits of using an hlc would be

  1. Tombstone purging is straightforward. I’m not sure if it’s 100% necessary though - I think OPRT works with just isRepaired and no timestamp.
  2. Repair barriers, I’m not sure how these would work with sequential ids.
  3. Debuggability - If we ever have to debug an incident 1-2 months after it occurred, having a timestamp component will make our lives a lot easier.

I think all of these can be addressed with the 4byte per-id timestamp component (in seconds) though, so long as we guarantee it doesn’t move backwards. If the logId was a timestamp (seconds), we could get just under 72/3 days of millisecond/microsecond information in the per-id timestamp if the log id is used as an epoch. Not sure if that would be worth the trouble though.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Force-pushed the added component.

patch by Aleksey Yeschenko; reviewed by Blake Eggleston for
CASSANDRA-20353
Copy link
Copy Markdown
Member

@bdeggleston bdeggleston left a comment

Choose a reason for hiding this comment

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

+1

@iamaleksey iamaleksey merged commit c365b00 into apache:cep-45-mutation-tracking Feb 24, 2025
@iamaleksey iamaleksey deleted the 20353 branch February 24, 2025 09:53
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