Open sanikolaev opened 1 year ago
It would be great to be able to restore a particular table. IMPORT can be automated for that, e.g.:
IMPORT
root@bb5278967f62:/# mysql -P9306 -h0 -e "insert into t(f) values('abc'); flush ramchunk t;" root@bb5278967f62:/# mysql -P9306 -h0 -e "insert into t2(f) values('abc'); flush ramchunk t2;" root@bb5278967f62:/# mysql -P9306 -h0 -e "backup table t to /tmp/" +----------------------------+ | Path | +----------------------------+ | /tmp/backup-20230222140126 | +----------------------------+ root@bb5278967f62:/# mysql -P9306 -h0 -e "drop table t" root@bb5278967f62:/# mysql -P9306 -h0 -e "import table t from '/tmp/backup-20230222140126/data/t/t'" root@bb5278967f62:/# mysql -P9306 -h0 -e "select * from t" +---------------------+------+ | id | f | +---------------------+------+ | 4901936465623121921 | abc | +---------------------+------+
For the sake of data safety and high availabiliy it makes sense to:
import
ATTACH
This should protect from losing the table in the middle of importing a table due to an instance shutdown or smth else.
Let's also add support for wildcards in --tables, so
--tables
--restore --tables=tbl1,tbl2
tbl1
tbl2
--restore --tables=tbl*
tbl*
%
*
We'll also need to cover the new functionality with CLT tests.
It would be great to be able to restore a particular table.
IMPORT
can be automated for that, e.g.:UPDATE Jan 19th 2024
For the sake of data safety and high availabiliy it makes sense to:
import
a table into a temporary table (may take time since we copy the files here)ATTACH
for that (available for RT since https://github.com/manticoresoftware/manticoresearch/commit/af5812cc0affbb74f31d6f9d4f0ea34f6ec64a0f)This should protect from losing the table in the middle of importing a table due to an instance shutdown or smth else.
Let's also add support for wildcards in
--tables
, so--restore --tables=tbl1,tbl2
restorestbl1
andtbl2
--restore --tables=tbl*
restores alltbl*
. Let's support wildcards%
and*
We'll also need to cover the new functionality with CLT tests.