Skip to content

Commit 5694aa7

Browse files
GrigoriyPArekby
authored andcommitted
YQ WM fixed cleanup table retries (ydb-platform#8369)
1 parent d48d8a9 commit 5694aa7

File tree

1 file changed

+17
-10
lines changed

1 file changed

+17
-10
lines changed

ydb/core/kqp/workload_service/tables/table_queries.cpp

+17-10
Original file line numberDiff line numberDiff line change
@@ -178,8 +178,15 @@ class TCleanupTablesActor : public TSchemeActorBase<TCleanupTablesActor> {
178178

179179
TablePathsToCheck.clear();
180180
for (const auto& result : results) {
181-
const TString& path = CanonizePath(result.Path);
182-
LOG_D("Describe table " << path << " status " << result.Status);
181+
const TString& fullPath = CanonizePath(result.Path);
182+
LOG_D("Describe table " << fullPath << " status " << result.Status);
183+
184+
std::pair<TString, TString> pathPair;
185+
if (TString error; !TrySplitPathByDb(fullPath, AppData()->TenantName, pathPair, error)) {
186+
TablesExists = false;
187+
AddError(TStringBuilder() << "Failed to describe table path " << fullPath << ", " << error);
188+
continue;
189+
}
183190

184191
switch (result.Status) {
185192
case EStatus::Unknown:
@@ -188,20 +195,20 @@ class TCleanupTablesActor : public TSchemeActorBase<TCleanupTablesActor> {
188195
case EStatus::AccessDenied:
189196
case EStatus::RedirectLookupError:
190197
TablesExists = false;
191-
AddError(TStringBuilder() << "Failed to describe table path " << path << ", " << result.Status);
198+
AddError(TStringBuilder() << "Failed to describe table path " << fullPath << ", " << result.Status);
192199
break;
193200
case EStatus::LookupError:
194-
RetryPathCheck(result.Path, result.Status);
201+
RetryPathCheck(pathPair.second, result.Status);
195202
break;
196203
case EStatus::RootUnknown:
197204
case EStatus::PathErrorUnknown:
198205
case EStatus::TableCreationNotComplete:
199206
TablesExists = false;
200207
break;
201208
case EStatus::Ok:
202-
LOG_D("Start cleanup for table " << path);
209+
LOG_D("Start cleanup for table " << fullPath);
203210
CleanupQueriesInFlight++;
204-
Register(new TCleanupTablesRetryQuery(SelfId(), path));
211+
Register(new TCleanupTablesRetryQuery(SelfId(), fullPath));
205212
break;
206213
}
207214
}
@@ -251,14 +258,14 @@ class TCleanupTablesActor : public TSchemeActorBase<TCleanupTablesActor> {
251258
}
252259

253260
private:
254-
void RetryPathCheck(const TVector<TString>& path, EStatus status) {
255-
if (TablePathsToCheck.empty() && !ScheduleRetry(TStringBuilder() << "Retry " << status << " for table " << CanonizePath(path))) {
261+
void RetryPathCheck(const TString& path, EStatus status) {
262+
if (TablePathsToCheck.empty() && !ScheduleRetry(TStringBuilder() << "Retry " << status << " for table " << path)) {
256263
TablesExists = false;
257-
AddError(TStringBuilder() << "Retry limit exceeded for table " << CanonizePath(path) << ", " << status);
264+
AddError(TStringBuilder() << "Retry limit exceeded for table " << path << ", " << status);
258265
return;
259266
}
260267

261-
TablePathsToCheck.emplace_back(path);
268+
TablePathsToCheck.emplace_back(SplitPath(path));
262269
}
263270

264271
template <typename TMessage>

0 commit comments

Comments
 (0)