altinity-expert-clickhouse-replication
БесплатноБез исполняемых скриптовНе проверенDiagnose ClickHouse replication health, Keeper connectivity, read-only replicas, replica lag, replication queue backlog and slow fetches. Use for replication…
от Altinity★ 18 звёзд на GitHubОб этом скилле
Replication and Keeper health
Answers "are the replicas connected, in sync, and draining their queues?" from system.zookeeper_connection, system.replicas, system.replication_queue, system.replicated_fetches, system.events and system.text_log.
Run altinity-expert-clickhouse-connection first if the connection mode, cluster and time window are not yet established.
Query packs
triage.sql— 2 checks: Keeper/ZooKeeper session status per host (replication-triage-01,@requires keeper), and the graded replication overview fromsystem.replicas(replication-triage-02). Start here.queue.sql— 2 checks: graded queue size per table and host (replication-queue-01), and the individual queue tasks carrying an exception or a postpone reason (replication-queue-02).fetches.sql— 2 checks: fetches in flight with elapsed time and progress (replication-fetches-01), and recentDownloadPartactivity (replication-fetches-02, needssystem.part_log).keeper.sql— 2 checks: average Keeper round-trip latency per host derived fromZooKeeperWaitMicrosecondsoverZooKeeperTransactions(replication-keeper-01), and Keeper errors and warnings from the last 24 hours (replication-keeper-02, needssystem.text_log).
How to run the query packs
- Read each pack file from this skill's directory (the skill loader prints the directory path).
- Run statements one at a time, never a whole file. Statements end with
;and start with a-- @check <id> <title>header; keep the id with its result. - Honor
-- @requires: skip the statement when the named table is missing, whenkeeperis required and the server has no Keeper/ZooKeeper, or when the version condition is not met. List skipped ids with the reason. - Keep
{cluster}as written when a cluster macro exists; otherwise apply the connection skill's rewrite rule. Any other{placeholder}is a template variable: substitute a real value first or skip the statement. - On an error, record the check id and the first line of the error, then continue. Only for
UNKNOWN_IDENTIFIER, runDESCRIBE TABLE system.<table>and drop the missing column. - A
severitycolumn is the verdict for that row. Copy it; do not re-grade.
Interpretation rules
- When the connection skill reported
has_keeper = 0, this whole skill is not applicable. Say so and stop: without Keeper there are no replicated tables to diagnose. is_readonly = 1oris_session_expired = 1is Critical. The replica has lost its Keeper session and accepts no writes. Check Keeper connectivity first, then free disk space, then the server log.active_replicas < total_replicasmeans replicas are registered in Keeper but not alive. Name which hosts are missing and look for restarts, network partitions or a stopped server.- Lag grading comes from the SQL:
absolute_delayabove 300 seconds orqueue_sizeabove 200 is Moderate; above 3600 seconds or above 1000 entries it is Major. Quote both numbers together, since a large queue with no delay means the replica is catching up and a large delay with an empty queue means it is not receiving work. - Queue entries with a non-empty
last_exceptionorpostpone_reasonidentify the stuck table and the task type. Readtypeto route:GET_PARTpoints at fetches,MERGE_PARTSat merges,MUTATE_PARTat mutations. - A high
num_triesornum_postponedwith a recentlast_exception_timemeans the task is still retrying. The same values with an old exception time mean it already recovered. - Many long-running fetches, or repeated
DownloadParterrors in the part log, are themselves a cause of lag rather than a symptom. Check network throughput and the source replica before touching replication settings. - A rising
avg_latency_usin replication-keeper-01 correlates with lag and with read-only replicas. Treat slow Keeper as the root cause when latency is high on every host at once, and as a local problem when only one host is slow. - Keeper latency is computed from cumulative counters since server start, so compare hosts against each other rather than against an absolute threshold.
Report format
- Header: connection mode, cluster or "single node", ClickHouse version, time window.
- Findings: table with columns
check,severity,object,evidence,recommendation; one row per finding, Critical first. Evidence quotes the numbers from the result rows. - OK checks: one line listing the check ids that returned no problem rows.
- Skipped and failed checks: id and reason or first error line. Never omit this section.
- Next steps: skills to load next and immediate actions.
Next skills
part_mutations_in_queueis high, or queue tasks fail withMUTATE_PARTerrors → load skillaltinity-expert-clickhouse-mutationsmerges_in_queueis high, or queue tasks fail withMERGE_PARTSerrors → load skillaltinity-expert-clickhouse-merges- Heavy
DownloadPartchurn or repeated fetch failures
Установить altinity-expert-clickhouse-replication в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
FAQ
Что делает скилл altinity-expert-clickhouse-replication?
Diagnose ClickHouse replication health, Keeper connectivity, read-only replicas, replica lag, replication queue backlog and slow fetches. Use for replication lag, read-only replica problems, growing replication queues, failed fetches, or Keeper/ZooKeeper session and latency errors.
Как установить скилл altinity-expert-clickhouse-replication?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл altinity-expert-clickhouse-replication запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
theme-factory
Toolkit for styling artifacts with a theme. These artifacts can be slides, docs, reportings, HTML landing pages, etc. There are 10 pre-set themes with…
от Anthropicaccess
Manage Discord channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed…
от Anthropicconfigure
Set up the Discord channel — save the bot token and review access policy. Use when the user pastes a Discord bot token, asks to configure Discord, asks "how…
от Anthropicaccess
Manage iMessage channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed…
от Anthropic