Skip to content

Commit 9d3ef4f

Browse files
Clara Rullmeta-codesync[bot]
authored andcommitted
Upload commit_graph update to mutable storage
Summary: # This stack We want commit_graph blobs to be in mutable storage as they mutate and the current manifold caching has too long of a TTL. In this stack I: 1. Start uploading commit graph blobs to mutable storage (without stopping writing to the current one) 2. Add a just knob to switch to read commit graph pfrom mutable, which I will enable after 1 and 2 have landed and commit graph blobs have been written to mutable 3. Clean up moving reads and writes to mutable # This diff Step 1 Reviewed By: gustavoavena Differential Revision: D89663659 fbshipit-source-id: 92e858fe9f7127933ab9d335777c76c1718e42bd
1 parent 248fb0c commit 9d3ef4f

File tree

4 files changed

+16
-0
lines changed

4 files changed

+16
-0
lines changed

eden/mononoke/tools/admin/BUCK

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,7 @@ rust_binary(
131131
"//eden/mononoke/repo_attributes/git_ref_content_mapping:git_ref_content_mapping",
132132
"//eden/mononoke/repo_attributes/git_source_of_truth:git_source_of_truth",
133133
"//eden/mononoke/repo_attributes/git_symbolic_refs:git_symbolic_refs",
134+
"//eden/mononoke/repo_attributes/mutable_blobstore:mutable_blobstore",
134135
"//eden/mononoke/repo_attributes/mutable_counters:mutable_counters",
135136
"//eden/mononoke/repo_attributes/mutable_renames:mutable_renames",
136137
"//eden/mononoke/repo_attributes/phases:phases",

eden/mononoke/tools/admin/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@ mononoke_app = { version = "0.1.0", path = "../../cmdlib/mononoke_app" }
8787
mononoke_macros = { version = "0.1.0", path = "../../common/mononoke_macros" }
8888
mononoke_types = { version = "0.1.0", path = "../../mononoke_types" }
8989
movers = { version = "0.1.0", path = "../../features/commit_rewriting/movers" }
90+
mutable_blobstore = { version = "0.1.0", path = "../../repo_attributes/mutable_blobstore" }
9091
mutable_counters = { version = "0.1.0", path = "../../repo_attributes/mutable_counters" }
9192
mutable_renames = { version = "0.1.0", path = "../../repo_attributes/mutable_renames" }
9293
packfile = { version = "0.1.0", path = "../../git/packfile" }

eden/mononoke/tools/admin/src/commands/commit_graph.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ use is_ancestor::IsAncestorArgs;
3434
use metaconfig_types::RepoConfig;
3535
use mononoke_app::MononokeApp;
3636
use mononoke_app::args::OptRepoArgs;
37+
use mutable_blobstore::MutableRepoBlobstore;
3738
use range_stream::RangeStreamArgs;
3839
use repo_blobstore::RepoBlobstore;
3940
use repo_identity::RepoIdentity;
@@ -108,6 +109,9 @@ pub struct Repo {
108109

109110
#[facet]
110111
repo_blobstore: RepoBlobstore,
112+
113+
#[facet]
114+
mutable_repo_blobstore: MutableRepoBlobstore,
111115
}
112116

113117
pub async fn run(app: MononokeApp, args: CommandArgs) -> Result<()> {

eden/mononoke/tools/admin/src/commands/commit_graph/update_preloaded.rs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ use std::sync::Arc;
1111
use anyhow::Context;
1212
use anyhow::Result;
1313
use anyhow::anyhow;
14+
use blobstore::Blobstore;
1415
use blobstore::KeyedBlobstore;
1516
use clap::Args;
1617
use cloned::cloned;
@@ -26,6 +27,7 @@ use mononoke_app::MononokeReposManager;
2627
use mononoke_macros::mononoke;
2728
use mononoke_types::BlobstoreBytes;
2829
use mononoke_types::ChangesetId;
30+
use mutable_blobstore::MutableRepoBlobstoreRef;
2931
use preloaded_commit_graph_storage::ExtendablePreloadedEdges;
3032
use repo_blobstore::RepoBlobstoreRef;
3133
use repo_identity::RepoIdentityArc;
@@ -200,6 +202,14 @@ pub(super) async fn update_preloaded(
200202
println!("Deserialized preloaded edges into {} bytes", bytes.len());
201203

202204
repo.repo_blobstore()
205+
.put(
206+
ctx,
207+
args.blobstore_key.clone(),
208+
BlobstoreBytes::from_bytes(bytes.clone()),
209+
)
210+
.await?;
211+
212+
repo.mutable_repo_blobstore()
203213
.put(ctx, args.blobstore_key, BlobstoreBytes::from_bytes(bytes))
204214
.await?;
205215

0 commit comments

Comments
 (0)