首批通过分布式安全可靠测评,为关键业务系统打造
合并报错,日志有 obj1 and obj2 can't compare 的错误
更新时间:2026-06-15 09:16
适用版本
OceanBase 数据库 V3.x 版本。
问题描述
OceanBase 数据库合并异常,observer.log 中有以下日志信息。
[2023-08-07 10:30:34.150054] WARN [COMMON] compare (ob_obj_compare.cpp:3500) [2310751][0][YB420xxxxxxx-000600xxxxxxxxxx-0-0] [lt=12] [dc=0] obj1 and obj2 can't compare(obj1={"VARCHAR":"9a58fd6331acxxxxxxxxxxxxxxxxxxxx", collation:"utf8mb4_bin", coercibility:"IMPLICIT"}, obj2={"VARCHAR":"9a58fd6331acxxxxxxxxxxxxxxxxxxxx", collation:"utf8mb4_general_ci", coercibility:"IMPLICIT"}, obj1.get_meta()={type:"VARCHAR", collation:"utf8mb4_bin", coercibility:"IMPLICIT"}, obj2.get_meta()={type:"VARCHAR", collation:"utf8mb4_general_ci", coercibility:"IMPLICIT"})
问题原因
具体原因未知。但根据日志信息,是合并时的多个版本的数据的 collation 不一致,如以下日志所示。
obj1={"VARCHAR":"9a58fd6331acxxxxxxxxxxxxxxxxxxxx", collation:"utf8mb4_bin", coercibility:"IMPLICIT"}, obj2={"VARCHAR":"9a58fd6331acxxxxxxxxxxxxxxxxxxxx", collation:"utf8mb4_general_ci", coercibility:"IMPLICIT"}, obj1.get_meta()={type:"VARCHAR", collation:"utf8mb4_bin", coercibility:"IMPLICIT"}, obj2.get_meta()={type:"VARCHAR", collation:"utf8mb4_general_ci"
解决方法
需要重建副本,方式如下:
- 通过逻辑备份方式,备份异常副本数据。
- 删除异常副本。
- 重建异常副本 Schema,重新导入备份数据。