Skip to content

YQ WM fixed cleanup table retries #8369

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
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
27 changes: 17 additions & 10 deletions ydb/core/kqp/workload_service/tables/table_queries.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -178,8 +178,15 @@ class TCleanupTablesActor : public TSchemeActorBase<TCleanupTablesActor> {

TablePathsToCheck.clear();
for (const auto& result : results) {
const TString& path = CanonizePath(result.Path);
LOG_D("Describe table " << path << " status " << result.Status);
const TString& fullPath = CanonizePath(result.Path);
LOG_D("Describe table " << fullPath << " status " << result.Status);

std::pair<TString, TString> pathPair;
if (TString error; !TrySplitPathByDb(fullPath, AppData()->TenantName, pathPair, error)) {
TablesExists = false;
AddError(TStringBuilder() << "Failed to describe table path " << fullPath << ", " << error);
continue;
}

switch (result.Status) {
case EStatus::Unknown:
Expand All @@ -188,20 +195,20 @@ class TCleanupTablesActor : public TSchemeActorBase<TCleanupTablesActor> {
case EStatus::AccessDenied:
case EStatus::RedirectLookupError:
TablesExists = false;
AddError(TStringBuilder() << "Failed to describe table path " << path << ", " << result.Status);
AddError(TStringBuilder() << "Failed to describe table path " << fullPath << ", " << result.Status);
break;
case EStatus::LookupError:
RetryPathCheck(result.Path, result.Status);
RetryPathCheck(pathPair.second, result.Status);
break;
case EStatus::RootUnknown:
case EStatus::PathErrorUnknown:
case EStatus::TableCreationNotComplete:
TablesExists = false;
break;
case EStatus::Ok:
LOG_D("Start cleanup for table " << path);
LOG_D("Start cleanup for table " << fullPath);
CleanupQueriesInFlight++;
Register(new TCleanupTablesRetryQuery(SelfId(), path));
Register(new TCleanupTablesRetryQuery(SelfId(), fullPath));
break;
}
}
Expand Down Expand Up @@ -251,14 +258,14 @@ class TCleanupTablesActor : public TSchemeActorBase<TCleanupTablesActor> {
}

private:
void RetryPathCheck(const TVector<TString>& path, EStatus status) {
if (TablePathsToCheck.empty() && !ScheduleRetry(TStringBuilder() << "Retry " << status << " for table " << CanonizePath(path))) {
void RetryPathCheck(const TString& path, EStatus status) {
if (TablePathsToCheck.empty() && !ScheduleRetry(TStringBuilder() << "Retry " << status << " for table " << path)) {
TablesExists = false;
AddError(TStringBuilder() << "Retry limit exceeded for table " << CanonizePath(path) << ", " << status);
AddError(TStringBuilder() << "Retry limit exceeded for table " << path << ", " << status);
return;
}

TablePathsToCheck.emplace_back(path);
TablePathsToCheck.emplace_back(SplitPath(path));
}

template <typename TMessage>
Expand Down
Loading