Skip to content

Commit

Permalink
remove allowRemoteGetBatch from SaplingBackingStore getTreeAux
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 getTreeAux

Reviewed By: MichaelCuevas

Differential Revision: D67105262

fbshipit-source-id: 2a8554821e853609787112d819ef32a098352dde
  • Loading branch information
kavehahmadi60 authored and facebook-github-bot committed Dec 12, 2024
1 parent 723fb3f commit f9c7c9d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 50 deletions.
12 changes: 0 additions & 12 deletions eden/fs/config/EdenConfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -1239,18 +1239,6 @@ class EdenConfig : private ConfigSettingManager {
false,
this};

/**
* Controls if batches are sent to Sapling with FetchMode::AllowRemote
* or batches are sent to Sapling with FetchMode::LocalOnly and then the
* failed requests are sent to Sapling again with FetchMode::RemoteOnly.
*
* This is a temporary option to test metrics on this new way of batching
*/
ConfigSetting<bool> allowRemoteGetBatch{
"experimental:allow-remote-get-batch",
true,
this};

// [blobcache]

/**
Expand Down
40 changes: 2 additions & 38 deletions eden/fs/store/hg/SaplingBackingStore.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1016,48 +1016,12 @@ void SaplingBackingStore::processTreeAuxImportRequests(
XLOGF(DBG4, "Processing tree aux request for {}", treeAuxImport->hash);
}

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

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

0 comments on commit f9c7c9d

Please sign in to comment.