|
2 | 2 | #include "change_exchange_impl.h" |
3 | 3 | #include "datashard_impl.h" |
4 | 4 |
|
5 | | -#include <ydb/library/actors/core/actor.h> |
6 | | -#include <ydb/core/tx/datashard/change_record_body_serializer.h> |
7 | | -#include <ydb/core/tx/datashard/datashard_user_table.h> |
8 | | -#include <ydb/core/tx/datashard/change_record.h> |
9 | 5 | #include <ydb/core/change_exchange/change_exchange.h> |
10 | 6 | #include <ydb/core/tx/datashard/change_collector.h> |
11 | | -#include <ydb/library/services/services.pb.h> |
12 | | -#include <ydb/core/tx/datashard/stream_scan_common.h> |
| 7 | +#include <ydb/core/tx/datashard/change_record.h> |
| 8 | +#include <ydb/core/tx/datashard/change_record_body_serializer.h> |
| 9 | +#include <ydb/core/tx/datashard/datashard_user_table.h> |
13 | 10 | #include <ydb/core/tx/datashard/incr_restore_helpers.h> |
| 11 | +#include <ydb/library/actors/core/actor.h> |
| 12 | +#include <ydb/library/services/services.pb.h> |
14 | 13 |
|
15 | 14 | namespace NKikimr::NDataShard { |
16 | 15 |
|
@@ -45,27 +44,34 @@ class TIncrementalRestoreScan |
45 | 44 | ui64 txId, |
46 | 45 | const TPathId& sourcePathId, |
47 | 46 | TUserTable::TCPtr table, |
48 | | - const TPathId& targetPathId) |
49 | | - : IActorCallback(static_cast<TReceiveFunc>(&TIncrementalRestoreScan::StateWork), NKikimrServices::TActivity::CDC_STREAM_SCAN_ACTOR) |
| 47 | + const TPathId& targetPathId, |
| 48 | + NStreamScan::TLimits limits) |
| 49 | + : IActorCallback(static_cast<TReceiveFunc>(&TIncrementalRestoreScan::StateWork), NKikimrServices::TActivity::INCREMENTAL_RESTORE_SCAN_ACTOR) |
50 | 50 | , Parent(parent) |
51 | 51 | , ChangeSenderFactory(changeSenderFactory) |
52 | 52 | , TxId(txId) |
53 | 53 | , SourcePathId(sourcePathId) |
54 | 54 | , TargetPathId(targetPathId) |
55 | 55 | , ValueTags(InitValueTags(table)) |
56 | | - , Limits() |
| 56 | + , Limits(limits) |
57 | 57 | {} |
58 | 58 |
|
59 | 59 | static TVector<TTag> InitValueTags(TUserTable::TCPtr table) { |
60 | | - Y_VERIFY(table->Columns.size() >= 1); |
| 60 | + Y_VERIFY(table->Columns.size() >= 2); |
61 | 61 | TVector<TTag> valueTags; |
62 | 62 | valueTags.reserve(table->Columns.size() - 1); |
| 63 | + bool deletedMarkerColumnFound = false; |
63 | 64 | for (const auto& [tag, column] : table->Columns) { |
64 | 65 | if (!column.IsKey) { |
65 | 66 | valueTags.push_back(tag); |
| 67 | + if (column.Name == "__ydb_incrBackupImpl_deleted") { |
| 68 | + deletedMarkerColumnFound = true; |
| 69 | + } |
66 | 70 | } |
67 | 71 | } |
68 | 72 |
|
| 73 | + Y_VERIFY(deletedMarkerColumnFound); |
| 74 | + |
69 | 75 | return valueTags; |
70 | 76 | } |
71 | 77 |
|
@@ -267,15 +273,17 @@ THolder<NTable::IScan> CreateIncrementalRestoreScan( |
267 | 273 | TPathId sourcePathId, |
268 | 274 | TUserTable::TCPtr table, |
269 | 275 | const TPathId& targetPathId, |
270 | | - ui64 txId) |
| 276 | + ui64 txId, |
| 277 | + NStreamScan::TLimits limits) |
271 | 278 | { |
272 | 279 | return MakeHolder<TIncrementalRestoreScan>( |
273 | 280 | parent, |
274 | 281 | changeSenderFactory, |
275 | 282 | txId, |
276 | 283 | sourcePathId, |
277 | 284 | table, |
278 | | - targetPathId); |
| 285 | + targetPathId, |
| 286 | + limits); |
279 | 287 | } |
280 | 288 |
|
281 | 289 | } // namespace NKikimr::NDataShard |
0 commit comments