Conversation
|
Duplicate? #64222 |
|
I thought that backups implementation is very similar to disk implementation internally in ClickHouse. And it can work similar to web disks. Except that even if you adapt backup engine to disk interface, you cannot just use this disk in So then I decided that it makes sense to implement a new
Although, we still have the problem that the database relative path will be completely different from the backup database relative path. So we need to also have a path translation layer somewhere inside disk implementation. So current design has following components:
When the |
|
You have backup query: Backup engine can be anything like To create database For example with The goal was for the client to specify exactly the same engine that he used during backup creation. For all backup engines database |
I discussed with @alexey-milovidov and this pull request looks abandoned. Last commit Plus only Backup disk implementation is not useful at all, because you need to have implementation of full Backup attach mechanism. In this pull request I implemented it on database layer, so it can work with any table/database from backup. I wrote more motivation above. |
|
Database Let’s make an example with a Example of usage. Let’s create test database, tables, insert some data and then create a backup: So now we have Now we can query any table from database: It is also possible to work with this database as with any ordinary database. For example query tables in it: |
109c4be to
3513e8b
Compare
kssenii
left a comment
There was a problem hiding this comment.
Please add some documentation for this feature in docs/en/engines/database-engines/.
I added documentation. |
| SELECT '--'; | ||
|
|
||
| DROP DATABASE IF EXISTS 03279_test_database_backup_database; | ||
| CREATE DATABASE 03279_test_database_backup_database ENGINE = Backup('03279_test_database', Disk('backups', '03279_test_database')); |
There was a problem hiding this comment.
Let's add one integration test with server restart? Just to test that server restarts successfully with created DatabaseBackup and tables are accessible after restart.
There was a problem hiding this comment.
Added integation tests.
test_storage_dict/test.py::test_storage_dict
|
|
Could you please merge this branch with master one more time - there was a change in style check (#76082) and now style check fails in the private synchronization PR of this PR, because checks were started there on a branch including the mentioned change in the style check, but this PR's checks were run without it, but it will fail in this PR as well once you merge with master branch. ClickHouse/utils/check-style/check-style Lines 471 to 473 in 83f16db |
Head branch was pushed to by a user without write access
|
It was broken in general, no relevant failures |
638e7fe
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes to CHANGELOG.md):
Add new Database engine
DatabaseBackupthat allows to instantly attach table/database from backup.