mirror of https://github.com/citusdata/citus.git
Revert replica identity thing
parent
ecaa0cda6d
commit
141e9315ff
|
@ -234,6 +234,21 @@ LogicallyReplicateShards(List *shardList, char *sourceNodeName, int sourceNodePo
|
||||||
/* only useful for isolation testing, see the function comment for the details */
|
/* only useful for isolation testing, see the function comment for the details */
|
||||||
ConflictOnlyWithIsolationTesting();
|
ConflictOnlyWithIsolationTesting();
|
||||||
|
|
||||||
|
/*
|
||||||
|
* We have to create the primary key (or any other replica identity)
|
||||||
|
* before the update/delete operations that are queued will be
|
||||||
|
* replicated. Because if the replica identity does not exist on the
|
||||||
|
* target, the replication would fail.
|
||||||
|
*
|
||||||
|
* So we it right after the initial data COPY, but before enabling the
|
||||||
|
* susbcriptions. We do it at this latest possible moment, because its
|
||||||
|
* much cheaper to build an index at once than to create it
|
||||||
|
* incrementally. So this way we create the primary key index in one go
|
||||||
|
* for all data from the initial COPY.
|
||||||
|
*/
|
||||||
|
CreateReplicaIdentities(logicalRepTargetList);
|
||||||
|
|
||||||
|
|
||||||
CopyShardsToNode(sourceNode, targetNode, shardList, snapshot);
|
CopyShardsToNode(sourceNode, targetNode, shardList, snapshot);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -347,20 +362,6 @@ CompleteNonBlockingShardTransfer(List *shardList,
|
||||||
HTAB *groupedLogicalRepTargetsHash,
|
HTAB *groupedLogicalRepTargetsHash,
|
||||||
LogicalRepType type)
|
LogicalRepType type)
|
||||||
{
|
{
|
||||||
/*
|
|
||||||
* We have to create the primary key (or any other replica identity)
|
|
||||||
* before the update/delete operations that are queued will be
|
|
||||||
* replicated. Because if the replica identity does not exist on the
|
|
||||||
* target, the replication would fail.
|
|
||||||
*
|
|
||||||
* So we it right after the initial data COPY, but before enabling the
|
|
||||||
* susbcriptions. We do it at this latest possible moment, because its
|
|
||||||
* much cheaper to build an index at once than to create it
|
|
||||||
* incrementally. So this way we create the primary key index in one go
|
|
||||||
* for all data from the initial COPY.
|
|
||||||
*/
|
|
||||||
CreateReplicaIdentities(logicalRepTargetList);
|
|
||||||
|
|
||||||
/* Start applying the changes from the replication slots to catch up. */
|
/* Start applying the changes from the replication slots to catch up. */
|
||||||
EnableSubscriptions(logicalRepTargetList);
|
EnableSubscriptions(logicalRepTargetList);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue