diff options
author | Nikolay Perfilov <pnv1@yandex-team.ru> | 2025-02-13 18:05:43 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-02-13 15:05:43 +0000 |
commit | 54f9570401e65e17e976b6eae25a0e06d9d96839 (patch) | |
tree | 5ec459a988a7939cd8eb5a8437a574a7514b75cc | |
parent | f578a189e6b63a0c187e8f259bd0a42a4cb672b2 (diff) | |
download | ydb-54f9570401e65e17e976b6eae25a0e06d9d96839.tar.gz |
Fix saving progress if batch was not uploaded (#14537)
-rw-r--r-- | ydb/apps/ydb/CHANGELOG.md | 1 | ||||
-rw-r--r-- | ydb/public/lib/ydb_cli/import/import.cpp | 10 |
2 files changed, 7 insertions, 4 deletions
diff --git a/ydb/apps/ydb/CHANGELOG.md b/ydb/apps/ydb/CHANGELOG.md index 79eaef374c..0446f53926 100644 --- a/ydb/apps/ydb/CHANGELOG.md +++ b/ydb/apps/ydb/CHANGELOG.md @@ -1,4 +1,5 @@ * Fixed a bug where `ydb auth get-token` command tried to authenticate twice: while listing andpoints and while executing actual token request. +* Fixed a bug where `ydb import file csv` command was saving progress even if a batch upload had been failed. * Include coordination nodes in local backups (`ydb tools dump` and `ydb tools restore`). Rate limiters that utilize the coordination node are saved in the coordination node's backup folder, preserving the existing path hierarchy. * Fixed a bug where some errors could be ignored when restoring from a local backup. * Added `ydb workload log import generator` command. diff --git a/ydb/public/lib/ydb_cli/import/import.cpp b/ydb/public/lib/ydb_cli/import/import.cpp index 98607182c9..60ce65143a 100644 --- a/ydb/public/lib/ydb_cli/import/import.cpp +++ b/ydb/public/lib/ydb_cli/import/import.cpp @@ -1005,10 +1005,12 @@ TStatus TImportFileClient::TImpl::UpsertCsv(IInputStream& input, UpsertTValueBuffer(dbPath, std::move(buildFunc)) .Apply([&, batchStatus](const TAsyncStatus& asyncStatus) { jobInflightManager->ReleaseJob(); - batchStatus->Completed = true; - if (!FileProgressPool->AddFunc(saveProgressIfAny) && !Failed.exchange(true)) { - ErrorStatus = MakeHolder<TStatus>(MakeStatus(EStatus::INTERNAL_ERROR, - "Couldn't add worker func to save progress")); + if (asyncStatus.GetValueSync().IsSuccess()) { + batchStatus->Completed = true; + if (!FileProgressPool->AddFunc(saveProgressIfAny) && !Failed.exchange(true)) { + ErrorStatus = MakeHolder<TStatus>(MakeStatus(EStatus::INTERNAL_ERROR, + "Couldn't add worker func to save progress")); + } } return asyncStatus; }); |