V2.1.31 版本操作

当 OceanBase 升级到 V2.1.31 版本后,若要继续升级,需要您登录到 OceanBase 中执行渐进合并,操作步骤如下:

  1. 执行以下 SQL,准备执行渐进合并:

    1. SET ob_query_timeout = 100000000000;
    2. ALTER system SET enable_sys_table_ddl = TRUE;
  2. 配置希望进行的渐进合并轮次:

    1. ALTER TENANT all SET progressive_merge_num = num;

    注意

    渐进轮次 num 必须大于 1。

  3. 清空所有租户的回收站:

    1. PURGE RECYCLEBIN;
  4. 设置每个租户的 rewrite_merge_version 为下次合并的版本号,其中 ver 表示下次合并的版本号:

    1. ALTER tenant xxx SET rewrite_merge_version = ver;
  5. 根据渐进合并的轮次,发起相应次数的合并:

    1. ALTER SYSTEM MAJOR FREEZE;
  6. 在合并完全结束后,通过下面的SQL检查是否满足升级到 V2.2.1 的条件,如果以下 SQL 的返回值都为空,则说明可满足升级条件:

    1. SELECT * FROM __all_table WHERE table_id IN (SELECT index_id FROM __all_sstable_column_checksum WHERE checksum_method = 1 AND major_version = (SELECT value FROM __all_zone WHERE name = 'last_merged_version' AND zone = '')) LIMIT 1;
    2. SELECT column_value FROM __all_core_table WHERE table_name = '__all_table' AND column_name = 'table_id' AND column_value in (SELECT index_id FROM __all_sstable_column_checksum WHERE checksum_method = 1 AND major_version = (SELECT value FROM __all_zone WHERE name = 'last_merged_version' AND zone = '')) LIMIT 1;
    3. SELECT index_id FROM __all_sstable_column_checksum WHERE checksum_method = 1 AND index_id = 1099511627777 AND major_version = (SELECT value FROM __all_zone WHERE name = 'last_merged_version' AND zone = '') LIMIT 1;
    4. SELECT DISTINCT index_id FROM (SELECT index_id, index_id & ((1 << 40) - 1) AS real_id FROM __all_sstable_column_checksum WHERE checksum_method = 1 AND major_version = (SELECT value FROM __all_zone WHERE name = 'last_merged_version' AND zone = '')) WHERE real_id < 10000 LIMIT 1;

    注意

    检查必须要在集群不合并的时候进行,否则检查结果可能不准确。

  7. 回滚所有表的渐进轮次:

    1. ALTER TENANT ALL SET progressive_merge_num = 0;
  8. 回滚 sys table 执行ddl权限:

    1. ALTER SYSTEM SET enable_sys_table_ddl = false;

V2.2.1 版本操作

当 OceanBase 升级到 V2.2.1版本后,若要继续升级,需要您登录到 OceanBase 中,手动触发一轮合并转储

  1. ALTER SYSTEM MINOR FREEZE;
  2. ALTER SYSTEM MAJOR FREEZE;