Перейти к основному содержимому
Перейти к основному содержимому

system.keeper_changelogs

Querying in ClickHouse Cloud

The data in this system table is held locally on each node in ClickHouse Cloud. Obtaining a complete view of all data, therefore, requires the clusterAllReplicas function. See here for further details.

Description

This table does not exist if this node is not configured to run an in-process ClickHouse Keeper. It contains one row per Raft changelog file (changelog_<from>_<to>.bin[.zstd]) tracked by the in-process Keeper log store, including the active file currently being appended to.

Columns

  • from_log_index (UInt64) — First Raft log index in the file (inclusive).
  • to_log_index (UInt64) — Last Raft log index covered by the filename (inclusive). For the active file this is the rotation target and may be ahead of last_entry_index.
  • last_entry_index (Nullable(UInt64)) — Highest log index actually appended to this file. NULL if the active file has not received any entries yet or the file is broken.
  • entries (UInt64) — Number of entries appended to this file. ALIAS for ifNull(last_entry_index - from_log_index + 1, 0).
  • path (String) — File path on the disk.
  • disk_name (String) — Name of the disk holding the file.
  • size_bytes (UInt64) — Size of the file on disk.
  • modification_time (DateTime) — Last modification time of the file.
  • is_compressed (Bool) — File payload is zstd-compressed.
  • active (Bool) — This file is currently being appended to.
  • is_broken (Bool) — Trailing record was found corrupted at startup.

Example:

SELECT from_log_index, to_log_index, entries, path, active FROM system.keeper_changelogs ORDER BY from_log_index;
┌─from_log_index─┬─to_log_index─┬─entries─┬─path───────────────────────────┬─active─┐
│              1 │         1000 │    1000 │ changelog_1_1000.bin.zstd      │ false  │
│           1001 │         2000 │     537 │ changelog_1001_2000.bin.zstd   │ true   │
└────────────────┴──────────────┴─────────┴────────────────────────────────┴────────┘