Commit 12d11432 authored by Tom Lane's avatar Tom Lane

Fix possible null pointer dereference or invalid warning message.

Thinko in commit de438971: this warning message references the wrong
"LogicalRepWorker *" variable.  This would often result in a core dump,
but if it didn't, the message would show the wrong subscription OID.

In passing, adjust the message text to format a subscription OID
similarly to how that's done elsewhere in the function; and fix
grammatical issues in some nearby messages.

Per Coverity testing.
parent c2384421
...@@ -315,8 +315,8 @@ retry: ...@@ -315,8 +315,8 @@ retry:
wal_receiver_timeout)) wal_receiver_timeout))
{ {
elog(WARNING, elog(WARNING,
"logical replication worker for subscription \"%d\" took too long to start; canceled", "logical replication worker for subscription %u took too long to start; canceled",
worker->subid); w->subid);
logicalrep_worker_cleanup(w); logicalrep_worker_cleanup(w);
did_cleanup = true; did_cleanup = true;
...@@ -347,7 +347,7 @@ retry: ...@@ -347,7 +347,7 @@ retry:
LWLockRelease(LogicalRepWorkerLock); LWLockRelease(LogicalRepWorkerLock);
ereport(WARNING, ereport(WARNING,
(errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
errmsg("out of logical replication workers slots"), errmsg("out of logical replication worker slots"),
errhint("You might need to increase max_logical_replication_workers."))); errhint("You might need to increase max_logical_replication_workers.")));
return; return;
} }
...@@ -393,7 +393,7 @@ retry: ...@@ -393,7 +393,7 @@ retry:
{ {
ereport(WARNING, ereport(WARNING,
(errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
errmsg("out of background workers slots"), errmsg("out of background worker slots"),
errhint("You might need to increase max_worker_processes."))); errhint("You might need to increase max_worker_processes.")));
return; return;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment