diff options
author | Peter Eisentraut <peter_e@gmx.net> | 2017-05-08 12:07:59 -0400 |
---|---|---|
committer | Peter Eisentraut <peter_e@gmx.net> | 2017-05-08 12:10:22 -0400 |
commit | 9a591c1bccc5edeb06b979c59f39753982131181 (patch) | |
tree | ff6efe9bfa8642c3ba23ce5237a6362e30a90f68 /src/backend/replication/logical/worker.c | |
parent | b6576e5914d042bfad1c8629fe199f59b036c342 (diff) | |
download | postgresql-9a591c1bccc5edeb06b979c59f39753982131181.tar.gz postgresql-9a591c1bccc5edeb06b979c59f39753982131181.zip |
Fix statistics reporting in logical replication workers
This new arrangement ensures that statistics are reported right after
commit of transactions. The previous arrangement didn't get this quite
right and could lead to assertion failures.
Author: Petr Jelinek <petr.jelinek@2ndquadrant.com>
Reported-by: Erik Rijkers <er@xs4all.nl>
Diffstat (limited to 'src/backend/replication/logical/worker.c')
-rw-r--r-- | src/backend/replication/logical/worker.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/backend/replication/logical/worker.c b/src/backend/replication/logical/worker.c index 2d7770d4dc1..a61240ceee7 100644 --- a/src/backend/replication/logical/worker.c +++ b/src/backend/replication/logical/worker.c @@ -453,6 +453,7 @@ apply_handle_commit(StringInfo s) replorigin_session_origin_timestamp = commit_data.committime; CommitTransactionCommand(); + pgstat_report_stat(false); store_flush_position(commit_data.end_lsn); } @@ -462,7 +463,6 @@ 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); } |