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.
New in v24.3:
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
:
- The
admin
role. - The
VIEWJOB
system privilege, which can view all jobs (includingadmin
-owned jobs).
Use the GRANT SYSTEM
statement:
GRANT SYSTEM VIEWJOB TO user;
Synopsis
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:
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:
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