diff options
author | yplishan <yplishan@ydb.tech> | 2023-11-28 11:59:40 +0300 |
---|---|---|
committer | yplishan <yplishan@ydb.tech> | 2023-11-28 13:18:45 +0300 |
commit | 31cf81679842e3335cbcfeae3a52bd4cbb829c9a (patch) | |
tree | c38802e6528a4671730cd9d52549cbc04171a6e2 | |
parent | f9a0d615c4e78fadc0d138af5bcfb5adfc4c0aeb (diff) | |
download | ydb-31cf81679842e3335cbcfeae3a52bd4cbb829c9a.tar.gz |
Added binding id to some synchronization issues
3 files changed, 39 insertions, 16 deletions
diff --git a/ydb/core/fq/libs/compute/ydb/synchronization_service/synchronization_service.cpp b/ydb/core/fq/libs/compute/ydb/synchronization_service/synchronization_service.cpp index ea283ad2dc..234beb9e0d 100644 --- a/ydb/core/fq/libs/compute/ydb/synchronization_service/synchronization_service.cpp +++ b/ydb/core/fq/libs/compute/ydb/synchronization_service/synchronization_service.cpp @@ -165,13 +165,13 @@ public: void Handle(const TEvControlPlaneStorage::TEvDescribeBindingResponse::TPtr& ev) { const auto& issues = ev.Get()->Get()->Issues; + const auto& result = ev->Get()->Result; + const auto& id = result.binding().meta().id(); if (issues) { LOG_E("DescribeBindingResponse, scope = " << Scope << " (failed): " << issues.ToOneLineString()); - ReplyErrorAndPassAway(issues, "Error getting a describe of binding at the synchronization stage"); + ReplyErrorAndPassAway(issues, TStringBuilder {} << "Error getting a description of a binding with id '" << id << "' at the synchronization stage"); return; } - const auto& result = ev->Get()->Result; - const auto& id = result.binding().meta().id(); LOG_I("Received binding: scope = " << Scope << " , id = " << id << ", type = " << static_cast<int>(result.binding().content().setting().binding_case())); Bindings[result.binding().meta().id()] = result.binding(); @@ -404,7 +404,8 @@ private: TPermissions{}, CommonConfig, Signer, - true + true, + connection.first )); } if (Connections.empty()) { @@ -423,7 +424,11 @@ private: request.Get()->Get()->YDBClient = Client; auto it = Connections.find(binding.second.content().connection_id()); if (it == Connections.end()) { - ReplyErrorAndPassAway(NYql::TIssues{NYql::TIssue{TStringBuilder{} << "Can't find conection id = " << binding.second.content().connection_id()}}); + NYql::TIssue issue {TStringBuilder {} + << "While synchronizing tables for binding with id '" << binding.first << "'"}; + issue.AddSubIssue(MakeIntrusive<NYql::TIssue>(TStringBuilder{} + << "Can't find connection with id '" << binding.second.content().connection_id() << "'")); + ReplyErrorAndPassAway(NYql::TIssues{issue}); return; } request.Get()->Get()->ConnectionContent = it->second.content(); @@ -434,7 +439,8 @@ private: TDuration::Seconds(30), Counters, TPermissions{}, - true + true, + binding.first )); } diff --git a/ydb/core/fq/libs/control_plane_proxy/actors/ydb_schema_query_actor.cpp b/ydb/core/fq/libs/control_plane_proxy/actors/ydb_schema_query_actor.cpp index fffc41f051..a78660fae6 100644 --- a/ydb/core/fq/libs/control_plane_proxy/actors/ydb_schema_query_actor.cpp +++ b/ydb/core/fq/libs/control_plane_proxy/actors/ydb_schema_query_actor.cpp @@ -527,7 +527,8 @@ NActors::IActor* MakeCreateConnectionActor( TPermissions permissions, const NConfig::TCommonConfig& commonConfig, TSigner::TPtr signer, - bool withoutRollback) { + bool withoutRollback, + TMaybe<TString> connectionId) { auto queryFactoryMethod = [signer = std::move(signer), requestTimeout, @@ -575,14 +576,20 @@ NActors::IActor* MakeCreateConnectionActor( return statements; }; - auto errorMessageFactoryMethod = [](const EStatus status, + auto& connectionName = request->Get()->Request.content().name(); + auto errorMessageFactoryMethod = [connectionId, connectionName](const EStatus status, const NYql::TIssues& issues) -> TString { Y_UNUSED(issues); + TStringBuilder message = TStringBuilder {} << "Synchronization of connection"; + if (connectionId.Defined()) { + message << " with id '" << connectionId << "'"; + } if (status == NYdb::EStatus::ALREADY_EXISTS) { - return "External data source with such name already exists"; + message << " failed, because external data source with name '" << connectionName << "' already exists"; } else { - return "Couldn't create external data source in YDB"; + message << " failed, because creation of external data source with name '" << connectionName << "' wasn't successful"; } + return message; }; return new TSchemaQueryYDBActor<TEvControlPlaneProxy::TEvCreateConnectionRequest, @@ -765,7 +772,8 @@ NActors::IActor* MakeCreateBindingActor( TDuration requestTimeout, TCounters& counters, TPermissions permissions, - bool withoutRollback) { + bool withoutRollback, + TMaybe<TString> bindingId) { auto queryFactoryMethod = [requestTimeout, &counters, permissions, withoutRollback](const TEvControlPlaneProxy::TEvCreateBindingRequest::TPtr& request) @@ -801,14 +809,21 @@ NActors::IActor* MakeCreateBindingActor( return statements; }; - auto errorMessageFactoryMethod = [](const EStatus status, + auto content = request->Get()->Request.content(); + auto bindingName = content.name(); + auto errorMessageFactoryMethod = [bindingId, bindingName](const EStatus status, const NYql::TIssues& issues) -> TString { Y_UNUSED(issues); + TStringBuilder message = TStringBuilder {} << "Synchronization of binding"; + if (bindingId.Defined()) { + message << " with id '" << bindingId << "'"; + } if (status == NYdb::EStatus::ALREADY_EXISTS) { - return "External data table with such name already exists"; + message << " failed, because external data table with name '" << bindingName << "' already exists"; } else { - return "Couldn't create external data table in YDB"; + message << " failed, because creation of external data table with name '" << bindingName << "' wasn't successful"; } + return message; }; return new TSchemaQueryYDBActor<TEvControlPlaneProxy::TEvCreateBindingRequest, diff --git a/ydb/core/fq/libs/control_plane_proxy/actors/ydb_schema_query_actor.h b/ydb/core/fq/libs/control_plane_proxy/actors/ydb_schema_query_actor.h index 1454db48a6..cc8fcd48e8 100644 --- a/ydb/core/fq/libs/control_plane_proxy/actors/ydb_schema_query_actor.h +++ b/ydb/core/fq/libs/control_plane_proxy/actors/ydb_schema_query_actor.h @@ -27,7 +27,8 @@ NActors::IActor* MakeCreateConnectionActor( TPermissions permissions, const NConfig::TCommonConfig& commonConfig, TSigner::TPtr signer, - bool withoutRollback = false); + bool withoutRollback = false, + TMaybe<TString> connectionId = Nothing()); NActors::IActor* MakeModifyConnectionActor( const NActors::TActorId& proxyActorId, @@ -52,7 +53,8 @@ NActors::IActor* MakeCreateBindingActor( TDuration requestTimeout, TCounters& counters, TPermissions permissions, - bool withoutRollback = false); + bool withoutRollback = false, + TMaybe<TString> bindingId = Nothing()); NActors::IActor* MakeModifyBindingActor( const NActors::TActorId& proxyActorId, |