Skip to content

[IMPROVED] NRG: Snapshot create/truncate logic#6691

Merged
neilalexander merged 3 commits intomainfrom
maurice/nrg-snapshots
Mar 20, 2025
Merged

[IMPROVED] NRG: Snapshot create/truncate logic#6691
neilalexander merged 3 commits intomainfrom
maurice/nrg-snapshots

Conversation

@MauriceVanVeen
Copy link
Copy Markdown
Member

  • If a snapshot was created, and the WAL would move forward to a different term/pterm, and a new leader would send a heartbeat/message referencing the same applied/pindex as in the snapshot, then it would reset the WAL. Instead of cleanly truncating back to applied/snapshot.
  • If a snapshot is made multiple times for the same applied number, the correct value for the entry's term gets lost, due to the first snapshot compacting it. Only ever allow one snapshot to be made for a given applied number, to ensure correctness.

Signed-off-by: Maurice van Veen github@mauricevanveen.com

@MauriceVanVeen MauriceVanVeen marked this pull request as ready for review March 19, 2025 17:50
@MauriceVanVeen MauriceVanVeen requested a review from a team as a code owner March 19, 2025 17:50
Signed-off-by: Maurice van Veen <github@mauricevanveen.com>
Signed-off-by: Maurice van Veen <github@mauricevanveen.com>
Signed-off-by: Maurice van Veen <github@mauricevanveen.com>
@MauriceVanVeen MauriceVanVeen force-pushed the maurice/nrg-snapshots branch from dc4308f to 000d9b7 Compare March 19, 2025 17:56
Copy link
Copy Markdown
Member

@neilalexander neilalexander left a comment

Choose a reason for hiding this comment

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

LGTM

@neilalexander neilalexander merged commit 1216467 into main Mar 20, 2025
5 checks passed
@neilalexander neilalexander deleted the maurice/nrg-snapshots branch March 20, 2025 10:28
@wallyqs wallyqs changed the title NRG: Snapshot create/truncate logic [IMPROVED] NRG: Snapshot create/truncate logic Apr 17, 2025
neilalexander added a commit that referenced this pull request Apr 17, 2025
Includes the following (already cherry-picked) PRs:

- #6587
- #6607
- #6612
- #6609
- #6620
- #6668
- #6674
- #6647
- #6684
- #6691
- #6697
- #6705
- #6706
- #6704
- #6714
- #6720
- #6727
- #6730
- #6726
- #6732
- #6759
- #6753
- #6685
- #6769
- #6777
- #6785
- #6786
- #6778
- #6790
- #6791
- #6798
- #6794
- #6801

Signed-off-by: Neil Twigg <neil@nats.io>

Signed-off-by: Neil Twigg <neil@nats.io>
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