diff options
author | Peter Eisentraut <peter@eisentraut.org> | 2020-03-11 16:36:40 +0100 |
---|---|---|
committer | Peter Eisentraut <peter@eisentraut.org> | 2020-03-11 16:38:31 +0100 |
commit | bf68b79e50e3359accc85c94fa23cc03abb9350a (patch) | |
tree | 0b09b97eec0aa5978ab073e580cf97a51014dd66 /src/backend/replication/walreceiver.c | |
parent | 899a04f5ed61c3db7a2bd84957ecf530c09fd05a (diff) | |
download | postgresql-bf68b79e50e3359accc85c94fa23cc03abb9350a.tar.gz postgresql-bf68b79e50e3359accc85c94fa23cc03abb9350a.zip |
Refactor ps_status.c API
The init_ps_display() arguments were mostly lies by now, so to match
typical usage, just use one argument and let the caller assemble it
from multiple sources if necessary. The only user of the additional
arguments is BackendInitialize(), which was already doing string
assembly on the caller side anyway.
Remove the second argument of set_ps_display() ("force") and just
handle that in init_ps_display() internally.
BackendInitialize() also used to set the initial status as
"authentication", but that was very far from where authentication
actually happened. So now it's set to "initializing" and then
"authentication" just before the actual call to
ClientAuthentication().
Reviewed-by: Julien Rouhaud <rjuju123@gmail.com>
Reviewed-by: Kuntal Ghosh <kuntalghosh.2007@gmail.com>
Reviewed-by: Alvaro Herrera <alvherre@2ndquadrant.com>
Discussion: https://www.postgresql.org/message-id/flat/c65e5196-4f04-4ead-9353-6088c19615a3@2ndquadrant.com
Diffstat (limited to 'src/backend/replication/walreceiver.c')
-rw-r--r-- | src/backend/replication/walreceiver.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/backend/replication/walreceiver.c b/src/backend/replication/walreceiver.c index ab59a86c62e..25e0333c9e1 100644 --- a/src/backend/replication/walreceiver.c +++ b/src/backend/replication/walreceiver.c @@ -666,8 +666,7 @@ WalRcvWaitForStartPosition(XLogRecPtr *startpoint, TimeLineID *startpointTLI) walrcv->receiveStartTLI = 0; SpinLockRelease(&walrcv->mutex); - if (update_process_title) - set_ps_display("idle", false); + set_ps_display("idle"); /* * nudge startup process to notice that we've stopped streaming and are @@ -715,7 +714,7 @@ WalRcvWaitForStartPosition(XLogRecPtr *startpoint, TimeLineID *startpointTLI) snprintf(activitymsg, sizeof(activitymsg), "restarting at %X/%X", (uint32) (*startpoint >> 32), (uint32) *startpoint); - set_ps_display(activitymsg, false); + set_ps_display(activitymsg); } } @@ -1028,7 +1027,7 @@ XLogWalRcvFlush(bool dying) snprintf(activitymsg, sizeof(activitymsg), "streaming %X/%X", (uint32) (LogstreamResult.Write >> 32), (uint32) LogstreamResult.Write); - set_ps_display(activitymsg, false); + set_ps_display(activitymsg); } /* Also let the master know that we made some progress */ |