ZooKeeper schema

ZooKeeper schema


Table schema.

date column -> legacy MergeTree partition expression.
sampling expression -> SAMPLE BY
index granularity -> index_granularity
mode -> type of MergeTree table
sign column -> sign - CollapsingMergeTree / VersionedCollapsingMergeTree
primary key -> ORDER BY key if PRIMARY KEY not defined.
sorting key -> ORDER BY key if PRIMARY KEY defined.
data format version -> 1
partition key -> PARTITION BY
granularity bytes -> index_granularity_bytes

types of MergeTree tables:
Ordinary            = 0
Collapsing          = 1
Summing             = 2
Aggregating         = 3
Replacing           = 5
Graphite            = 6
VersionedCollapsing = 7


Log of latest mutations


List of columns for latest (reference) table version. Replicas would try to reach this state.


Log of latest actions with table. Used mostly for debug purposes. Related settings:

 max_replicated_logs_to_keep  1000         0  How many records may be in log, if there is inactive replica. Inactive replica becomes lost when when this number exceed.                                                   UInt64 
 min_replicated_logs_to_keep  10           0  Keep about this number of last records in ZooKeeper log, even if they are obsolete. It doesn't affect work of tables: used only to diagnose ZooKeeper log before cleaning. │ UInt64 │


List of table replicas.



Pointer to the latest mutation executed by replica


Pointer to the latest task from replication_queue executed by replica



Table schema of specific replica


Columns list of specific replica.


Used for quorum inserts.