@@ -1219,45 +1219,45 @@ reread_subscription(void)
12191219 newsub = 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 {
12271228 ereport (LOG ,
12281229 (errmsg ("logical replication worker for subscription \"%s\" will "
1229- "restart because the connection information was changed " ,
1230+ "stop because the subscription was removed " ,
12301231 MySubscription -> name )));
12311232
12321233 walrcv_disconnect (wrconn );
12331234 proc_exit (0 );
12341235 }
12351236
12361237 /*
1237- * Exit if publication list was changed. The launcher will start
1238+ * Exit if connection 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 {
12421243 ereport (LOG ,
12431244 (errmsg ("logical replication worker for subscription \"%s\" will "
1244- "restart because subscription's publications were changed" ,
1245+ "restart because the connection information was changed" ,
12451246 MySubscription -> name )));
12461247
12471248 walrcv_disconnect (wrconn );
12481249 proc_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 {
12581258 ereport (LOG ,
12591259 (errmsg ("logical replication worker for subscription \"%s\" will "
1260- "stop because the subscription was removed " ,
1260+ "restart because subscription's publications were changed " ,
12611261 MySubscription -> name )));
12621262
12631263 walrcv_disconnect (wrconn );
0 commit comments