summaryrefslogtreecommitdiff
path: root/src/backend/replication
diff options
context:
space:
mode:
authorAlvaro Herrera2017-08-08 19:37:44 +0000
committerAlvaro Herrera2017-08-08 19:37:44 +0000
commit030273b7ea468ed4b3073dfd1f2ad88e3129df6a (patch)
tree7a1385e2de7253c79a2ee2c454fef34ba7ff8110 /src/backend/replication
parentb4a2eea030ba74ea84335c7d5bc999f693ffd9a4 (diff)
Fix inadequacies in recently added wait events
In commit 9915de6c1cb2, we introduced a new wait point for replication slots and incorrectly labelled it as wait event PG_WAIT_LOCK. That's wrong, so invent an appropriate new wait event instead, and document it properly. While at it, fix numerous other problems in the vicinity: - two different walreceiver wait events were being mixed up in a single wait event (which wasn't documented either); split it out so that they can be distinguished, and document the new events properly. - ParallelBitmapPopulate was documented but didn't exist. - ParallelBitmapScan was not documented (I think this should be called "ParallelBitmapScanInit" instead.) - Logical replication wait events weren't documented - various symbols had been added in dartboard order in various places. Put them in alphabetical order instead, as was originally intended. Discussion: https://postgr.es/m/20170808181131.mu4fjepuh5m75cyq@alvherre.pgsql
Diffstat (limited to 'src/backend/replication')
-rw-r--r--src/backend/replication/libpqwalreceiver/libpqwalreceiver.c4
-rw-r--r--src/backend/replication/slot.c3
2 files changed, 4 insertions, 3 deletions
diff --git a/src/backend/replication/libpqwalreceiver/libpqwalreceiver.c b/src/backend/replication/libpqwalreceiver/libpqwalreceiver.c
index 93dd7b5c176..de03362c91c 100644
--- a/src/backend/replication/libpqwalreceiver/libpqwalreceiver.c
+++ b/src/backend/replication/libpqwalreceiver/libpqwalreceiver.c
@@ -181,7 +181,7 @@ libpqrcv_connect(const char *conninfo, bool logical, const char *appname,
WL_LATCH_SET | io_flag,
PQsocket(conn->streamConn),
0,
- WAIT_EVENT_LIBPQWALRECEIVER);
+ WAIT_EVENT_LIBPQWALRECEIVER_CONNECT);
/* Emergency bailout? */
if (rc & WL_POSTMASTER_DEATH)
@@ -582,7 +582,7 @@ libpqrcv_PQexec(PGconn *streamConn, const char *query)
WL_LATCH_SET,
PQsocket(streamConn),
0,
- WAIT_EVENT_LIBPQWALRECEIVER);
+ WAIT_EVENT_LIBPQWALRECEIVER_RECEIVE);
/* Emergency bailout? */
if (rc & WL_POSTMASTER_DEATH)
diff --git a/src/backend/replication/slot.c b/src/backend/replication/slot.c
index 08c0b1b285f..63e1aaa9102 100644
--- a/src/backend/replication/slot.c
+++ b/src/backend/replication/slot.c
@@ -391,7 +391,8 @@ retry:
name, active_pid)));
/* Wait here until we get signaled, and then restart */
- ConditionVariableSleep(&slot->active_cv, PG_WAIT_LOCK);
+ ConditionVariableSleep(&slot->active_cv,
+ WAIT_EVENT_REPLICATION_SLOT_DROP);
ConditionVariableCancelSleep();
goto retry;
}