Skip to content

Commit 684bdae

Browse files
validations for prevent incorrect data in local db (#8477)
1 parent 3675769 commit 684bdae

File tree

3 files changed

+4
-2
lines changed

3 files changed

+4
-2
lines changed

ydb/core/tx/columnshard/columnshard_schema.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ bool Schema::InsertTable_Load(NIceDb::TNiceDb& db, const IBlobGroupSelector* dsG
5959
}
6060

6161
void Schema::SaveTxInfo(NIceDb::TNiceDb& db, const TFullTxInfo& txInfo, const TString& txBody) {
62+
AFL_VERIFY(txInfo.TxKind != NKikimrTxColumnShard::TX_KIND_NONE);
6263
db.Table<TxInfo>().Key(txInfo.TxId).Update(
6364
NIceDb::TUpdate<TxInfo::TxKind>(txInfo.TxKind),
6465
NIceDb::TUpdate<TxInfo::TxBody>(txBody),

ydb/core/tx/columnshard/transactions/tx_controller.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,9 +53,9 @@ bool TTxController::Load(NTabletFlatExecutor::TTransactionContext& txc) {
5353
const ui64 txId = rowset.GetValue<Schema::TxInfo::TxId>();
5454
const NKikimrTxColumnShard::ETransactionKind txKind = rowset.GetValue<Schema::TxInfo::TxKind>();
5555
ITransactionOperator::TPtr txOperator(ITransactionOperator::TFactory::Construct(txKind, TTxInfo(txKind, txId)));
56-
Y_ABORT_UNLESS(!!txOperator);
56+
AFL_VERIFY(!!txOperator)("kind", txKind);
5757
const TString txBody = rowset.GetValue<Schema::TxInfo::TxBody>();
58-
Y_ABORT_UNLESS(txOperator->Parse(Owner, txBody, true));
58+
AFL_VERIFY(txOperator->Parse(Owner, txBody, true));
5959

6060
auto& txInfo = txOperator->MutableTxInfo();
6161
txInfo.MaxStep = rowset.GetValue<Schema::TxInfo::MaxStep>();

ydb/core/tx/columnshard/transactions/tx_controller.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ struct TBasicTxInfo {
1717
TBasicTxInfo(const NKikimrTxColumnShard::ETransactionKind& txKind, const ui64 txId)
1818
: TxKind(txKind)
1919
, TxId(txId) {
20+
AFL_VERIFY(txKind != NKikimrTxColumnShard::TX_KIND_NONE);
2021
}
2122

2223
bool operator==(const TBasicTxInfo& item) const = default;

0 commit comments

Comments
 (0)