diff --git a/src/gausskernel/optimizer/commands/subscriptioncmds.cpp b/src/gausskernel/optimizer/commands/subscriptioncmds.cpp index 5f05f4418..f27d89289 100644 --- a/src/gausskernel/optimizer/commands/subscriptioncmds.cpp +++ b/src/gausskernel/optimizer/commands/subscriptioncmds.cpp @@ -181,6 +181,11 @@ static void parse_subscription_options(const List *options, char **conninfo, Lis errmsg("subscription with slot_name = NONE must also set enabled = false"))); } } + + if (copy_data && *copy_data && u_sess->attr.attr_storage.max_sync_workers_per_subscription == 0) { + ereport(WARNING, (errmsg("you need to set max_sync_workers_per_subscription because it is zero but " + "copy_data is true"))); + } } /* @@ -852,6 +857,8 @@ ObjectAddress AlterSubscription(AlterSubscriptionStmt *stmt, bool isTopLevel) if (publications != NIL) { values[Anum_pg_subscription_subpublications - 1] = publicationListToArray(publications); replaces[Anum_pg_subscription_subpublications - 1] = true; + } else { + publications = sub->publications; } tup = heap_modify_tuple(tup, RelationGetDescr(rel), values, nulls, replaces); diff --git a/src/gausskernel/storage/replication/logical/tablesync.cpp b/src/gausskernel/storage/replication/logical/tablesync.cpp index 327218fdc..4f8726343 100644 --- a/src/gausskernel/storage/replication/logical/tablesync.cpp +++ b/src/gausskernel/storage/replication/logical/tablesync.cpp @@ -866,7 +866,9 @@ char *LogicalRepSyncTableStart(XLogRecPtr *origin_startpos) * breakdown then it wouldn't have succeeded so trying it next time * seems like a better bet. */ + StartTransactionCommand(); ReplicationSlotDropAtPubNode(slotname, true); + CommitTransactionCommand(); } else if (t_thrd.applyworker_cxt.curWorker->relstate == SUBREL_STATE_FINISHEDCOPY) { /* * The COPY phase was previously done, but tablesync then crashed