@@ -111,18 +111,23 @@ struct TSchemeShard::TImport::TTxCancel: public TSchemeShard::TXxport::TTxBase {
111
111
}; // TTxCancel
112
112
113
113
struct TSchemeShard ::TImport::TTxCancelAck: public TSchemeShard::TXxport::TTxBase {
114
- TEvSchemeShard::TEvCancelTxResult::TPtr CancelTxResult = nullptr ;
115
- TEvIndexBuilder::TEvCancelResponse::TPtr CancelIndexBuildResult = nullptr ;
114
+ const ui64 ImportId ;
115
+ const TTxId TxId ;
116
116
117
- explicit TTxCancelAck (TSelf * self, TEvSchemeShard::TEvCancelTxResult::TPtr& ev )
117
+ explicit TTxCancelAck (TSelf* self, ui64 importId, TTxId txId )
118
118
: TXxport::TTxBase(self)
119
- , CancelTxResult(ev)
119
+ , ImportId(importId)
120
+ , TxId(txId)
120
121
{
121
122
}
122
123
123
- explicit TTxCancelAck (TSelf *self, TEvIndexBuilder::TEvCancelResponse::TPtr& ev)
124
- : TXxport::TTxBase(self)
125
- , CancelIndexBuildResult(ev)
124
+ explicit TTxCancelAck (TSelf* self, TEvSchemeShard::TEvCancelTxResult::TPtr& ev)
125
+ : TTxCancelAck(self, ev->Cookie, TTxId(ev->Get ()->Record.GetTargetTxId()))
126
+ {
127
+ }
128
+
129
+ explicit TTxCancelAck (TSelf* self, TEvIndexBuilder::TEvCancelResponse::TPtr& ev)
130
+ : TTxCancelAck(self, ev->Cookie, TTxId(ev->Get ()->Record.GetTxId()))
126
131
{
127
132
}
128
133
@@ -131,23 +136,11 @@ struct TSchemeShard::TImport::TTxCancelAck: public TSchemeShard::TXxport::TTxBas
131
136
}
132
137
133
138
bool DoExecute (TTransactionContext& txc, const TActorContext&) override {
134
- TTxId txId;
135
- ui64 id;
136
- if (CancelTxResult) {
137
- txId = TTxId (CancelTxResult->Get ()->Record .GetTargetTxId ());
138
- id = CancelTxResult->Cookie ;
139
- } else if (CancelIndexBuildResult) {
140
- txId = TTxId (CancelIndexBuildResult->Get ()->Record .GetTxId ());
141
- id = CancelIndexBuildResult->Cookie ;
142
- } else {
143
- Y_ABORT (" unreachable" );
144
- }
145
-
146
- if (!Self->Imports .contains (id)) {
139
+ if (!Self->Imports .contains (ImportId)) {
147
140
return true ;
148
141
}
149
142
150
- TImportInfo::TPtr importInfo = Self->Imports .at (id );
143
+ TImportInfo::TPtr importInfo = Self->Imports .at (ImportId );
151
144
NIceDb::TNiceDb db (txc.DB );
152
145
153
146
if (importInfo->State != TImportInfo::EState::Cancellation) {
@@ -170,7 +163,7 @@ struct TSchemeShard::TImport::TTxCancelAck: public TSchemeShard::TXxport::TTxBas
170
163
++cancellableItems;
171
164
}
172
165
173
- if (item.WaitTxId == txId ) {
166
+ if (item.WaitTxId == TxId ) {
174
167
found = true ;
175
168
176
169
item.State = TImportInfo::EState::Cancelled;
@@ -186,7 +179,7 @@ struct TSchemeShard::TImport::TTxCancelAck: public TSchemeShard::TXxport::TTxBas
186
179
return true ;
187
180
}
188
181
189
- Self->TxIdToImport .erase (txId );
182
+ Self->TxIdToImport .erase (TxId );
190
183
Self->PersistImportItemState (db, *importInfo, itemIdx);
191
184
192
185
if (cancelledItems != cancellableItems) {
0 commit comments