From f9c7c9d6cb06808e4b7400016a12049a325367c1 Mon Sep 17 00:00:00 2001 From: Kaveh Ahmadi Date: Thu, 12 Dec 2024 14:51:35 -0800 Subject: [PATCH] remove `allowRemoteGetBatch` from SaplingBackingStore getTreeAux 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 --- eden/fs/config/EdenConfig.h | 12 ------- eden/fs/store/hg/SaplingBackingStore.cpp | 40 ++---------------------- 2 files changed, 2 insertions(+), 50 deletions(-) diff --git a/eden/fs/config/EdenConfig.h b/eden/fs/config/EdenConfig.h index 171cb1f85a6df..45e92cdbfe511 100644 --- a/eden/fs/config/EdenConfig.h +++ b/eden/fs/config/EdenConfig.h @@ -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 allowRemoteGetBatch{ - "experimental:allow-remote-get-batch", - true, - this}; - // [blobcache] /** diff --git a/eden/fs/store/hg/SaplingBackingStore.cpp b/eden/fs/store/hg/SaplingBackingStore.cpp index 2c24702483fe8..94c0e2e844e2e 100644 --- a/eden/fs/store/hg/SaplingBackingStore.cpp +++ b/eden/fs/store/hg/SaplingBackingStore.cpp @@ -1016,48 +1016,12 @@ void SaplingBackingStore::processTreeAuxImportRequests( XLOGF(DBG4, "Processing tree aux request for {}", treeAuxImport->hash); } - std::vector> 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(); - if (promise->isFulfilled()) { - XLOGF( - DBG4, - "TreeAuxData found in Sapling local for {}", - request->getRequest()->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(); if (promise->isFulfilled()) { - if (!config_->getEdenConfig()->allowRemoteGetBatch.getValue()) { - XLOGF( - DBG4, - "TreeAuxData found in Sapling remote for {}", - request->getRequest()->hash); - request->getContext()->setFetchedSource( - ObjectFetchContext::FetchedSource::Remote, - ObjectFetchContext::ObjectType::TreeAuxData, - stats_.copy()); - } stats_->addDuration( &SaplingBackingStoreStats::fetchTreeAuxData, watch.elapsed()); stats_->increment(&SaplingBackingStoreStats::fetchTreeAuxDataSuccess);