matrixorigin / matrixone

Hyperconverged cloud-edge native database
https://docs.matrixorigin.cn/en
Apache License 2.0
1.79k stars 276 forks source link

[Subtask]: change sys tenant restore normal tenant to normal tenant syntax #16180

Closed YANGGMM closed 6 months ago

YANGGMM commented 6 months ago

Parent Issue

14784

Detail of Subtask

change sys tenant restore normal tenant to normal tenant syntax

  1. remove to account
  2. default according to the snapshot

Describe implementation you've considered

No response

Additional information

No response

ck89119 commented 6 months ago

之前已经改了

YANGGMM commented 6 months ago

test has passed

Ariznawlll commented 6 months ago

testing

Ariznawlll commented 6 months ago

系统租户恢复普通租户到普通租户: 数据量10w 测试步骤:

连接mo:
mysql -h 127.0.0.1 -P 6001 -udump -p111
create account acc01 admin_name = 'test_account' identified by '111';
acc01连接mo:
mysql -h 127.0.0.1 -P 6001 -uacc01:test_account -p111
create database sysbench_db;

git clone https://github.com/matrixorigin/mo-sysbench.git
cd mo-sysbench
sysbench  --mysql-host=127.0.0.1 --mysql-port=6001 --mysql-user=acc01:test_account --mysql-password=111 oltp_point_select.lua --mysql-db=sysbench_db --tables=10 --table_size=100000 --threads=1000 --time=30 --report-interval=10 cleanup
sysbench  --mysql-host=127.0.0.1 --mysql-port=6001 --mysql-user=acc01:test_account --mysql-password=111 oltp_point_select.lua --mysql-db=sysbench_db --tables=10 --table_size=100000 --threads=1000 --time=30 --report-interval=10 --auto_inc=off prepare

cd mo-backup
./mo_br snapshot restore --host "127.0.0.1" --port 6001 --user "dump" --password "111" --account "acc01" --sname "sp01"

mysql -h 127.0.0.1 -P 6001 -uacc01:test_account -p111
drop table sbtest2;
drop table sbtest5;
truncate sbtest7;
delete from sbtest9 where id > 50000;
image

执行恢复之后,验证数据正确性。

测试结论:系统租户恢复普通租户到普通租户命令 成功,可以正常使用