Skip to content

Commit e220453

Browse files
authored
Add TabletId and Status to TEvForceDataCleanupResult (#14380)
1 parent da88f78 commit e220453

File tree

4 files changed

+16
-3
lines changed

4 files changed

+16
-3
lines changed

ydb/core/protos/tx_datashard.proto

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2279,5 +2279,11 @@ message TEvForceDataCleanup {
22792279
// Returns DataCleanupGeneration of the last successfully completed TEvForceDataCleanup request.
22802280
// Intermediate requests and corresponding TEvForceDataCleanupResult's may be skipped.
22812281
message TEvForceDataCleanupResult {
2282-
optional uint64 DataCleanupGeneration = 1; // from corresponding request
2282+
enum EStatus {
2283+
OK = 0;
2284+
FAILED = 1;
2285+
};
2286+
optional uint64 DataCleanupGeneration = 1; // from corresponding request (or greater)
2287+
optional uint64 TabletId = 2;
2288+
optional EStatus Status = 3;
22832289
}

ydb/core/tx/datashard/datashard.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1578,8 +1578,10 @@ namespace TEvDataShard {
15781578
TEvDataShard::EvForceDataCleanupResult> {
15791579
TEvForceDataCleanupResult() = default;
15801580

1581-
TEvForceDataCleanupResult(ui64 dataCleanupGeneration) {
1581+
TEvForceDataCleanupResult(ui64 dataCleanupGeneration, ui64 tabletId, NKikimrTxDataShard::TEvForceDataCleanupResult::EStatus status) {
15821582
Record.SetDataCleanupGeneration(dataCleanupGeneration);
1583+
Record.SetTabletId(tabletId);
1584+
Record.SetStatus(status);
15831585
}
15841586
};
15851587

ydb/core/tx/datashard/datashard__data_cleanup.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,10 @@ namespace NKikimr::NDataShard {
55
void TDataShard::Handle(TEvDataShard::TEvForceDataCleanup::TPtr& ev, const TActorContext& ctx) {
66
// TODO: implement
77
const auto& record = ev->Get()->Record;
8-
auto result = MakeHolder<TEvDataShard::TEvForceDataCleanupResult>(record.GetDataCleanupGeneration());
8+
auto result = MakeHolder<TEvDataShard::TEvForceDataCleanupResult>(
9+
record.GetDataCleanupGeneration(),
10+
TabletID(),
11+
NKikimrTxDataShard::TEvForceDataCleanupResult::OK);
912
ctx.Send(ev->Sender, std::move(result));
1013
}
1114

ydb/core/tx/datashard/datashard_ut_data_cleanup.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@ Y_UNIT_TEST_SUITE(DataCleanup) {
2626

2727
auto ev = runtime.GrabEdgeEventRethrow<TEvDataShard::TEvForceDataCleanupResult>(sender);
2828
UNIT_ASSERT_VALUES_EQUAL(ev->Get()->Record.GetDataCleanupGeneration(), expectedDataCleanupGeneration);
29+
UNIT_ASSERT_VALUES_EQUAL(ev->Get()->Record.GetTabletId(), shards.at(0));
30+
UNIT_ASSERT_EQUAL(ev->Get()->Record.GetStatus(), NKikimrTxDataShard::TEvForceDataCleanupResult::OK);
2931
}
3032
}
3133

0 commit comments

Comments
 (0)