diff options
author | Artem Zuikov <chertus@gmail.com> | 2022-06-06 14:41:16 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-06-06 14:41:16 +0300 |
commit | a41ac02dace00797703dbd05b860e84b4e738a81 (patch) | |
tree | 60ce00075286faab742e892540baedb4ff028577 | |
parent | 9e451a253f14180a3f1fd5abd94d40bed5ce14ca (diff) | |
download | ydb-a41ac02dace00797703dbd05b860e84b4e738a81.tar.gz |
KIKIMR-14773: prevent remove proposed writes at ColumnShard (Cherry pick commit r9388121)
REVIEW: 2496441
x-ydb-stable-ref: 8978893063023ef698eee7995ca6ddbc286bb325
-rw-r--r-- | ydb/core/tx/columnshard/columnshard__progress_tx.cpp | 2 | ||||
-rw-r--r-- | ydb/core/tx/columnshard/columnshard_impl.cpp | 3 |
2 files changed, 3 insertions, 2 deletions
diff --git a/ydb/core/tx/columnshard/columnshard__progress_tx.cpp b/ydb/core/tx/columnshard/columnshard__progress_tx.cpp index 9caf23e866..936501ed82 100644 --- a/ydb/core/tx/columnshard/columnshard__progress_tx.cpp +++ b/ydb/core/tx/columnshard/columnshard__progress_tx.cpp @@ -90,7 +90,7 @@ public: if (meta.MetaShard == 0) { for (TWriteId writeId : meta.WriteIds) { - Self->RemoveLongTxWrite(db, writeId); + Self->RemoveLongTxWrite(db, writeId, txId); } } Self->CommitsInFlight.erase(txId); diff --git a/ydb/core/tx/columnshard/columnshard_impl.cpp b/ydb/core/tx/columnshard/columnshard_impl.cpp index b1b866aa76..7d574a96c3 100644 --- a/ydb/core/tx/columnshard/columnshard_impl.cpp +++ b/ydb/core/tx/columnshard/columnshard_impl.cpp @@ -223,7 +223,8 @@ void TColumnShard::LoadLongTxWrite(TWriteId writeId, const NLongTxService::TLong void TColumnShard::RemoveLongTxWrite(NIceDb::TNiceDb& db, TWriteId writeId, ui64 txId) { if (auto* lw = LongTxWrites.FindPtr(writeId)) { - if (!txId || lw->PreparedTxId == txId) { + ui64 prepared = lw->PreparedTxId; + if (!prepared || txId == prepared) { Schema::EraseLongTxWrite(db, writeId); LongTxWritesByUniqueId.erase(lw->LongTxId.UniqueId); LongTxWrites.erase(writeId); |