MCPcopy Create free account
hub / github.com/apecloud/myduckserver / newReplicator

Function newReplicator

pgserver/logrepl/replication_test.go:721–735  ·  view source on GitHub ↗
(sqlCtx *sql.Context, t *testing.T, primaryDns string)

Source from the content-addressed store, hash-verified

719}
720
721func newReplicator(sqlCtx *sql.Context, t *testing.T, primaryDns string) *logrepl.LogicalReplicator {
722 err := logrepl.CreateSubscription(sqlCtx, subscriptionName, primaryDns, slotName, pglogrepl.LSN(0).String(), true)
723 require.NoError(t, err)
724
725 tx := adapter.TryGetTxn(sqlCtx)
726 if tx != nil {
727 err := tx.Commit()
728 require.NoError(t, err)
729 adapter.CloseTxn(sqlCtx)
730 }
731
732 r, err := logrepl.NewLogicalReplicator(subscriptionName, primaryDns)
733 require.NoError(t, err)
734 return r
735}
736
737// runReplicationScript runs the script given on the postgres connection provided
738func runReplicationScript(

Callers 1

runReplicationScriptFunction · 0.85

Calls 5

CreateSubscriptionFunction · 0.92
TryGetTxnFunction · 0.92
CloseTxnFunction · 0.92
NewLogicalReplicatorFunction · 0.92
StringMethod · 0.45

Tested by

no test coverage detected