Skip to content

[Bug]: [snapshot performance] restore is too slow. #16099

Closed

Description

@Ariznawlll

Is there an existing issue for the same bug?

  • I have checked the existing issues.

Branch Name

main

Commit ID

4257dc6

Other Environment Information

- Hardware parameters:
- OS type:
- Others:

Actual Behavior

restore 一张 10亿数据量的表大约30min恢复了45539328(不到1/2).

Expected Behavior

No response

Steps to Reproduce

集群环境:
create database big_data_test;
use big_data_test;
create table  if not exists big_data_test.table_basic_for_load_1B( col1 tinyint, col2 smallint, col3 int, col4 bigint, col5 tinyint unsigned, col6 smallint unsigned, col7 int unsigned, col8 bigint unsigned, col9 float, col10 double, col11 varchar(255), col12 Date, col13 DateTime, col14 timestamp, col15 bool, col16 decimal(16,6), col17 text, col18 json, col19 blob, col20 binary(255), col21 varbinary(255), col22 vecf32(3), col23 vecf32(3), col24 vecf64(3), col25 vecf64(3));
load data url s3option {'endpoint'='http://cos.ap-guangzhou.myqcloud.com','access_key_id'='***','secret_access_key'='***','bucket'='mo-load-guangzhou-1308875761', 'filepath'='mo-big-data/1000000000_20_columns_load_data_new.csv'} into table big_data_test.table_basic_for_load_1B fields terminated by '|' lines terminated by '\n' parallel 'true';
(具体的ak sk如有需要,请联系我)
create snapshot sp03 for account sys;

drop database big_data_test;

restore account sys database big_data_test table table_basic_for_load_1b from snapshot sp03;

Additional information

No response

Activity

  1. added
    kind/bug
    severity/s0
    on May 14, 2024
  2. added this to the 1.2.0 milestone on May 14, 2024
  3. modified the milestones: 1.2.0, 1.2.1 on May 15, 2024
  4. YANGGMM commented on May 15, 2024

    @YANGGMM
    Contributor

    单机环境下恢复一个大约300w行的table 花费十几分钟

    image
  5. YANGGMM commented on May 15, 2024

    @YANGGMM
    Contributor

    显示执行

    mysql> begin;
    Query OK, 0 rows affected (0.00 sec)
    
    mysql> drop table if exists `bmsql_order_line`;
    Query OK, 0 rows affected (0.05 sec)
    
    mysql> use tpcc;
    Database changed
    mysql> 
    mysql> CREATE TABLE `bmsql_order_line` (
        -> `ol_w_id` INT NOT NULL,
        -> `ol_d_id` INT NOT NULL,
        -> `ol_o_id` INT NOT NULL,
        -> `ol_number` INT NOT NULL,
        -> `ol_i_id` INT NOT NULL,
        -> `ol_delivery_d` TIMESTAMP DEFAULT null,
        -> `ol_amount` DECIMAL(6,2) DEFAULT null,
        -> `ol_supply_w_id` INT DEFAULT null,
        -> `ol_quantity` INT DEFAULT null,
        -> `ol_dist_info` CHAR(24) DEFAULT null,
        -> PRIMARY KEY (`ol_w_id`,`ol_d_id`,`ol_o_id`,`ol_number`)
        -> ) partition by key algorithm = 2 (ol_w_id);
    Query OK, 0 rows affected (0.03 sec)
    
    mysql> insert into `tpcc`.`bmsql_order_line` SELECT * FROM `tpcc`.`bmsql_order_line` {snapshot = 'sp_01'};
    Query OK, 2998810 rows affected (11 min 5.11 sec)
    
    mysql> commit;
    Query OK, 0 rows affected (5.93 sec)
    
  6. YANGGMM commented on May 15, 2024

    @YANGGMM
    Contributor

    恢复一个带主键的表insert 30w条只用1.93sec,但是insert300w行的分区表时间太慢了

    mysql> begin;
    Query OK, 0 rows affected (0.00 sec)
    
    mysql> drop table if exists `bmsql_history`;
    Query OK, 0 rows affected (0.01 sec)
    
    mysql> use tpcc;
    Database changed
    mysql> 
    mysql> create table `bmsql_history` (`hist_id` INT NOT NULL AUTO_INCREMENT,`h_c_id` INT DEFAULT NULL,`h_c_d_id` INT DEFAULT NULL,`h_c_w_id` INT DEFAULT NULL,`h_d_id` INT DEFAULT NULL,`h_w_id` INT DEFAULT NULL,`h_date` TIMESTAMP DEFAULT NULL,`h_amount` DECIMAL(6,2) DEFAULT NULL,`h_data` VARCHAR(24) DEFAULT NULL,PRIMARY KEY (`hist_id`));
    Query OK, 0 rows affected (0.02 sec)
    
    mysql> insert into `tpcc`.`bmsql_history` SELECT * FROM `tpcc`.`bmsql_history` {snapshot = 'sp_01'};
    Query OK, 300000 rows affected (1.93 sec)
    
    mysql> commit;
    Query OK, 0 rows affected (0.48 sec)
  7. YANGGMM commented on May 20, 2024

    @YANGGMM
    Contributor

    still working

  8. Ariznawlll commented on May 23, 2024

    @Ariznawlll
    CollaboratorAuthor

    集群环境
    commit:0a99a7a5fc08c9927172bc34fd5089fe8538e4ea
    系统租户向普通租户恢复数据 9w需要3min+
    image
    详细测试步骤,请联系我

  9. YANGGMM commented on May 28, 2024

    @YANGGMM
    Contributor

    still working

  10. YANGGMM commented on May 29, 2024

    @YANGGMM
    Contributor
    mysql> create snapshot sp01 for account sys;
    Query OK, 0 rows affected (0.04 sec)

    run tpcc test

    image
    mysql> restore account sys database tpcc_10 table bmsql_new_order from snapshot sp01;
  11. 41 remaining items

  12. jensenojs commented on Jul 29, 2024

    @jensenojs
    Contributor

    跟算子内部的并行化没有开起来有关系, 处理好之后就行了

    image
  13. jensenojs commented on Aug 1, 2024

    @jensenojs
    Contributor

    这个测试sql可以先拿来简单地验证一下, mac上造两亿的数据插进去在大概要花二十来秒, restore的耗时不应该超过这个时间太多

    drop database if exists t;
    create database t;
    use t;
    drop table if exists jensen;
    create table jensen(a int primary key, b int);
    insert into jensen select result, result from generate_series(1, 200000000) g;
    drop snapshot if exists s0;
    create snapshot s0 for account sys;
    drop database t;
    restore account sys database t table jensen from snapshot s0;
  14. jensenojs commented on Aug 19, 2024

    @jensenojs
    Contributor

    @Ariznawlll 辛苦QA有空的时候验证一下

  15. Ariznawlll commented on Aug 22, 2024

    @Ariznawlll
    CollaboratorAuthor

    正在测试76G数据的恢复

  16. Ariznawlll commented on Aug 22, 2024

    @Ariznawlll
    CollaboratorAuthor

    main commit: 80509e6
    job url:https://github.com/matrixorigin/mo-nightly-regression/actions/runs/10505304794/job/29105911058

    74G恢复:
    系统租户恢复系统租户的数据,耗时9min39s;
    image

    系统租户恢复普通租户的数据到新租户,耗时16min19s;
    image

    普通租户恢复普通租户的数据,耗时17min6s
    image

    以上三点恢复成功
    系统租户恢复普通租户到普通租户恢复有bug issue:18237 跟踪

  17. Ariznawlll commented on Aug 23, 2024

    @Ariznawlll
    CollaboratorAuthor

    1.2-dev commit: ff8d9ac
    job url:https://github.com/matrixorigin/mo-nightly-regression/actions/runs/10518970679/job/29145596868

    74G恢复:
    系统租户恢复系统租户的数据,耗时7min11s;
    image

    系统租户恢复普通租户的数据到新租户,13min10s;
    image

    普通租户恢复普通租户的数据,13min57s.
    image

    以上三点恢复成功
    系统租户恢复普通租户到普通租户恢复有bug issue: 18237 跟踪

  18. Ariznawlll commented on Aug 28, 2024

    @Ariznawlll
    CollaboratorAuthor

    还要再加点数据量测试一下

  19. Ariznawlll commented on Aug 30, 2024

    @Ariznawlll
    CollaboratorAuthor

    main commit: c880770
    job url:https://github.com/matrixorigin/mo-nightly-regression/actions/runs/10626274378/job/29457558653

    约110G恢复:
    系统租户恢复系统租户的数据,耗时15min37s
    :
    image

    系统租户恢复普通租户的数据到新租户,耗时21min16s:
    image

    普通租户恢复普通租户的数据,耗时23min31s
    image

    系统租户恢复普通租户的数据到普通租户,耗时16min5s
    image

    以上四点均恢复成功

  20. Ariznawlll commented on Aug 30, 2024

    @Ariznawlll
    CollaboratorAuthor

    1.2-dev commit: 3b003ad
    job url:https://github.com/matrixorigin/mo-nightly-regression/actions/runs/10627910181/job/29462569576

    约110G恢复:
    系统租户恢复系统租户的数据,耗时13min5s
    :
    image

    系统租户恢复普通租户的数据到新租户,耗时19min11s:
    image

    普通租户恢复普通租户的数据,耗时17min48s
    image

    系统租户恢复普通租户的数据到普通租户,耗时13min51s
    image

    以上四点均恢复成功

  21. Ariznawlll commented on Sep 2, 2024

    @Ariznawlll
    CollaboratorAuthor

    测试110G数据量通过,产品认可恢复速度,先关掉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

kind/bugphase/testingseverity/s0

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions