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

fix: fix s3 load snapshot #3717

Merged
merged 1 commit into from
Sep 17, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/server/server_family.cc
Original file line number Diff line number Diff line change
Expand Up @@ -999,13 +999,13 @@ void ServerFamily::FlushAll(ConnectionContext* cntx) {
// error (if any occured) with a future.
std::optional<fb2::Future<GenericError>> ServerFamily::Load(string_view load_path,
LoadExistingKeys existing_keys) {
fs::path path(load_path);
std::string path(load_path);

if (load_path.empty()) {
fs::path dir_path(GetFlag(FLAGS_dir));
string filename = GetFlag(FLAGS_dbfilename);
dir_path.append(filename);
path = dir_path;
path = dir_path.generic_string();
}

DCHECK_GT(shard_count(), 0u);
Expand All @@ -1016,7 +1016,7 @@ std::optional<fb2::Future<GenericError>> ServerFamily::Load(string_view load_pat
return future;
}

auto paths_result = snapshot_storage_->LoadPaths(path.generic_string());
auto paths_result = snapshot_storage_->LoadPaths(path);
if (!paths_result) {
LOG(ERROR) << "Failed to load snapshot: " << paths_result.error().Format();

Expand All @@ -1027,7 +1027,7 @@ std::optional<fb2::Future<GenericError>> ServerFamily::Load(string_view load_pat

std::vector<std::string> paths = *paths_result;

LOG(INFO) << "Loading " << path.generic_string();
LOG(INFO) << "Loading " << path;

auto new_state = service_.SwitchState(GlobalState::ACTIVE, GlobalState::LOADING);
if (new_state != GlobalState::LOADING) {
Expand Down
Loading