@@ -115,7 +115,7 @@ class TConfigureParts : public TSubOperationState {
115
115
event->Record .SetFrozen (true );
116
116
117
117
LOG_DEBUG_S (context.Ctx , NKikimrServices::FLAT_TX_SCHEMESHARD,
118
- " TCoptSequence TConfigureParts ProgressState"
118
+ " TCopySequence TConfigureParts ProgressState"
119
119
<< " sending TEvCreateSequence to tablet " << tabletId
120
120
<< " operationId# " << OperationId
121
121
<< " at tablet " << ssId);
@@ -274,6 +274,18 @@ class TProposedCopySequence : public TSubOperationState {
274
274
<< " operationId#" << OperationId;
275
275
}
276
276
277
+ void UpdateSequenceDescription (NKikimrSchemeOp::TSequenceDescription& descr) {
278
+ descr.SetStartValue (GetSequenceResult.GetStartValue ());
279
+ descr.SetMinValue (GetSequenceResult.GetMinValue ());
280
+ descr.SetMaxValue (GetSequenceResult.GetMaxValue ());
281
+ descr.SetCache (GetSequenceResult.GetCache ());
282
+ descr.SetIncrement (GetSequenceResult.GetIncrement ());
283
+ descr.SetCycle (GetSequenceResult.GetCycle ());
284
+ auto * setValMsg = descr.MutableSetVal ();
285
+ setValMsg->SetNextValue (GetSequenceResult.GetNextValue ());
286
+ setValMsg->SetNextUsed (GetSequenceResult.GetNextUsed ());
287
+ }
288
+
277
289
public:
278
290
TProposedCopySequence (TOperationId id)
279
291
: OperationId(id)
@@ -333,7 +345,15 @@ class TProposedCopySequence : public TSubOperationState {
333
345
return false ;
334
346
}
335
347
348
+ TPathId pathId = txState->TargetPathId ;
349
+
336
350
NIceDb::TNiceDb db (context.GetDB ());
351
+
352
+ auto sequenceInfo = context.SS ->Sequences .at (pathId);
353
+ UpdateSequenceDescription (sequenceInfo->Description );
354
+
355
+ context.SS ->PersistSequence (db, pathId, *sequenceInfo);
356
+
337
357
context.SS ->ChangeTxState (db, OperationId, TTxState::Done);
338
358
context.OnComplete .ActivateTx (OperationId);
339
359
return true ;
@@ -387,7 +407,7 @@ class TProposedCopySequence : public TSubOperationState {
387
407
return false ;
388
408
}
389
409
390
- auto getSequenceResult = ev->Get ()->Record ;
410
+ GetSequenceResult = ev->Get ()->Record ;
391
411
392
412
Y_ABORT_UNLESS (txState->Shards .size () == 1 );
393
413
for (auto shard : txState->Shards ) {
@@ -397,7 +417,8 @@ class TProposedCopySequence : public TSubOperationState {
397
417
Y_ABORT_UNLESS (currentTabletId != InvalidTabletId);
398
418
399
419
auto event = MakeHolder<NSequenceShard::TEvSequenceShard::TEvRestoreSequence>(
400
- txState->TargetPathId , getSequenceResult);
420
+ txState->TargetPathId , GetSequenceResult);
421
+
401
422
event->Record .SetTxId (ui64 (OperationId.GetTxId ()));
402
423
event->Record .SetTxPartId (OperationId.GetSubTxId ());
403
424
0 commit comments