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

feat: Add the ability to checkpoint an existing server, and spawn a read-only server on that view. #2548

Open
wants to merge 1 commit into
base: unstable
Choose a base branch
from

Conversation

nathanlo99
Copy link

It would be nice to be able to spawn a read-only server on a snapshot of a given server.

This PR implements this feature, and introduces two new flags --use-checkpoint and --keep-checkpoint to manage the snapshot.

Comment on lines +51 to +52
std::optional<std::string> checkpoint_location = std::nullopt;
bool keep_checkpoint = false;
Copy link
Member

@PragmaTwice PragmaTwice Sep 21, 2024

Choose a reason for hiding this comment

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

We can move them to CLIOptions rather than global variables.

MakeScopeExit([&config, &old_checkpoint_dir] { config.checkpoint_dir = old_checkpoint_dir; });

engine::Storage storage(&config);
if (const auto s = storage.Open(kDBOpenModeForReadOnly); !s.IsOK()) {
Copy link
Member

Choose a reason for hiding this comment

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

Can return the error as a Status instead of an exception.

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.

3 participants