Zookeeper 如何分析ReplicasMaxAbsoluteDelay为什么返回当前时间问题?

zf9nrax1  于 2022-12-09  发布在  Apache
关注(0)|答案(1)|浏览(116)

Sometimes when the zabbix monitor executes the sql "select value from system.asynchronous_metrics where metric='ReplicasMaxAbsoluteDelay';", it will return a very large value like "52y 9m 18d" (currenttime - 1970).
According to the getAbsoluteDelay() function, we knew when queue_update_finish_time is null, this function will return current_time.
But we want to analyze when and why queue_update_finish_time is null, what can we check from clickhouse system table or log ? We've checked the error log and zookeeper log, but it seems there is no infomation about this problem.
Thanks.

y4ekin9u

y4ekin9u1#

通常,这意味着表不同步,进入只读模式。
导致只读模式的原因可能是:

  • 一些zookeeper同步问题
  • 磁盘存储空间不足
  • 过时的元数据(复制副本无法应用某些更改)
  • ...

要获得更多信息,请查看system.replicas表:

SELECT is_readonly, zookeeper_exception 
FROM system.replicas 
WHERE table = 'appsflyer_events_hist'

在大多数情况下,它有助于运行:

SYSTEM RESTART REPLICA db.table

https://clickhouse.com/docs/en/sql-reference/statements/system/#restart-replica

相关问题