Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Consolidate Standalone and Cluster Snapshot Metadata #1147

Draft
wants to merge 11 commits into
base: main
Choose a base branch
from

Conversation

vazois
Copy link
Collaborator

@vazois vazois commented Mar 31, 2025

This PR consolidates the standalone and cluster snapshot metadata format by making the user cookie part of HybridLogRecoveryInfo. This way on recovery the cookie is either deserialized or set to null and ignored if not needed.

  • Change HybridLogRecoveryInfo to append the user cookie instead of prepending it.
  • Ensure recovery from a standalone checkpoint using a cluster mode instance works correctly (and vice versa).
  • Add tests for backwards compatibility with old format that needs to be deprecated after next version.

@vazois vazois force-pushed the vazois/checkpoint-upgrade branch 7 times, most recently from 1b4acb2 to 89c161d Compare April 2, 2025 20:23
@@ -232,13 +227,15 @@ public byte[] GetIndexCheckpointMetadata(Guid indexToken)
}

/// <inheritdoc />
public virtual unsafe void CommitLogCheckpoint(Guid logToken, byte[] commitMetadata)
public virtual unsafe void CommitLogCheckpoint(Guid logToken, HybridLogRecoveryInfo hlri)
Copy link
Collaborator

Choose a reason for hiding this comment

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

HybridLogRecoveryInfo is an internal detail of Tsavorite that ideally should not be visible to plugin API. Instead Tsavorite interacts with the checkpoint plugin with two APIs:

  • byte[] CheckpointCookieState()
  • void RecoverCookieState(byte[] cookie)

During checkpoint, it uses #1 to get the cookie to add to HLRI. During recovery, it uses #2 to tell the plugin what the recovered cookie is.

@vazois vazois force-pushed the vazois/checkpoint-upgrade branch from 5e993ff to 9d76661 Compare April 3, 2025 23:01
@vazois vazois force-pushed the vazois/checkpoint-upgrade branch from 9d76661 to 3ee8c69 Compare April 7, 2025 21:15
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