From 7d313fe419c87508f935a24f10f3f018bb64dbcd Mon Sep 17 00:00:00 2001 From: ivanmorozov333 Date: Wed, 21 Feb 2024 08:17:41 +0300 Subject: [PATCH 1/2] fix race --- ydb/core/tx/columnshard/blobs_action/counters/storage.cpp | 6 +----- ydb/core/tx/columnshard/blobs_action/counters/storage.h | 1 - 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/ydb/core/tx/columnshard/blobs_action/counters/storage.cpp b/ydb/core/tx/columnshard/blobs_action/counters/storage.cpp index e7c30dc5ee4f..58f11b0e2b50 100644 --- a/ydb/core/tx/columnshard/blobs_action/counters/storage.cpp +++ b/ydb/core/tx/columnshard/blobs_action/counters/storage.cpp @@ -9,11 +9,7 @@ TStorageCounters::TStorageCounters(const TString& storageId) } std::shared_ptr TStorageCounters::GetConsumerCounter(const TString& consumerId) { - auto it = ConsumerCounters.find(consumerId); - if (it == ConsumerCounters.end()) { - it = ConsumerCounters.emplace(consumerId, std::make_shared(consumerId, *this)).first; - } - return it->second; + std::make_shared(consumerId, *this); } TConsumerCounters::TConsumerCounters(const TString& consumerId, const TStorageCounters& parent) diff --git a/ydb/core/tx/columnshard/blobs_action/counters/storage.h b/ydb/core/tx/columnshard/blobs_action/counters/storage.h index e92ca28bda20..902766af1545 100644 --- a/ydb/core/tx/columnshard/blobs_action/counters/storage.h +++ b/ydb/core/tx/columnshard/blobs_action/counters/storage.h @@ -25,7 +25,6 @@ class TConsumerCounters: public NColumnShard::TCommonCountersOwner { class TStorageCounters: public NColumnShard::TCommonCountersOwner { private: using TBase = NColumnShard::TCommonCountersOwner; - THashMap> ConsumerCounters; public: TStorageCounters(const TString& storageId); From b1e3013e024f6606bc25b8a8f0831b062bb01aa5 Mon Sep 17 00:00:00 2001 From: ivanmorozov333 Date: Wed, 21 Feb 2024 10:00:13 +0300 Subject: [PATCH 2/2] fix --- ydb/core/tx/columnshard/blobs_action/counters/storage.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ydb/core/tx/columnshard/blobs_action/counters/storage.cpp b/ydb/core/tx/columnshard/blobs_action/counters/storage.cpp index 58f11b0e2b50..8d8d9733e40f 100644 --- a/ydb/core/tx/columnshard/blobs_action/counters/storage.cpp +++ b/ydb/core/tx/columnshard/blobs_action/counters/storage.cpp @@ -9,7 +9,7 @@ TStorageCounters::TStorageCounters(const TString& storageId) } std::shared_ptr TStorageCounters::GetConsumerCounter(const TString& consumerId) { - std::make_shared(consumerId, *this); + return std::make_shared(consumerId, *this); } TConsumerCounters::TConsumerCounters(const TString& consumerId, const TStorageCounters& parent)