init
(1 row)
+SELECT pg_create_logical_replication_slot('foo', 'nonexistent');
+ERROR: could not access file "nonexistent": No such file or directory
-- here we want to start a new session and wait till old one is gone
select pg_backend_pid() as oldpid \gset
\c -
SELECT 'init' FROM pg_create_logical_replication_slot('regression_slot_t2', 'test_decoding', true);
+SELECT pg_create_logical_replication_slot('foo', 'nonexistent');
+
-- here we want to start a new session and wait till old one is gone
select pg_backend_pid() as oldpid \gset
\c -
ReplicationSlotSave();
ctx = StartupDecodingContext(NIL, InvalidXLogRecPtr, xmin_horizon,
- need_full_snapshot, true,
+ need_full_snapshot, false,
read_page, prepare_write, do_write,
update_progress);
got_STOPPING = true;
}
+ /*
+ * Create our decoding context, making it start at the previously ack'ed
+ * position.
+ *
+ * Do this before sending CopyBoth, so that any errors are reported early.
+ */
+ logical_decoding_ctx =
+ CreateDecodingContext(cmd->startpoint, cmd->options, false,
+ logical_read_xlog_page,
+ WalSndPrepareWrite, WalSndWriteData,
+ WalSndUpdateProgress);
+
+
WalSndSetState(WALSNDSTATE_CATCHUP);
/* Send a CopyBothResponse message, and start streaming */
pq_endmessage(&buf);
pq_flush();
- /*
- * Initialize position to the last ack'ed one, then the xlog records begin
- * to be shipped from that position.
- */
- logical_decoding_ctx = CreateDecodingContext(cmd->startpoint, cmd->options,
- false,
- logical_read_xlog_page,
- WalSndPrepareWrite,
- WalSndWriteData,
- WalSndUpdateProgress);
/* Start reading WAL from the oldest required WAL. */
logical_startptr = MyReplicationSlot->data.restart_lsn;