File tree Expand file tree Collapse file tree 5 files changed +51
-0
lines changed Expand file tree Collapse file tree 5 files changed +51
-0
lines changed Original file line number Diff line number Diff line change @@ -2259,3 +2259,18 @@ message TEvInMemoryStateResponse {
22592259 // Will be set for incomplete replies
22602260 optional bytes ContinuationToken = 3 ;
22612261}
2262+
2263+ // Forces cleanup-related operations in datashard tablet:
2264+ // compaction, GC, GC log and other temporary data erasure.
2265+ // After this operation, all deleted data that was not used at the beginning of the operation
2266+ // is guaranteed to be garbage-collected in the blobstorage.
2267+ // Note: deleted data may still be used for a while, e.g. for history for MVCC.
2268+ message TEvForceDataCleanup {
2269+ optional uint64 DataCleanupGeneration = 1 ; // increasing sequence
2270+ }
2271+
2272+ // Returns DataCleanupGeneration of the last successfully completed TEvForceDataCleanup request.
2273+ // Intermediate requests and corresponding TEvForceDataCleanupResult's may be skipped.
2274+ message TEvForceDataCleanupResult {
2275+ optional uint64 DataCleanupGeneration = 1 ; // from corresponding request
2276+ }
Original file line number Diff line number Diff line change @@ -346,6 +346,9 @@ namespace TEvDataShard {
346346 EvInMemoryStateRequest,
347347 EvInMemoryStateResponse,
348348
349+ EvForceDataCleanup,
350+ EvForceDataCleanupResult,
351+
349352 EvEnd
350353 };
351354
@@ -1562,6 +1565,24 @@ namespace TEvDataShard {
15621565 }
15631566 };
15641567
1568+ struct TEvForceDataCleanup : TEventPB<TEvForceDataCleanup, NKikimrTxDataShard::TEvForceDataCleanup,
1569+ TEvDataShard::EvForceDataCleanup> {
1570+ TEvForceDataCleanup () = default ;
1571+
1572+ TEvForceDataCleanup (ui64 dataCleanupGeneration) {
1573+ Record.SetDataCleanupGeneration (dataCleanupGeneration);
1574+ }
1575+ };
1576+
1577+ struct TEvForceDataCleanupResult : TEventPB<TEvForceDataCleanupResult, NKikimrTxDataShard::TEvForceDataCleanupResult,
1578+ TEvDataShard::EvForceDataCleanupResult> {
1579+ TEvForceDataCleanupResult () = default ;
1580+
1581+ TEvForceDataCleanupResult (ui64 dataCleanupGeneration) {
1582+ Record.SetDataCleanupGeneration (dataCleanupGeneration);
1583+ }
1584+ };
1585+
15651586 /* *
15661587 * This message is used to ask datashard to compact any borrowed parts it has
15671588 * for the specified user table.
Original file line number Diff line number Diff line change 1+ #include " datashard_impl.h"
2+
3+ namespace NKikimr ::NDataShard {
4+
5+ void TDataShard::Handle (TEvDataShard::TEvForceDataCleanup::TPtr& ev, const TActorContext& ctx) {
6+ // TODO: implement
7+ Y_UNUSED (ev);
8+ Y_UNUSED (ctx);
9+ }
10+
11+ } // namespace NKikimr::NDataShard
Original file line number Diff line number Diff line change @@ -1389,6 +1389,8 @@ class TDataShard
13891389
13901390 void Handle (TEvIncrementalRestoreScan::TEvFinished::TPtr& ev, const TActorContext& ctx);
13911391
1392+ void Handle (TEvDataShard::TEvForceDataCleanup::TPtr& ev, const TActorContext& ctx);
1393+
13921394 void HandleByReplicationSourceOffsetsServer (STATEFN_SIG);
13931395
13941396 void DoPeriodicTasks (const TActorContext &ctx);
@@ -3211,6 +3213,7 @@ class TDataShard
32113213 HFunc (TEvPrivate::TEvStatisticsScanFinished, Handle);
32123214 HFuncTraced (TEvPrivate::TEvRemoveSchemaSnapshots, Handle);
32133215 HFunc (TEvIncrementalRestoreScan::TEvFinished, Handle);
3216+ HFunc (TEvDataShard::TEvForceDataCleanup, Handle);
32143217 default :
32153218 if (!HandleDefaultEvents (ev, SelfId ())) {
32163219 ALOG_WARN (NKikimrServices::TX_DATASHARD, " TDataShard::StateWork unhandled event type: " << ev->GetTypeRewrite () << " event: " << ev->ToString ());
Original file line number Diff line number Diff line change 5555 datashard__compact_borrowed.cpp
5656 datashard__compaction.cpp
5757 datashard__conditional_erase_rows.cpp
58+ datashard__data_cleanup.cpp
5859 datashard__engine_host.cpp
5960 datashard__engine_host.h
6061 datashard__get_state_tx.cpp
You can’t perform that action at this time.
0 commit comments