Skip to content

Commit 86d83b6

Browse files
Clara Rullmeta-codesync[bot]
authored andcommitted
Add ability to read commit graph form mutable (gated by JK)
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 2 Reviewed By: RajivTS, YousefSalama Differential Revision: D89664255 fbshipit-source-id: c3160c17d02ea5e39b938b25863bd99300930377
1 parent 9d3ef4f commit 86d83b6

File tree

2 files changed

+27
-8
lines changed

2 files changed

+27
-8
lines changed

eden/mononoke/repo_factory/src/lib.rs

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1923,12 +1923,18 @@ impl RepoFactory {
19231923
Some(preloaded_commit_graph_key)
19241924
if !self.env.commit_graph_options.skip_preloading_commit_graph =>
19251925
{
1926+
let blobstore = match justknobs::eval(
1927+
"scm/mononoke:commit_graph_use_mutable_storage",
1928+
None,
1929+
None,
1930+
)? {
1931+
true => &repo_config.storage_config.mutable_blobstore,
1932+
false => &repo_config.storage_config.blobstore,
1933+
};
19261934
let blobstore_without_cache = self
19271935
.mutable_repo_blobstore_from_blobstore(
19281936
repo_identity,
1929-
&self
1930-
.blobstore_no_cache(&repo_config.storage_config.blobstore)
1931-
.await?,
1937+
&self.blobstore_no_cache(blobstore).await?,
19321938
)
19331939
.await?;
19341940

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

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -120,12 +120,25 @@ pub(super) async fn update_preloaded(
120120
);
121121

122122
let preloaded_edges = match args.rebuild {
123-
false => match repo.repo_blobstore().get(ctx, &args.blobstore_key).await? {
124-
Some(bytes) => {
125-
preloaded_commit_graph_storage::deserialize_preloaded_edges(bytes.into_raw_bytes())?
123+
false => {
124+
#[cfg(fbcode_build)]
125+
let bytes =
126+
if justknobs::eval("scm/mononoke:commit_graph_use_mutable_storage", None, None)? {
127+
repo.mutable_repo_blobstore()
128+
.get(ctx, &args.blobstore_key)
129+
.await?
130+
} else {
131+
repo.repo_blobstore().get(ctx, &args.blobstore_key).await?
132+
};
133+
#[cfg(not(fbcode_build))]
134+
let bytes = repo.repo_blobstore().get(ctx, &args.blobstore_key).await?;
135+
match bytes {
136+
Some(bytes) => preloaded_commit_graph_storage::deserialize_preloaded_edges(
137+
bytes.into_raw_bytes(),
138+
)?,
139+
None => Default::default(),
126140
}
127-
None => Default::default(),
128-
},
141+
}
129142
true => Default::default(),
130143
};
131144

0 commit comments

Comments
 (0)