问题现象
恢复失败,报错 -4179。
问题原因
之前恢复失败,再次恢复的时候没有修改租户名,在 OceanBase 数据库 V4.x 当前版本中恢复失败后是不会自动删除恢复失败的租户,需要手动删除恢复失败的租户。
问题的风险及影响
执行 SELECT * FROM oceanbase.DBA_OB_ROOTSERVICE_EVENT_HISTORY WHERE module='physical_restore'; 检查恢复失败的报错是什么。
Database changed
MySQL [oceanbase]> SELECT * FROM oceanbase.DBA_OB_ROOTSERVICE_EVENT_HISTORY WHERE module='physical_restore';
+----------------------------+------------------+-----------------------+----------------+--------+-------------+--------------+--------+-------------------------------------------------+-------+--------+-------+--------+-------+--------+------------+-------------+-------------+
| TIMESTAMP | MODULE | EVENT | NAME1 | VALUE1 | NAME2 | VALUE2 | NAME3 | VALUE3 | NAME4 | VALUE4 | NAME5 | VALUE5 | NAME6 | VALUE6 | EXTRA_INFO | RS_SVR_IP | RS_SVR_PORT |
+----------------------------+------------------+-----------------------+----------------+--------+-------------+--------------+--------+-------------------------------------------------+-------+--------+-------+--------+-------+--------+------------+-------------+-------------+
| 2024-07-05 01:28:47.046566 | physical_restore | change_restore_status | job_id | 15 | tenant_name | h_test | status | CREATE_TENANT | | | | | | | | xxx | 2882 |
| 2024-07-05 01:29:51.597429 | physical_restore | change_restore_status | job_id | 15 | tenant | h_test | status | WAIT_TENANT_RESTORE_FINISH | | | | | | | | xxx | 2882 |
| 2024-07-05 01:29:52.741580 | physical_restore | restore_start | ret | -4179 | tenant_name | h_test | | | | | | | | | | xxx | 2882 |
| 2024-07-05 01:30:02.145618 | physical_restore | restore_start | ret | -4179 | tenant_name | h_test | | | | | | | | | | xxx | 2882 |
| 2024-07-05 01:30:37.812417 | physical_restore | change_restore_status | job_id | 15 | tenant | h_test | status | RESTORE_CREATE_INIT_LS | | | | | | | | xxx | 2882 |
| 2024-07-05 01:30:42.110417 | physical_restore | change_restore_status | job_id | 15 | tenant | h_test | status | PHYSICAL_RESTORE_WAIT_RESTORE_TO_CONSISTENT_SCN | | | | | | | | xxx | 2882 |
+----------------------------+------------------+-----------------------+----------------+--------+-------------+--------------+--------+-------------------------------------------------+-------+--------+-------+--------+-------+--------+------------+-------------+-------------+
RS 日志过滤 -4179,看到恢复参数有问题 tenant_name=h_test。
rootservice.log.20240705014212035:[2024-07-05 01:29:52.741211] WDIAG [RS] check_restore_tenant_valid (ob_root_service.cpp:8600) [681105][DDLQueueTh0][T0][xxxxx-xxxxx-xxxxx-xxxxx] [lt=20][errcode=-4179] restore tenant with existed tenant name is not allowed(ret=-4179, ret="OB_OP_NOT_ALLOW", tenant_name=h_test)
rootservice.log.20240705014212035:[2024-07-05 01:29:52.741223] WDIAG check_restore_tenant_valid (ob_root_service.cpp:8601) [681105][DDLQueueTh0][T0][xxxxx-xxxxx-xxxxx-xxxxx] [lt=10][errcode=-4179] restore tenant with existed tenant name is not allowed
影响租户
影响 OceanBase 数据库中的 SYS 租户和 Oracle 租户以及 MySQL 租户。
适用版本
OceanBase 数据库 V4.x 版本。
解决方法
重新恢复,重新指定一个新的租户名,或者检查 __all_tenant,检查之前的租户名是否存在,确认后手动删除恢复失败的租户名。