Skip to content

Commit

Permalink
remove allowRemoteGetBatch from SaplingBackingStore getBlobAux
Browse files Browse the repository at this point in the history
Summary:
## Background
We decided to get back to the previous path of sending request with allow remote mode.
The config is removed on D66784942
This stack is cleaning up the code branches in `SaplingBackingStore`
I split it into multiple diffs to make it easier for review

## This diff
Remove `allowRemoteGetBatch` config from getBlobAux

Reviewed By: MichaelCuevas

Differential Revision: D67105090

fbshipit-source-id: f9304d4abb7150503ff8d8f7056f6c131f2b868b
  • Loading branch information
kavehahmadi60 authored and facebook-github-bot committed Dec 12, 2024
1 parent 2c76048 commit 723fb3f
Showing 1 changed file with 2 additions and 38 deletions.
40 changes: 2 additions & 38 deletions eden/fs/store/hg/SaplingBackingStore.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -973,48 +973,12 @@ void SaplingBackingStore::processBlobAuxImportRequests(
XLOGF(DBG4, "Processing blob aux request for {}", blobAuxImport->hash);
}

std::vector<std::shared_ptr<SaplingImportRequest>> retryRequest;
retryRequest.reserve(requests.size());
if (config_->getEdenConfig()->allowRemoteGetBatch.getValue()) {
getBlobAuxDataBatch(requests, sapling::FetchMode::AllowRemote);
retryRequest = std::move(requests);
} else {
getBlobAuxDataBatch(requests, sapling::FetchMode::LocalOnly);
for (auto& request : requests) {
auto* promise = request->getPromise<BlobAuxDataPtr>();
if (promise->isFulfilled()) {
XLOGF(
DBG4,
"BlobAuxData found in Sapling local for {}",
request->getRequest<SaplingImportRequest::BlobAuxImport>()->hash);
request->getContext()->setFetchedSource(
ObjectFetchContext::FetchedSource::Local,
ObjectFetchContext::ObjectType::BlobAuxData,
stats_.copy());
stats_->addDuration(
&SaplingBackingStoreStats::fetchBlobAuxData, watch.elapsed());
stats_->increment(&SaplingBackingStoreStats::fetchBlobAuxDataSuccess);
} else {
retryRequest.emplace_back(std::move(request));
}
}
getBlobAuxDataBatch(retryRequest, sapling::FetchMode::RemoteOnly);
}
getBlobAuxDataBatch(requests, sapling::FetchMode::AllowRemote);

{
for (auto& request : retryRequest) {
for (auto& request : requests) {
auto* promise = request->getPromise<BlobAuxDataPtr>();
if (promise->isFulfilled()) {
if (!config_->getEdenConfig()->allowRemoteGetBatch.getValue()) {
XLOGF(
DBG4,
"BlobAuxData found in Sapling remote for {}",
request->getRequest<SaplingImportRequest::BlobAuxImport>()->hash);
request->getContext()->setFetchedSource(
ObjectFetchContext::FetchedSource::Remote,
ObjectFetchContext::ObjectType::BlobAuxData,
stats_.copy());
}
stats_->addDuration(
&SaplingBackingStoreStats::fetchBlobAuxData, watch.elapsed());
stats_->increment(&SaplingBackingStoreStats::fetchBlobAuxDataSuccess);
Expand Down

0 comments on commit 723fb3f

Please sign in to comment.