Seed the subscriber once, subscribe in reverse and prove that writes arrive in both directions.
Prepare the instances
Start with two fresh Mimus 19.0.1 clusters on one host, A on loopback port 5541 and B on 5542. Install the paired Spock extension and output plugin in both prefixes. Configure the following on both, merging any existing required preloads. Each cluster needs its own data directory and port. Restart both and create a database named lab in each. For separate hosts replace the loopback addresses with peer-reachable addresses.
Configure pg_hba.conf and service-account libpq credentials so both servers can connect to both lab databases using the named administrative role. The example uses postgres. Test each DSN from the database service account, including reconnect after restart. Connect psql to lab separately on A and B. Install the extension on both, then register each node with its own address.
-- A and B
CREATEEXTENSIONspock;-- A
SELECTspock.node_create('node_a','host=127.0.0.1 port=5541 dbname=lab user=postgres');-- B
SELECTspock.node_create('node_b','host=127.0.0.1 port=5542 dbname=lab user=postgres');
Define the tables and copy the seed
On both nodes create the same empty table, column options and replication-set membership:
Seed A only. On B, subscribe to A and confirm the seed arrived. Then subscribe A to B without copying data a second time. The empty origin list limits forwarding to locally originated changes.
-- A
INSERTINTOpublic.accountsVALUES(1,'seed',100);-- B
SELECTspock.sub_create('from_a','host=127.0.0.1 port=5541 dbname=lab user=postgres',replication_sets:=ARRAY['default'],synchronize_structure:=false,synchronize_data:=true,forward_origins:='{}');SELECTspock.sub_wait_for_sync('from_a');SELECT*FROMpublic.accountsWHEREid=1;-- A
SELECTspock.sub_create('from_b','host=127.0.0.1 port=5542 dbname=lab user=postgres',replication_sets:=ARRAY['default'],synchronize_structure:=false,synchronize_data:=false,forward_origins:='{}');SELECTspock.sub_wait_for_sync('from_b');
Check both writers
-- A
INSERTINTOpublic.accountsVALUES(2,'from_a',50);-- B
SELECT*FROMpublic.accountsWHEREid=2;-- B, after seeing (2, from_a, 50)
UPDATEpublic.accountsSETlabel='from_b',balance=balance+2WHEREid=2;-- A
SELECT*FROMpublic.accountsWHEREid=2;
On each read, poll until the row arrives before moving to the next step. A should finally return (2,from_b,52). Check SELECT subscription_name, status FROM spock.sub_show_status() on both nodes. Both should say replicating. A local COMMIT may return before the peer sees the row. Operate the pair