aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorivanmorozov333 <ivanmorozov@ydb.tech>2024-07-08 12:03:59 +0300
committerGitHub <noreply@github.com>2024-07-08 12:03:59 +0300
commitcf80d1f6b9fd0d6165b1ea8d06a5effac2278340 (patch)
treecf6b6de73244811c4a720e005f8387bf627dbe61
parent06a15253bdc1bd0d810f1fca0d79a49cea5d56b5 (diff)
downloadydb-cf80d1f6b9fd0d6165b1ea8d06a5effac2278340.tar.gz
small transfer meta processing correction (#6386)
-rw-r--r--ydb/core/tx/schemeshard/olap/operations/alter/in_store/transfer/update.cpp2
-rw-r--r--ydb/core/tx/schemeshard/olap/operations/alter/in_store/transfer/update.h12
2 files changed, 5 insertions, 9 deletions
diff --git a/ydb/core/tx/schemeshard/olap/operations/alter/in_store/transfer/update.cpp b/ydb/core/tx/schemeshard/olap/operations/alter/in_store/transfer/update.cpp
index 119dc04e00..1173535cb0 100644
--- a/ydb/core/tx/schemeshard/olap/operations/alter/in_store/transfer/update.cpp
+++ b/ydb/core/tx/schemeshard/olap/operations/alter/in_store/transfer/update.cpp
@@ -30,7 +30,7 @@ NKikimr::TConclusionStatus TInStoreShardsTransfer::DoInitializeImpl(const TUpdat
for (auto&& i : alter.GetSourceTabletIds()) {
destinationSession.MutableTransferContext()->AddSourceTabletIds(i);
}
- DestinationSessions.emplace_back(destinationSession);
+ AFL_VERIFY(DestinationSessions.emplace(destinationSession.GetTransferContext().GetDestinationTabletId(), destinationSession).second);
AFL_VERIFY(ShardIdsUsage.emplace(alter.GetDestinationTabletId()).second);
}
const auto& inStoreOriginal = context.GetOriginalEntityAsVerified<TInStoreTable>();
diff --git a/ydb/core/tx/schemeshard/olap/operations/alter/in_store/transfer/update.h b/ydb/core/tx/schemeshard/olap/operations/alter/in_store/transfer/update.h
index 5b19aa69fb..0207e3528d 100644
--- a/ydb/core/tx/schemeshard/olap/operations/alter/in_store/transfer/update.h
+++ b/ydb/core/tx/schemeshard/olap/operations/alter/in_store/transfer/update.h
@@ -10,7 +10,7 @@ namespace NKikimr::NSchemeShard::NOlap::NAlter {
class TInStoreShardsTransfer: public TInStoreTableUpdate {
private:
using TBase = TInStoreTableUpdate;
- std::vector<NKikimrColumnShardDataSharingProto::TDestinationSession> DestinationSessions;
+ THashMap<ui64, NKikimrColumnShardDataSharingProto::TDestinationSession> DestinationSessions;
std::shared_ptr<TInStoreTable> TargetInStoreTable;
std::set<ui64> ShardIdsUsage;
@@ -29,13 +29,9 @@ private:
virtual TConclusionStatus DoInitializeImpl(const TUpdateInitializationContext& context) override;
virtual TString DoGetShardTxBodyString(const ui64 tabletId, const TMessageSeqNo& /*seqNo*/) const override {
- for (auto&& i : DestinationSessions) {
- if (i.GetTransferContext().GetDestinationTabletId() == tabletId) {
- return i.SerializeAsString();
- }
- }
- AFL_VERIFY(false);
- return "";
+ auto it = DestinationSessions.find(tabletId);
+ AFL_VERIFY(it != DestinationSessions.end());
+ return it->second.SerializeAsString();
}
virtual std::set<ui64> DoGetShardIds() const override {