@@ -1219,45 +1219,45 @@ reread_subscription(void)
12191219newsub = GetSubscription (MyLogicalRepWorker -> subid , true);
12201220
12211221/*
1222- * Exit if connection string was changed. The launcher will start
1223- * new worker.
1222+ * Exit if the subscription was removed.
1223+ * This normally should not happen as the worker gets killed
1224+ * during DROP SUBSCRIPTION.
12241225 */
1225- if (strcmp ( newsub -> conninfo , MySubscription -> conninfo ) != 0 )
1226+ if (! newsub )
12261227{
12271228ereport (LOG ,
12281229(errmsg ("logical replication worker for subscription \"%s\" will "
1229- "restart because theconnection information waschanged " ,
1230+ "stop because thesubscription wasremoved " ,
12301231MySubscription -> name )));
12311232
12321233walrcv_disconnect (wrconn );
12331234proc_exit (0 );
12341235}
12351236
12361237/*
1237- * Exit ifpublication list was changed. The launcher will start
1238+ * Exit ifconnection string was changed. The launcher will start
12381239 * new worker.
12391240 */
1240- if (! equal (newsub -> publications ,MySubscription -> publications ) )
1241+ if (strcmp (newsub -> conninfo ,MySubscription -> conninfo ) != 0 )
12411242{
12421243ereport (LOG ,
12431244(errmsg ("logical replication worker for subscription \"%s\" will "
1244- "restart becausesubscription's publications were changed" ,
1245+ "restart becausethe connection information was changed" ,
12451246MySubscription -> name )));
12461247
12471248walrcv_disconnect (wrconn );
12481249proc_exit (0 );
12491250}
12501251
12511252/*
1252- * Exit if the subscription was removed.
1253- * This normally should not happen as the worker gets killed
1254- * during DROP SUBSCRIPTION.
1253+ * Exit if publication list was changed. The launcher will start
1254+ * new worker.
12551255 */
1256- if (!newsub )
1256+ if (!equal ( newsub -> publications , MySubscription -> publications ) )
12571257{
12581258ereport (LOG ,
12591259(errmsg ("logical replication worker for subscription \"%s\" will "
1260- "stop becausethe subscription was removed " ,
1260+ "restart because subscription's publications were changed " ,
12611261MySubscription -> name )));
12621262
12631263walrcv_disconnect (wrconn );