-
Notifications
You must be signed in to change notification settings - Fork 709
Do not report a failed checkpoint as a successful save #2145
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
Merged
Ted Hart (TedHartMS)
merged 10 commits into
main
from
tedhar-bgsave-reports-failed-checkpoint
Sep 22, 2026
Merged
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
daa432a
Do not report a failed checkpoint as a successful save
TedHartMS 75bcd19
Merge branch 'main' into tedhar-bgsave-reports-failed-checkpoint
TedHartMS d408df8
Complete the checkpoint abort cleanup and cover it with tests
TedHartMS ae57009
Scope the recovery comment to the case it describes
TedHartMS 5f60244
Merge branch 'main' into tedhar-bgsave-reports-failed-checkpoint
TedHartMS bc528d8
Do not report a partial multi-database SAVE as a success
TedHartMS 85d0caa
Merge branch 'main' into tedhar-bgsave-reports-failed-checkpoint
TedHartMS cf1db86
Merge remote-tracking branch 'origin/main' into tedhar-bgsave-reports…
TedHartMS 8d0dbd8
Merge branch 'main' into tedhar-bgsave-reports-failed-checkpoint
TedHartMS 8be9ace
Merge branch 'main' into tedhar-bgsave-reports-failed-checkpoint
TedHartMS File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,59 @@ | ||
| // Copyright (c) Microsoft Corporation. | ||
| // Licensed under the MIT license. | ||
|
|
||
| namespace Garnet.server | ||
| { | ||
| /// <summary> | ||
| /// Outcome of a checkpoint request issued against one or more logical databases. | ||
| /// </summary> | ||
| public enum CheckpointStatus | ||
| { | ||
| /// <summary> | ||
| /// The checkpoint completed and its data is durable. For a background checkpoint this means the checkpoint | ||
| /// was successfully started; its outcome is reported through the database's last save time and status. | ||
| /// </summary> | ||
| Success, | ||
|
|
||
| /// <summary> | ||
| /// A checkpoint is already in progress for at least one of the requested databases, so no new checkpoint | ||
| /// was started. Nothing was written and no existing checkpoint was invalidated. | ||
| /// </summary> | ||
| AlreadyInProgress, | ||
|
|
||
| /// <summary> | ||
| /// The checkpoint was started but did not complete, so nothing durable was written. | ||
| /// </summary> | ||
| Failed, | ||
| } | ||
|
|
||
| /// <summary> | ||
| /// Outcome of a single database's checkpoint attempt. | ||
| /// </summary> | ||
| internal readonly struct CheckpointResult | ||
| { | ||
| /// <summary> | ||
| /// True if the checkpoint completed and its data is durable. Only then may the database's last save time | ||
| /// be advanced; advancing it for a failed checkpoint reports data as durable that was never written. | ||
| /// </summary> | ||
| public bool IsSuccessful { get; init; } | ||
|
|
||
| /// <summary> | ||
| /// Store tail address covered by a full checkpoint, or null for an incremental checkpoint. Null is also | ||
| /// returned for a failed checkpoint, which is why it cannot by itself signal failure. | ||
| /// </summary> | ||
| public long? StoreTailAddress { get; init; } | ||
|
|
||
| /// <summary> | ||
| /// A result denoting a checkpoint that did not complete. | ||
| /// </summary> | ||
| public static CheckpointResult Failed => default; | ||
|
|
||
| /// <summary> | ||
| /// Creates a result denoting a completed checkpoint. | ||
| /// </summary> | ||
| /// <param name="storeTailAddress">Store tail address covered by a full checkpoint, or null for an incremental checkpoint.</param> | ||
| /// <returns>A successful result.</returns> | ||
| public static CheckpointResult Succeeded(long? storeTailAddress) => | ||
| new() { IsSuccessful = true, StoreTailAddress = storeTailAddress }; | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.