diff options
author | auzhegov <auzhegov@yandex-team.com> | 2023-10-31 13:22:32 +0300 |
---|---|---|
committer | auzhegov <auzhegov@yandex-team.com> | 2023-10-31 13:50:22 +0300 |
commit | 0c72d00bdec4f92b4fdf6c170b43d9e22ae57e90 (patch) | |
tree | 030ae13e15f844a02ccaa84e57baa9f41b08bba2 | |
parent | 25a41c10e4afa65014b0de4c2d1a4cf8a57c93af (diff) | |
download | ydb-0c72d00bdec4f92b4fdf6c170b43d9e22ae57e90.tar.gz |
YQv2 removed rollback for upsert object statement
Initial version
-rw-r--r-- | ydb/core/fq/libs/control_plane_proxy/actors/ydb_schema_query_actor.cpp | 28 |
1 files changed, 20 insertions, 8 deletions
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 403540544b..30eab890d2 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 @@ -42,6 +42,14 @@ using TScheduleErrorRecoverySQLGeneration = using TShouldSkipStepOnError = std::function<bool(const TStatus& issues)>; +inline TScheduleErrorRecoverySQLGeneration NoRecoverySQLGeneration() { + return TScheduleErrorRecoverySQLGeneration{}; +} + +inline TShouldSkipStepOnError NoSkipOnError() { + return TShouldSkipStepOnError{}; +} + struct TSchemaQueryTask { TString SQL; TMaybe<TString> RollbackSQL; @@ -536,8 +544,7 @@ NActors::IActor* MakeCreateConnectionActor( if (createSecretStatement) { statements.push_back( TSchemaQueryTask{.SQL = *createSecretStatement, - .RollbackSQL = withoutRollback ? TMaybe<TString>{} : DropSecretObjectQuery(connectionContent.name()), - .ShouldSkipStepOnError = withoutRollback ? IsPathExistsIssue : TShouldSkipStepOnError{}}); + .ShouldSkipStepOnError = withoutRollback ? IsPathExistsIssue : NoSkipOnError()}); } TScheduleErrorRecoverySQLGeneration alreadyExistRecoveryActorFactoryMethod = @@ -559,9 +566,12 @@ NActors::IActor* MakeCreateConnectionActor( }; statements.push_back( TSchemaQueryTask{.SQL = TString{MakeCreateExternalDataSourceQuery( - connectionContent, objectStorageEndpoint, signer)}, - .ScheduleErrorRecoverySQLGeneration = withoutRollback ? TScheduleErrorRecoverySQLGeneration{} : alreadyExistRecoveryActorFactoryMethod, - .ShouldSkipStepOnError = withoutRollback ? IsPathExistsIssue : TShouldSkipStepOnError{}}); + connectionContent, objectStorageEndpoint, signer)}, + .ScheduleErrorRecoverySQLGeneration = + withoutRollback ? NoRecoverySQLGeneration() + : alreadyExistRecoveryActorFactoryMethod, + .ShouldSkipStepOnError = + withoutRollback ? IsPathExistsIssue : NoSkipOnError()}); return statements; }; @@ -776,7 +786,7 @@ NActors::IActor* MakeCreateBindingActor( permissions, requestTimeout, counters.GetCommonCounters( - RTC_CREATE_CONNECTION_IN_YDB))); // change counter + RTC_CREATE_BINDING_IN_YDB))); // change counter return true; } return false; @@ -784,8 +794,10 @@ NActors::IActor* MakeCreateBindingActor( statements.push_back(TSchemaQueryTask{ .SQL = TString{MakeCreateExternalDataTableQuery(bindingContent, externalSourceName)}, - .ScheduleErrorRecoverySQLGeneration = withoutRollback ? TScheduleErrorRecoverySQLGeneration{} :alreadyExistRecoveryActorFactoryMethod, - .ShouldSkipStepOnError = withoutRollback ? IsPathExistsIssue : TShouldSkipStepOnError{}}); + .ScheduleErrorRecoverySQLGeneration = + withoutRollback ? NoRecoverySQLGeneration() + : alreadyExistRecoveryActorFactoryMethod, + .ShouldSkipStepOnError = withoutRollback ? IsPathExistsIssue : NoSkipOnError()}); return statements; }; |