Project: ClickHouse (App Definition and Development / Database)
File: replication_queue.md

slug: /en/operations/system-tables/replication_queue Contains information about tasks from replication queues stored in ClickHouse Keeper, or ZooKeeper, for tables in the `ReplicatedMergeTree` family. Columns: `database` () Name of the database. `table` () Name of the table. `replica_name` () Replica name in ClickHouse Keeper. Different replicas of the same table have different names. `position` () Position of the task in the queue. `node_name` () Node name in ClickHouse Keeper. `type` () Type of the task in the queue, one of: `GET_PART` Get the part from another replica. `ATTACHPART` Attach the part, possibly from our own replica (if found in the `detached` folder). You may think of it as a `GETPART` with some optimizations as they're nearly identical. `MERGE_PARTS` Merge the parts. `DROP_RANGE` Delete the parts in the specified partition in the specified number range. `CLEAR_COLUMN` NOTE: Deprecated. Drop specific column from specified partition. `CLEAR_INDEX` NOTE: Deprecated. Drop specific index from specified partition. `REPLACE_RANGE` Drop a certain range of parts and replace them with new ones. `MUTATE_PART` Apply one or several mutations to the part. `ALTER_METADATA` Apply alter modification according to global /metadata and /columns paths. `create_time` () Date and time when the task was submitted for execution. `requiredquorum` () The number of replicas waiting for the task to complete with confirmation of completion. This column is only relevant for the `GETPARTS` task. `source_replica` () Name of the source replica. `newpartname` () Name of the new part. `partstomerge` ( ()) Names of parts to merge or update. `isdetach` () The flag indicates whether the `DETACHPARTS` task is in the queue. `iscurrentlyexecuting` () The flag indicates whether a specific task is being performed right now. `num_tries` () The number of failed attempts to complete the task. `last_exception` () Text message about the last error that occurred (if any). `lastattempttime` () Date and time when the task was last attempted. `num_postponed` () The number of times the action was postponed. `postpone_reason` () The reason why the task was postponed. `lastpostponetime` () Date and time when the task was last postponed. `merge_type` () Type of the current merge. Empty if it's a mutation. Example ``` sql SELECT * FROM system.replication_queue LIMIT 1 FORMAT Vertical; ``` ``` text Row 1: database: merge table: visits_v2 replica_name: mtgiga001-1t position: 15 node_name: queue-0009325559 type: MERGE_PARTS create_time: 2020-12-07 14:04:21 required_quorum: 0 source_replica: mtgiga001-1t newpartname: 20201130121373121384_2 partstomerge: ['202011301213731213781','202011301213791213790','202011301213801213800','202011301213811213810','202011301213821213820','202011301213831213830','20201130121384121384_0'] is_detach: 0 iscurrentlyexecuting: 0 num_tries: 36 lastexception: Code: 226, e.displayText() = DB::Exception: Marks file '/opt/clickhouse/data/merge/visitsv2/tmpfetch20201130121373121384_2/CounterID.mrk' does not exist (version 20.8.7.15 (official build)) lastattempttime: 2020-12-08 17:35:54 num_postponed: 0 postpone_reason: lastpostponetime: 1970-01-01 03:00:00 ``` See Also