GBase 8a数据库集群执行报错GBA-02AD-0005 Failed to query in gnode :source table and destination are not same src… dst…

GBase 8a数据库集群,通过主副本机制实现高可用,但在某些特殊情况下,会出现主副本不一致的情况。典型的有配置参数不同,行数不同等。由于数据库无法自动恢复这类错误,一般都只能人工干预。

原因

srt表和dst表的表结构不同,包括字段名字,类型,null ,默认值,压缩类型,索引,字符集等。

触发的原因,多数是因为配置文件不同导致,特别是中间出现过节点意外重启的时候。

在表格大量的rename,且中间加载了event时,也出现过tableId不同的情况。

样例

参数不同

GBA-02AD-0005 Failed to query in gnode :source table and destination are not same src… dst… compress_flag_num:5--1

如上是压缩算法不同,一般是配置文件不一致导致。修改算法后,建议重建此表解决。

table_num (TableId)不同

在表每次都全量更新加载,并且通过多个表循环使用场景
先清空表临时表 truncate table A_TMP ;
加载数据到临时表 LOAD into A_TMP
切换表
rename A to B_TMP
rename A _TMP to A
rename B _TMP to A_TMP

建议不要truncate table来重用表,采用drop ,create方式重建表比较安全。

GBA-02AD-0005 Failed to query in gnode :source table and destination are not same src… dst…  tab_num: 452393 - 452409

如果是数据行数不同,则需要认为判断以哪个为准,并进行手工同步。

GBase 8a集群通过gc_sync_client同步分片数据