SHOW LOGICAL REPLICATION JOBS

On this page Carat arrow pointing down
Note:

This feature is in preview. This feature is subject to change. To share feedback and/or issues, contact Support.

Logical data replication is only supported in CockroachDB self-hosted clusters.

The SHOW LOGICAL REPLICATION JOBS statement shows details of logical data replication (LDR) jobs on a cluster.

This page is a reference for the SHOW LOGICAL REPLICATION JOBS SQL statement, which includes information on its parameters and possible options. For more details on monitoring LDR, refer to the Monitor Logical Data Replication page.

Required privileges

You must have one of the following to run SHOW LOGICAL REPLICATION JOBS:

Use the GRANT SYSTEM statement:

icon/buttons/copy
GRANT SYSTEM VIEWJOB TO user;

Synopsis

SHOW LOGICAL REPLICATION JOBS WITH show_logical_replication_jobs_options

Parameters

Parameter Description
show_logical_replication_jobs_options Option to modify the output.

Options

Option Description
details Includes the additional columns: replication_start_time, conflict_resolution_type, description.

Responses

Field Response
job_id The job's ID. Use with CANCEL JOB, PAUSE JOB, RESUME JOB, SHOW JOB.
status The job's current state. Possible values: pending, paused, pause-requested, failed, succeeded, canceled, cancel-requested, running, retry-running, retry-reverting, reverting, revert-failed.

Refer to Jobs status for a description of each status.
targets The fully qualified name of the table(s) that are part of the LDR job.
replicated_time The latest timestamp at which the destination cluster has consistent data. This time advances automatically as long as the LDR job proceeds without error. replicated_time is updated periodically (every 30s).
replication_start_time The start time of the LDR job.
conflict_resolution_type The type of conflict resolution: LWW last write wins.
description Description of the job including the replicating table(s) and the source cluster connection.

Example

In the destination cluster's SQL shell, you can query SHOW LOGICAL REPLICATION JOBS to view the LDR jobs running on the cluster:

icon/buttons/copy
SHOW LOGICAL REPLICATION JOBS;
        job_id        | status  |          targets          | replicated_time
----------------------+---------+---------------------------+------------------
1012877040439033857   | running | {database.public.table}   | NULL
(1 row)

For additional detail on each LDR job, use the WITH details option:

icon/buttons/copy
SHOW LOGICAL REPLICATION JOBS WITH details;
        job_id        |  status  |            targets             |        replicated_time        |    replication_start_time     | conflict_resolution_type |                                      description
----------------------+----------+--------------------------------+-------------------------------+-------------------------------+--------------------------+-----------------------------------------------------------------------------------------
  1010959260799270913 | running  | {movr.public.promo_codes}      | 2024-10-24 17:50:05+00        | 2024-10-10 20:04:42.196982+00 | LWW                      | LOGICAL REPLICATION STREAM into movr.public.promo_codes from external://cluster_a
  1014047902397333505 | canceled | {defaultdb.public.office_dogs} | 2024-10-24 17:30:25+00        | 2024-10-21 17:54:20.797643+00 | LWW                      | LOGICAL REPLICATION STREAM into defaultdb.public.office_dogs from external://cluster_a

See also


Yes No
On this page

Yes No