@@ -1219,45 +1219,45 @@ reread_subscription(void)
1219
1219
newsub = GetSubscription (MyLogicalRepWorker -> subid , true);
1220
1220
1221
1221
/*
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.
1224
1225
*/
1225
- if (strcmp ( newsub -> conninfo , MySubscription -> conninfo ) != 0 )
1226
+ if (! newsub )
1226
1227
{
1227
1228
ereport (LOG ,
1228
1229
(errmsg ("logical replication worker for subscription \"%s\" will "
1229
- "restart because the connection information was changed " ,
1230
+ "stop because the subscription was removed " ,
1230
1231
MySubscription -> name )));
1231
1232
1232
1233
walrcv_disconnect (wrconn );
1233
1234
proc_exit (0 );
1234
1235
}
1235
1236
1236
1237
/*
1237
- * Exit if publication list was changed. The launcher will start
1238
+ * Exit if connection string was changed. The launcher will start
1238
1239
* new worker.
1239
1240
*/
1240
- if (! equal (newsub -> publications , MySubscription -> publications ) )
1241
+ if (strcmp (newsub -> conninfo , MySubscription -> conninfo ) != 0 )
1241
1242
{
1242
1243
ereport (LOG ,
1243
1244
(errmsg ("logical replication worker for subscription \"%s\" will "
1244
- "restart because subscription's publications were changed" ,
1245
+ "restart because the connection information was changed" ,
1245
1246
MySubscription -> name )));
1246
1247
1247
1248
walrcv_disconnect (wrconn );
1248
1249
proc_exit (0 );
1249
1250
}
1250
1251
1251
1252
/*
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.
1255
1255
*/
1256
- if (!newsub )
1256
+ if (!equal ( newsub -> publications , MySubscription -> publications ) )
1257
1257
{
1258
1258
ereport (LOG ,
1259
1259
(errmsg ("logical replication worker for subscription \"%s\" will "
1260
- "stop because the subscription was removed " ,
1260
+ "restart because subscription's publications were changed " ,
1261
1261
MySubscription -> name )));
1262
1262
1263
1263
walrcv_disconnect (wrconn );
0 commit comments