Skip to content

Commit

Permalink
fix validation (#5542)
Browse files Browse the repository at this point in the history
  • Loading branch information
ivanmorozov333 authored Jun 15, 2024
1 parent 2529557 commit d7ebbb6
Showing 1 changed file with 7 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ bool TTxWriteIndex::Execute(TTransactionContext& txc, const TActorContext& ctx)
NOlap::TBlobManagerDb blobsDb(txc.DB);
changes->MutableBlobsAction().OnExecuteTxAfterAction(*Self, blobsDb, false);
for (ui32 i = 0; i < changes->GetWritePortionsCount(); ++i) {
auto& portion = changes->GetWritePortionInfo(i)->GetPortionResult();
LOG_S_WARN(TxPrefix() << "(" << changes->TypeString() << ":" << portion.DebugString() << ") blob cannot apply changes: " << TxSuffix());
const auto* portion = changes->GetWritePortionInfo(i);
LOG_S_WARN(TxPrefix() << "(" << changes->TypeString() << ":" << portion->DebugString() << ") blob cannot apply changes: " << TxSuffix());
}
NOlap::TChangesFinishContext context("cannot write index blobs: " + ::ToString(Ev->Get()->GetPutStatus()));
changes->Abort(*Self, context);
Expand Down Expand Up @@ -81,10 +81,13 @@ TTxWriteIndex::TTxWriteIndex(TColumnShard* self, TEvPrivate::TEvWriteIndex::TPtr
, Ev(ev)
, TabletTxNo(++Self->TabletTxCounter)
{
AFL_VERIFY(Ev && Ev->Get()->IndexChanges);

NOlap::TSnapshot snapshot(Self->LastPlannedStep, Self->LastPlannedTxId);
auto changes = Ev->Get()->IndexChanges;
AFL_VERIFY(Self->TablesManager.MutablePrimaryIndex().ApplyChangesOnTxCreate(changes, snapshot));
Y_ABORT_UNLESS(Ev && Ev->Get()->IndexChanges);
if (Ev->Get()->GetPutStatus() == NKikimrProto::OK) {
AFL_VERIFY(Self->TablesManager.MutablePrimaryIndex().ApplyChangesOnTxCreate(changes, snapshot));
}
}

void TTxWriteIndex::Describe(IOutputStream& out) const noexcept {
Expand Down

0 comments on commit d7ebbb6

Please sign in to comment.