Autodesk / pgbelt

Pgbelt is a CLI tool used to manage Postgres data migrations from beginning to end, for a single database or a fleet, leveraging pglogical replication.
Apache License 2.0
18 stars 5 forks source link

[Enhanced Monitoring] pglogical.show_subscription_table #176

Open vjeeva opened 1 year ago

vjeeva commented 1 year ago

Is your feature request related to a problem? Please describe. It would be nice to extract all the table sync info from pglogical when running replication, to see if table copies have finished, replication level, etc. Seems pglogical.show_subscription_table is the command to run.

Describe the solution you'd like An extra view with all tables in the subscription listed, along with their sync status and level.

Describe alternatives you've considered N/A, we have no insight into this right now.

Additional context DMS shows this on a per-table level too. We need this!

vjeeva commented 1 year ago
database=> SELECT pglogical.show_subscription_table('pg1_pg2', 'some_table');
            show_subscription_table
-----------------------------------------------
 (public,some_table,replicating)
vjeeva commented 1 year ago

During the initializing COPY phase, we see unknown above. We should also track table sizes in the destination against the source, and also have a column for that table replication status (unknown == initial copy it seems).

vjeeva commented 1 year ago

Note that this command must be run on the destination database.