mirror of https://github.com/citusdata/citus.git
Rename a function that collides with PG15 (#6422)
PG15 introduced a function called ReplicationSlotName that causes conflicts with our function with the same name. I solved this issue by renaming our function to ReplicationSlotNameForNodeAndOwner Relevant PG commit:pull/6482/headc3b5992b91
(cherry picked from commitec3eebbaf6
)
parent
64db74c051
commit
26ae4b8fb3
|
@ -281,7 +281,8 @@ PopulateShardSplitInfoInSM(ShardSplitInfoSMHeader *shardSplitInfoSMHeader)
|
||||||
{
|
{
|
||||||
uint32_t nodeId = entry->key.nodeId;
|
uint32_t nodeId = entry->key.nodeId;
|
||||||
uint32_t tableOwnerId = entry->key.tableOwnerId;
|
uint32_t tableOwnerId = entry->key.tableOwnerId;
|
||||||
char *derivedSlotName = ReplicationSlotName(SHARD_SPLIT, nodeId, tableOwnerId);
|
char *derivedSlotName = ReplicationSlotNameForNodeAndOwner(SHARD_SPLIT, nodeId,
|
||||||
|
tableOwnerId);
|
||||||
|
|
||||||
List *shardSplitInfoList = entry->shardSplitInfoList;
|
List *shardSplitInfoList = entry->shardSplitInfoList;
|
||||||
ShardSplitInfo *splitShardInfo = NULL;
|
ShardSplitInfo *splitShardInfo = NULL;
|
||||||
|
@ -389,7 +390,8 @@ ReturnReplicationSlotInfo(Tuplestorestate *tupleStore, TupleDesc
|
||||||
char *tableOwnerName = GetUserNameFromId(entry->key.tableOwnerId, false);
|
char *tableOwnerName = GetUserNameFromId(entry->key.tableOwnerId, false);
|
||||||
values[1] = CStringGetTextDatum(tableOwnerName);
|
values[1] = CStringGetTextDatum(tableOwnerName);
|
||||||
|
|
||||||
char *slotName = ReplicationSlotName(SHARD_SPLIT, entry->key.nodeId,
|
char *slotName = ReplicationSlotNameForNodeAndOwner(SHARD_SPLIT,
|
||||||
|
entry->key.nodeId,
|
||||||
entry->key.tableOwnerId);
|
entry->key.tableOwnerId);
|
||||||
values[2] = CStringGetTextDatum(slotName);
|
values[2] = CStringGetTextDatum(slotName);
|
||||||
|
|
||||||
|
|
|
@ -501,7 +501,7 @@ CreateShardMoveLogicalRepTargetList(HTAB *publicationInfoHash, List *shardList)
|
||||||
target->newShards = NIL;
|
target->newShards = NIL;
|
||||||
target->subscriptionOwnerName = SubscriptionRoleName(SHARD_MOVE, ownerId);
|
target->subscriptionOwnerName = SubscriptionRoleName(SHARD_MOVE, ownerId);
|
||||||
target->replicationSlot = palloc0(sizeof(ReplicationSlotInfo));
|
target->replicationSlot = palloc0(sizeof(ReplicationSlotInfo));
|
||||||
target->replicationSlot->name = ReplicationSlotName(SHARD_MOVE,
|
target->replicationSlot->name = ReplicationSlotNameForNodeAndOwner(SHARD_MOVE,
|
||||||
nodeId,
|
nodeId,
|
||||||
ownerId);
|
ownerId);
|
||||||
target->replicationSlot->targetNodeId = nodeId;
|
target->replicationSlot->targetNodeId = nodeId;
|
||||||
|
@ -1381,11 +1381,14 @@ PublicationName(LogicalRepType type, uint32_t nodeId, Oid ownerId)
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* ReplicationSlotName returns the name of the replication slot for the given
|
* ReplicationSlotNameForNodeAndOwner returns the name of the replication slot for the
|
||||||
* node and table owner.
|
* given node and table owner.
|
||||||
|
*
|
||||||
|
* Note that PG15 introduced a new ReplicationSlotName function that caused name conflicts
|
||||||
|
* and we renamed this function.
|
||||||
*/
|
*/
|
||||||
char *
|
char *
|
||||||
ReplicationSlotName(LogicalRepType type, uint32_t nodeId, Oid ownerId)
|
ReplicationSlotNameForNodeAndOwner(LogicalRepType type, uint32_t nodeId, Oid ownerId)
|
||||||
{
|
{
|
||||||
StringInfo slotName = makeStringInfo();
|
StringInfo slotName = makeStringInfo();
|
||||||
appendStringInfo(slotName, "%s%u_%u", replicationSlotPrefix[type], nodeId,
|
appendStringInfo(slotName, "%s%u_%u", replicationSlotPrefix[type], nodeId,
|
||||||
|
|
|
@ -157,7 +157,8 @@ extern void DropPublications(MultiConnection *sourceConnection,
|
||||||
extern void DropAllLogicalReplicationLeftovers(LogicalRepType type);
|
extern void DropAllLogicalReplicationLeftovers(LogicalRepType type);
|
||||||
|
|
||||||
extern char * PublicationName(LogicalRepType type, uint32_t nodeId, Oid ownerId);
|
extern char * PublicationName(LogicalRepType type, uint32_t nodeId, Oid ownerId);
|
||||||
extern char * ReplicationSlotName(LogicalRepType type, uint32_t nodeId, Oid ownerId);
|
extern char * ReplicationSlotNameForNodeAndOwner(LogicalRepType type, uint32_t nodeId, Oid
|
||||||
|
ownerId);
|
||||||
extern char * SubscriptionName(LogicalRepType type, Oid ownerId);
|
extern char * SubscriptionName(LogicalRepType type, Oid ownerId);
|
||||||
extern char * SubscriptionRoleName(LogicalRepType type, Oid ownerId);
|
extern char * SubscriptionRoleName(LogicalRepType type, Oid ownerId);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue