Skip to content

Commit 8cd1aa6

Browse files
authored
Don't use random scan cookie for build index (#11256)
We shouldn't use random cookie for build index scans. Because in such case it's possible that this random id will intersects with real transaction id. So we use invalid zero id. It's allowed because build index scans don't need some external finalize. New build index scan remove old scan from manager because it has newer version
1 parent a4d0e68 commit 8cd1aa6

File tree

4 files changed

+4
-4
lines changed

4 files changed

+4
-4
lines changed

ydb/core/tx/datashard/build_index.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -626,7 +626,7 @@ void TDataShard::HandleSafe(TEvDataShard::TEvBuildIndexCreateRequest::TPtr& ev,
626626
record.GetColumnBuildSettings(),
627627
userTable,
628628
limits),
629-
ev->Cookie,
629+
0,
630630
scanOpts);
631631

632632
TScanRecord recCard = {scanId, seqNo};

ydb/core/tx/datashard/local_kmeans.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -663,7 +663,7 @@ void TDataShard::HandleSafe(TEvDataShard::TEvLocalKMeansRequest::TPtr& ev, const
663663
TScanOptions scanOpts;
664664
scanOpts.SetSnapshotRowVersion(rowVersion);
665665
scanOpts.SetResourceBroker("build_index", 10); // TODO(mbkkt) Should be different group?
666-
const auto scanId = QueueScan(userTable.LocalTid, std::move(scan), ev->Cookie, scanOpts);
666+
const auto scanId = QueueScan(userTable.LocalTid, std::move(scan), 0, scanOpts);
667667
TScanRecord recCard = {scanId, seqNo};
668668
ScanManager.Set(id, recCard);
669669
}

ydb/core/tx/datashard/reshuffle_kmeans.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -460,7 +460,7 @@ void TDataShard::HandleSafe(TEvDataShard::TEvReshuffleKMeansRequest::TPtr& ev, c
460460
TScanOptions scanOpts;
461461
scanOpts.SetSnapshotRowVersion(rowVersion);
462462
scanOpts.SetResourceBroker("build_index", 10); // TODO(mbkkt) Should be different group?
463-
const auto scanId = QueueScan(userTable.LocalTid, std::move(scan), ev->Cookie, scanOpts);
463+
const auto scanId = QueueScan(userTable.LocalTid, std::move(scan), 0, scanOpts);
464464
TScanRecord recCard = {scanId, seqNo};
465465
ScanManager.Set(id, recCard);
466466
}

ydb/core/tx/datashard/sample_k.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -351,7 +351,7 @@ void TDataShard::HandleSafe(TEvDataShard::TEvSampleKRequest::TPtr& ev, const TAc
351351
record.GetMaxProbability(),
352352
record.GetColumns(),
353353
userTable),
354-
ev->Cookie,
354+
0,
355355
scanOpts);
356356

357357
TScanRecord recCard = {scanId, seqNo};

0 commit comments

Comments
 (0)