summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorivanmorozov333 <[email protected]>2024-03-01 08:42:52 +0300
committerGitHub <[email protected]>2024-03-01 08:42:52 +0300
commit627c051f40a04bc8fd93efb3fb710b74c03fae72 (patch)
tree199aa234a02717df7940405a9374ca1409f3e392
parent58d96700a1cbdc6532c28c011f9666bcbb855097 (diff)
dont rebuild s3 client in case same config (#2352)
-rw-r--r--ydb/core/tx/columnshard/blobs_action/tier/storage.cpp7
-rw-r--r--ydb/core/tx/columnshard/blobs_action/tier/storage.h2
2 files changed, 8 insertions, 1 deletions
diff --git a/ydb/core/tx/columnshard/blobs_action/tier/storage.cpp b/ydb/core/tx/columnshard/blobs_action/tier/storage.cpp
index 80be5a84f3c..7ef951dd620 100644
--- a/ydb/core/tx/columnshard/blobs_action/tier/storage.cpp
+++ b/ydb/core/tx/columnshard/blobs_action/tier/storage.cpp
@@ -49,11 +49,18 @@ void TOperator::InitNewExternalOperator(const NColumnShard::NTiers::TManager* ti
} else {
settings.SetEndpoint("nowhere");
}
+ {
+ TGuard<TSpinLock> changeLock(ChangeOperatorLock);
+ if (CurrentS3Settings && CurrentS3Settings->SerializeAsString() == settings.SerializeAsString()) {
+ return;
+ }
+ }
auto extStorageConfig = NWrappers::NExternalStorage::IExternalStorageConfig::Construct(settings);
AFL_VERIFY(extStorageConfig);
auto extStorageOperator = extStorageConfig->ConstructStorageOperator(false);
extStorageOperator->InitReplyAdapter(std::make_shared<NOlap::NBlobOperations::NTier::TRepliesAdapter>(GetStorageId()));
TGuard<TSpinLock> changeLock(ChangeOperatorLock);
+ CurrentS3Settings = settings;
ExternalStorageOperator = extStorageOperator;
}
diff --git a/ydb/core/tx/columnshard/blobs_action/tier/storage.h b/ydb/core/tx/columnshard/blobs_action/tier/storage.h
index c5118a9adcd..f4517d9b13f 100644
--- a/ydb/core/tx/columnshard/blobs_action/tier/storage.h
+++ b/ydb/core/tx/columnshard/blobs_action/tier/storage.h
@@ -13,7 +13,7 @@ private:
using TBase = IBlobsStorageOperator;
const NActors::TActorId TabletActorId;
std::shared_ptr<TGCInfo> GCInfo = std::make_shared<TGCInfo>();
-
+ std::optional<NKikimrSchemeOp::TS3Settings> CurrentS3Settings;
NWrappers::NExternalStorage::IExternalStorageConfig::TPtr InitializationConfig;
NWrappers::NExternalStorage::IExternalStorageConfig::TPtr ExternalStorageConfig;
TSpinLock ChangeOperatorLock;