Conversation
|
This is an automated comment for commit c209657 with description of existing statuses. It's updated for the latest CI running ❌ Click here to open a full report in a separate page
Successful checks
|
| namespace DB | ||
| { | ||
|
|
||
| DiskBackup::DiskBackup(const String & name_, DiskPtr delegate_, MetadataStoragePtr metadata_) : IDisk(name_), delegate(delegate_), metadata(metadata_) |
There was a problem hiding this comment.
Could you please add some documentation to https://github.com/ClickHouse/ClickHouse/blob/master/docs/en/operations/storing-data.md about this disk? What its usecase, how to configure it and maybe some small usage example.
| } | ||
|
|
||
| public: | ||
| DiskBackup(const String & name_, DiskPtr delegate_, MetadataStoragePtr metadata_); |
There was a problem hiding this comment.
As I see this constructor is used only in unit test, because it was not clear how to create a config object from there? If so, take a look here
ClickHouse/src/Common/tests/gtest_named_collections.cpp
Lines 40 to 58 in e493856
may be you can do the same, so this constructor could be removed
| extern const int NOT_IMPLEMENTED; | ||
| } | ||
|
|
||
| class DiskBackup : public IDisk |
There was a problem hiding this comment.
It will be good to also add a comment before this class definition with a small explanation of the purpose of this class. A sentence about its purpose from #42154 will suffice.
| delegate->createFile("test_folder/test.txt"); | ||
|
|
||
| EXPECT_EQ(backup->isFile("test_folder/test.txt"), true); | ||
| EXPECT_EQ(backup->isDirectory("test_folder"), true); |
There was a problem hiding this comment.
Need to also check that write operations are not allowed, you can use ASSERT_THROW for this
|
|
||
| DiskBackup::DiskBackup(const String & name_, const Poco::Util::AbstractConfiguration & config_, const String & config_prefix_, const DisksMap & map_) : IDisk(name_) | ||
| { | ||
| String disk_delegate_name = config_.getString(config_prefix_ + ".disk_delegate"); |
There was a problem hiding this comment.
May be we can rename disk_delegate to just disk, because in some similar cases we use just "disk", for example for disk type "cache".
| @@ -0,0 +1,105 @@ | |||
| #include <filesystem> | |||
There was a problem hiding this comment.
Let's also add a stateless test with disk created from SQL, see example here
| @@ -0,0 +1,105 @@ | |||
| #include <filesystem> | |||
| #include <fstream> | |||
| #include <memory> | |||
There was a problem hiding this comment.
Also need an integration test which creates the disk with type backup and checks that we can read from it and that an attempt to write to it fails. Also check that server can be restarted (via node.restart_clickhouse()). Also check the same for customly created disk from SQL (mentioned in the comment above).
| namespace DB | ||
| { | ||
|
|
||
| class MetadataStorageFromBackupFile final : public IMetadataStorage |
There was a problem hiding this comment.
A small comment in code about this class here will also be good to have - its purpose and how it works - shortly.
| return std::make_unique<StaticDirectoryIterator>(std::move(dir_file_paths)); | ||
| } | ||
|
|
||
| for (const auto& listed_path: nodes.at(path).children) |
There was a problem hiding this comment.
| for (const auto& listed_path: nodes.at(path).children) | |
| for (const auto & listed_path: nodes.at(path).children) |
| std::unordered_map<String /* path */, MetadataStorageFromBackupFilePseudoFileSystemNode> nodes; | ||
|
|
||
| public: | ||
| explicit MetadataStorageFromBackupFile(const String & path_to_backup_file); |
There was a problem hiding this comment.
I do not see an object of this class being created anywhere, or I missed it somewhere?
|
Dear @AlexNsf, this PR hasn't been updated for a while. Will you continue working on it? If not, please close it. Otherwise, ignore this message. |
2 similar comments
|
Dear @AlexNsf, this PR hasn't been updated for a while. Will you continue working on it? If not, please close it. Otherwise, ignore this message. |
|
Dear @AlexNsf, this PR hasn't been updated for a while. Will you continue working on it? If not, please close it. Otherwise, ignore this message. |
|
Dear @AlexNsf, this PR hasn't been updated for a while. Will you continue working on it? If not, please close it. Otherwise, ignore this message. |
|
@AlexNsf thanks for your contribution! This has been superseded by #75725, see #75725 (comment) this comment on "Database vs Disk" pros and cons. |
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes to CHANGELOG.md):
Add backup disk, that reads metadata from ".backup" file to add some optimizations for working with backup. Closes #42154.
Documentation entry for user-facing changes
Modify your CI run
NOTE: If your merge the PR with modified CI you MUST KNOW what you are doing
NOTE: Checked options will be applied if set before CI RunConfig/PrepareRunConfig step
Include tests (required builds will be added automatically):
Exclude tests:
Extra options:
Only specified batches in multi-batch jobs: