aboutsummaryrefslogtreecommitdiff
path: root/src/backend/replication/logical
diff options
context:
space:
mode:
Diffstat (limited to 'src/backend/replication/logical')
-rw-r--r--src/backend/replication/logical/tablesync.c8
-rw-r--r--src/backend/replication/logical/worker.c1
2 files changed, 8 insertions, 1 deletions
diff --git a/src/backend/replication/logical/tablesync.c b/src/backend/replication/logical/tablesync.c
index bf276410099..d287e95df1d 100644
--- a/src/backend/replication/logical/tablesync.c
+++ b/src/backend/replication/logical/tablesync.c
@@ -114,9 +114,15 @@ StringInfo copybuf = NULL;
static void pg_attribute_noreturn()
finish_sync_worker(void)
{
- /* Commit any outstanding transaction. */
+ /*
+ * Commit any outstanding transaction. This is the usual case, unless
+ * there was nothing to do for the table.
+ */
if (IsTransactionState())
+ {
CommitTransactionCommand();
+ pgstat_report_stat(false);
+ }
/* And flush all writes. */
XLogFlush(GetXLogWriteRecPtr());
diff --git a/src/backend/replication/logical/worker.c b/src/backend/replication/logical/worker.c
index 29b6c6a1689..656d3999796 100644
--- a/src/backend/replication/logical/worker.c
+++ b/src/backend/replication/logical/worker.c
@@ -462,6 +462,7 @@ apply_handle_commit(StringInfo s)
/* Process any tables that are being synchronized in parallel. */
process_syncing_tables(commit_data.end_lsn);
+ pgstat_report_stat(false);
pgstat_report_activity(STATE_IDLE, NULL);
}