-
Notifications
You must be signed in to change notification settings - Fork 737
Add handlers for ExportToFs / ImportFromFs #28126
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
Add handlers for ExportToFs / ImportFromFs #28126
Conversation
|
🟢 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Как будто можно сделать общую функцию для s3 и fs.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Отдельным pr-ом сделаю рефакторинг
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
А почему шифрование не поддерживается как для s3?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Отдельным pr-ом сделаю добавление в .proto и в хэндлеры шифрование
fe2b782 to
505f73f
Compare
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds file system (FS) backup support for YDB, enabling export to and import from local or network file systems (like NFS). The implementation follows the existing patterns for S3-based backup operations.
Key changes:
- Added
ExportToFsandImportFromFsRPC methods with validation for base paths and compression settings - Created comprehensive validation tests for FS backup parameters
- Refactored the
YDB_SDK_CLIENTmacro into a shared header for code reuse
Reviewed Changes
Copilot reviewed 23 out of 23 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| ydb/services/ydb/ydb_import.cpp | Registers ImportFromFs RPC endpoint |
| ydb/services/ydb/ydb_export.cpp | Registers ExportToFs RPC endpoint |
| ydb/services/ydb/backup_ut/ya.make | Adds new validation test file to build |
| ydb/services/ydb/backup_ut/s3_backup_test_base.h | Extracts YDB_SDK_CLIENT macro to shared header |
| ydb/services/ydb/backup_ut/fs_backup_validation_ut.cpp | Comprehensive validation tests for FS backup parameters |
| ydb/services/ydb/backup_ut/backup_test_base.h | Shared YDB_SDK_CLIENT macro definition |
| ydb/public/sdk/cpp/src/client/operation/operation.cpp | Adds FS operation templates |
| ydb/public/sdk/cpp/src/client/import/import.cpp | Implements ImportFromFs client method |
| ydb/public/sdk/cpp/src/client/export/export.cpp | Implements ExportToFs client method |
| ydb/public/sdk/cpp/include/ydb-cpp-sdk/client/import/import.h | Declares ImportFromFs settings and response types |
| ydb/public/sdk/cpp/include/ydb-cpp-sdk/client/export/export.h | Declares ExportToFs settings and response types |
| ydb/public/api/protos/ydb_import.proto | Documents absolute path requirement for base_path |
| ydb/public/api/protos/ydb_export.proto | Documents absolute path requirement for base_path |
| ydb/core/tx/schemeshard/schemeshard_audit_log.cpp | Adds audit logging for FS export/import |
| ydb/core/protos/import.proto | Adds ImportFromFsSettings to proto definitions |
| ydb/core/protos/export.proto | Adds ExportToFsSettings to proto definitions |
| ydb/core/grpc_services/service_import.h | Declares DoImportFromFsRequest handler |
| ydb/core/grpc_services/service_export.h | Declares DoExportToFsRequest handler |
| ydb/core/grpc_services/rpc_import_base.h | Adds FS import kind handling to operation conversion |
| ydb/core/grpc_services/rpc_import.cpp | Implements ImportFromFs RPC handler with validation |
| ydb/core/grpc_services/rpc_export_base.h | Adds FS export kind handling to operation conversion |
| ydb/core/grpc_services/rpc_export.cpp | Implements ExportToFs RPC handler with validation |
| ydb/core/cms/console/console_configs_subscriber.cpp | Clears and updates config when changed |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| struct TItem { | ||
| std::string Src; |
Copilot
AI
Nov 6, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The TItem struct in TExportToFsSettings lacks documentation. Add comments explaining what Src and Dst represent (e.g., source path in database and destination path on filesystem).
| struct TItem { | |
| std::string Src; | |
| struct TItem { | |
| /// Source path in the database to export from. | |
| std::string Src; | |
| /// Destination path on the filesystem to export to. |
|
|
||
| struct TItem { | ||
| // Source path. | ||
| // Path to the exported table/directory in FS (relative to base_path) |
Copilot
AI
Nov 6, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The comment says 'exported table/directory' but this is for import settings where the correct terminology would be 'the exported data' or 'backup location'. Consider rephrasing to 'Path to the backup data in FS (relative to base_path)'.
| // Path to the exported table/directory in FS (relative to base_path) | |
| // Path to the backup data in FS (relative to base_path) |
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This comment was marked as outdated.
This comment was marked as outdated.
|
⚪
🟢
*please be aware that the difference is based on comparing your commit and the last completed build from the post-commit, check comparation |
|
⚪ ⚪ Ya make output | Test bloat | Test bloat
🟢
*please be aware that the difference is based on comparing your commit and the last completed build from the post-commit, check comparation |
pnv1
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
SDK part LGTM
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Changelog entry
...
Changelog category
Description for reviewers
Merge after #28072