Skip to content

Commit 760e09a

Browse files
authored
fix(snapshot): Append trailing slash for GCP storage during snapshot load (#4846)
Loading snapshots from GCP storage requires that sub directory ends with slash so append if it does not. Fixes #4833 Signed-off-by: mkaruza <[email protected]>
1 parent f4f615f commit 760e09a

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/server/detail/snapshot_storage.cc

+5
Original file line numberDiff line numberDiff line change
@@ -288,6 +288,11 @@ io::Result<std::string, GenericError> GcsSnapshotStorage::LoadPath(string_view d
288288

289289
auto [bucket_name, prefix] = GetBucketPath(dir);
290290

291+
// GCS needs trailing slash to match prefix sub path
292+
if (!prefix.empty() && prefix.back() != '/') {
293+
prefix += '/';
294+
}
295+
291296
fb2::ProactorBase* proactor = shard_set->pool()->GetNextProactor();
292297

293298
io::Result<vector<SnapStat>, GenericError> keys =

0 commit comments

Comments
 (0)