Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion ydb/core/protos/index_builder.proto
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ message TEvListResponse {

enum EBuildStatus {
INVALID = 0;
ACCEPTED = 1;
ACCEPTED = 1; // DEPRECATED don't use it, it does nothing, we cannot remove it for now, because old nodes can send it
IN_PROGRESS = 2;
DONE = 3;

Expand Down
14 changes: 5 additions & 9 deletions ydb/core/tx/datashard/build_index.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -664,15 +664,14 @@ void TDataShard::HandleSafe(TEvDataShard::TEvBuildIndexCreateRequest::TPtr& ev,
return;
}

auto response = MakeHolder<TEvDataShard::TEvBuildIndexProgressResponse>();
response->Record.SetBuildIndexId(record.GetBuildIndexId());
response->Record.SetTabletId(TabletID());
response->Record.SetStatus(NKikimrIndexBuilder::EBuildStatus::ACCEPTED);

TScanRecord::TSeqNo seqNo = {record.GetSeqNoGeneration(), record.GetSeqNoRound()};
response->Record.SetRequestSeqNoGeneration(seqNo.Generation);
response->Record.SetRequestSeqNoRound(seqNo.Round);
auto badRequest = [&](const TString& error) {
auto response = MakeHolder<TEvDataShard::TEvBuildIndexProgressResponse>();
response->Record.SetBuildIndexId(record.GetBuildIndexId());
response->Record.SetTabletId(TabletID());
response->Record.SetRequestSeqNoGeneration(seqNo.Generation);
response->Record.SetRequestSeqNoRound(seqNo.Round);
response->Record.SetStatus(NKikimrIndexBuilder::EBuildStatus::BAD_REQUEST);
auto issue = response->Record.AddIssues();
issue->set_severity(NYql::TSeverityIds::S_ERROR);
Expand All @@ -699,7 +698,6 @@ void TDataShard::HandleSafe(TEvDataShard::TEvBuildIndexCreateRequest::TPtr& ev,
if (const auto* recCard = ScanManager.Get(buildIndexId)) {
if (recCard->SeqNo == seqNo) {
// do no start one more scan
ctx.Send(ev->Sender, std::move(response));
return;
}

Expand Down Expand Up @@ -774,8 +772,6 @@ void TDataShard::HandleSafe(TEvDataShard::TEvBuildIndexCreateRequest::TPtr& ev,
TScanRecord recCard = {scanId, seqNo};

ScanManager.Set(buildIndexId, recCard);

ctx.Send(ev->Sender, std::move(response));
}

}