2020-12-08 18:46:25 +00:00
# system.replication_queue {#system_tables-replication_queue}
2020-12-13 15:42:34 +00:00
Contains information about tasks from replication queues stored in ZooKeeper for tables in the `ReplicatedMergeTree` family.
2020-12-08 18:46:25 +00:00
Columns:
- `database` ([String](../../sql-reference/data-types/string.md)) — Name of the database.
- `table` ([String](../../sql-reference/data-types/string.md)) — Name of the table.
- `replica_name` ([String](../../sql-reference/data-types/string.md)) — Replica name in ZooKeeper. Different replicas of the same table have different names.
2020-12-13 15:42:34 +00:00
- `position` ([UInt32](../../sql-reference/data-types/int-uint.md)) — Position of the task in the queue.
2020-12-08 18:46:25 +00:00
2020-12-08 20:25:45 +00:00
- `node_name` ([String](../../sql-reference/data-types/string.md)) — Node name in ZooKeeper.
2020-12-08 18:46:25 +00:00
2021-03-16 21:59:12 +00:00
- `type` ([String](../../sql-reference/data-types/string.md)) — Type of the task in the queue, one of:
2021-04-19 18:01:38 +00:00
- `GET_PART` — Get the part from another replica.
- `ATTACH_PART` — Attach the part, possibly from our own replica (if found in the `detached` folder). You may think of it as a `GET_PART` 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.
2021-04-21 16:30:04 +00:00
- `REPLACE_RANGE` — Drop a certain range of parts and replace them with new ones.
2021-04-19 18:01:38 +00:00
- `MUTATE_PART` — Apply one or several mutations to the part.
- `ALTER_METADATA` — Apply alter modification according to global /metadata and /columns paths.
2020-12-08 18:46:25 +00:00
- `create_time` ([Datetime](../../sql-reference/data-types/datetime.md)) — Date and time when the task was submitted for execution.
2020-12-13 15:42:34 +00:00
- `required_quorum` ([UInt32](../../sql-reference/data-types/int-uint.md)) — The number of replicas waiting for the task to complete with confirmation of completion. This column is only relevant for the `GET_PARTS` task.
2020-12-08 18:46:25 +00:00
2020-12-13 15:42:34 +00:00
- `source_replica` ([String](../../sql-reference/data-types/string.md)) — Name of the source replica.
2020-12-08 18:46:25 +00:00
2020-12-13 15:42:34 +00:00
- `new_part_name` ([String](../../sql-reference/data-types/string.md)) — Name of the new part.
2020-12-08 18:46:25 +00:00
- `parts_to_merge` ([Array](../../sql-reference/data-types/array.md) ([String](../../sql-reference/data-types/string.md))) — Names of parts to merge or update.
2020-12-13 15:42:34 +00:00
- `is_detach` ([UInt8](../../sql-reference/data-types/int-uint.md)) — The flag indicates whether the `DETACH_PARTS` task is in the queue.
2020-12-08 18:46:25 +00:00
2020-12-13 15:42:34 +00:00
- `is_currently_executing` ([UInt8](../../sql-reference/data-types/int-uint.md)) — The flag indicates whether a specific task is being performed right now.
2020-12-08 18:46:25 +00:00
2020-12-13 15:42:34 +00:00
- `num_tries` ([UInt32](../../sql-reference/data-types/int-uint.md)) — The number of failed attempts to complete the task.
2020-12-08 18:46:25 +00:00
2020-12-13 15:42:34 +00:00
- `last_exception` ([String](../../sql-reference/data-types/string.md)) — Text message about the last error that occurred (if any).
2020-12-08 18:46:25 +00:00
- `last_attempt_time` ([Datetime](../../sql-reference/data-types/datetime.md)) — Date and time when the task was last attempted.
2020-12-13 15:42:34 +00:00
- `num_postponed` ([UInt32](../../sql-reference/data-types/int-uint.md)) — The number of postponed tasks.
2020-12-08 18:46:25 +00:00
2020-12-13 15:42:34 +00:00
- `postpone_reason` ([String](../../sql-reference/data-types/string.md)) — The reason why the task was postponed.
2020-12-08 18:46:25 +00:00
- `last_postpone_time` ([Datetime](../../sql-reference/data-types/datetime.md)) — Date and time when the task was last postponed.
2020-12-13 15:42:34 +00:00
- `merge_type` ([String](../../sql-reference/data-types/string.md)) — Type of the current merge. Empty if it's a mutation.
2020-12-08 18:46:25 +00:00
**Example**
``` sql
SELECT * FROM system.replication_queue LIMIT 1 FORMAT Vertical;
```
``` text
Row 1:
──────
database: merge
table: visits_v2
replica_name: mtgiga001-1t.metrika.yandex.net
position: 15
node_name: queue-0009325559
type: MERGE_PARTS
create_time: 2020-12-07 14:04:21
required_quorum: 0
source_replica: mtgiga001-1t.metrika.yandex.net
new_part_name: 20201130_121373_121384_2
parts_to_merge: ['20201130_121373_121378_1','20201130_121379_121379_0','20201130_121380_121380_0','20201130_121381_121381_0','20201130_121382_121382_0','20201130_121383_121383_0','20201130_121384_121384_0']
is_detach: 0
is_currently_executing: 0
num_tries: 36
2021-05-27 19:44:11 +00:00
last_exception: Code: 226, e.displayText() = DB::Exception: Marks file '/opt/clickhouse/data/merge/visits_v2/tmp_fetch_20201130_121373_121384_2/CounterID.mrk' does not exist (version 20.8.7.15 (official build))
2020-12-08 18:46:25 +00:00
last_attempt_time: 2020-12-08 17:35:54
num_postponed: 0
2021-03-14 12:29:23 +00:00
postpone_reason:
2020-12-08 18:46:25 +00:00
last_postpone_time: 1970-01-01 03:00:00
```
**See Also**
2021-03-14 12:29:23 +00:00
- [Managing ReplicatedMergeTree Tables ](../../sql-reference/statements/system.md#query-language-system-replicated )
2020-12-08 18:46:25 +00:00
2021-09-19 20:05:54 +00:00
[Original article ](https://clickhouse.com/docs/en/operations/system_tables/replication_queue ) <!--hide-->