本文为您介绍 TDSQL-H LibraDB 的常见的错误码及处理方法。
错误码 | 错误码说明 | 错误码示例 | 分析与处理方法 |
16 | 查不到表字段 | code: 16, message: No such column subject_type in table express_order_merge_snapshot | 问题分析: 该报错主要原因为对应的 CDC 任务创建时间较早尚不支持 DDL 同步。 处理方法: |
44 | 修改列名或数据类型问题 | Code: 44. DB::Exception: Received from xx.xx.xx.xx:xxx. DB::Exception: Trying to ALTER key column name. | 问题分析: LibraSQL 分析引擎不支持修改表的主键或分区键字段的数据类型。 处理方法: 不修改主键或者分区键字段的数据类型。 |
122 | Zookeeper 中的表列结构与本地表结构不同 | Code: 122, e.displayText() = DB::Exception:Table columns structure in Zookeeper is different from local table structure | 问题分析: 创建表前删除同名表时未添加 on cluster ,仅删除某一个实例的本地表,其他实例的本地表还有残留,导致元数据信息不一致。处理方法: 添加 on cluster 再次删除同名表后再次创建表。 |
159 | DDL 语句执行超时 | Code: 159. DB::Exception: Received from localhost:9000. DB::Exception: Watching task xxx is executing longer than distributed_ddl_task_timeout (=180) seconds. There are 1 unfinished hosts (0 of them are currently active), they are going to execute the query in background. | 问题分析: DDL 语句在某个集群节点中执行失败。 处理方法: 将 DDL 执行的超时时间参数 distributed_ddl_task_timeout 调大。继续等待直至 DDL 执行完成。通过系统表可查看 DDL 是否执行完成,示例如下: select * from system.zookeeper where path = '/clickhouse/task_queue/ddl/query-0000027115/finish' |
210 | 连接被拒绝 | Code: 210 DB:NetException: Connection refused | 问题分析: 集群负载过重,导致无可用连接。 处理方法: 请稍后重试。 |
225 | Zookeeper 会话已过期 | code: 225, message: Zookeeper session has been expired. | 问题分析: XID 溢出导致 LibraSQL 强制让 Zookeeper 会话过期。 处理方法: 请稍后重试。 |
241 | 超出内存限制 | Code: 241. DB::Exception: Received from localhost:xxx. DB::Exception: Memory limit (for query) exceeded | 问题分析: SQL 使用的内存过大。 处理方法: 进行 SQL 调优或者升级实例配置。 |
242 | 表为只读模式 | Code 242. DB::Exception: Received from localhost:xxx. DB::Exception: Table is in readonly mode (Zookeeper path: /xxx) | 问题分析: Zookeeper 压力过大,导致表处于只读模式。 处理方法: 请稍后重试。 |
253 | 副本已存在 | code: 253, Replica /xxx/tables/2/t1/replicas/xx.xx.xx.xx already exists. | 问题分析: DDL 清理任务是异步的。当执行 Drop 语句时,Zookeeper上的元数据没有清除,导致再创建相同的表使用相同的 Zookeeper 路径报错。处理方法: 调整 database_atomic_wait_for_drop_and_detach_synchronously 配置参数,将异步删除任务修改成同步删除任务。 |
359 | 表或分区未删除 | Code: 359, Table or Partition in xxx was not dropped | 问题分析: LibraSQL 对删除数据提供保护。默认最大删除50 GB的数据。 处理方法: |
420 | 不允许更新键列 | Code: 420. DB::Exception: Received from xx.xx.xx.xx:xxx.DB::Exception:Cannot UPDATE key column xxx | 问题分析: 不支持更新主键或分区键。 处理方法: 不更新主键或分区键。 |
517 | 副本上的元数据未与 Zookeeper 中的通用元数据保持同步 | Code: 517, e.displayText() = DB::Exception: Metadata on replica is not up to date with common metadata in Zookeeper. Cannot alter ...... | 问题分析: LibraSQL DDL 处理机制是异步的。各个副本之间的元数据没有一致的情况下,进行 DDL 会报错。 处理方法: 将系统参数修改为 replication_alter_partitions_sync = 2 。 |