<entry><structfield>local_lsn</structfield></entry>
<entry><type>pg_lsn</type></entry>
<entry></entry>
- <entry>This node's LSN that at
- which <literal>remote_lsn</literal> has been replicated. Used to
- flush commit records before persisting data to disk when using
- asynchronous commits.</entry>
+ <entry>
+ This node's LSN at which <literal>remote_lsn</literal> has
+ been replicated. Used to flush commit records before persisting
+ data to disk when using asynchronous commits.
+ </entry>
</row>
</tbody>
</tgroup>
Using the replication origin infrastructure a session can be
marked as replaying from a remote node (using the
<link linkend="pg-replication-origin-session-setup"><function>pg_replication_origin_session_setup()</function></link>
- function. Additionally the <acronym>LSN</acronym> and commit
+ function). Additionally the <acronym>LSN</acronym> and commit
timestamp of every source transaction can be configured on a per
transaction basis using
<link linkend="pg-replication-origin-xact-setup"><function>pg_replication_origin_xact_setup()</function></link>.
if (tuple == NULL)
ereport(ERROR,
(errcode(ERRCODE_PROGRAM_LIMIT_EXCEEDED),
- errmsg("no free replication oid could be found")));
+ errmsg("no free replication origin oid could be found")));
heap_freetuple(tuple);
return roident;
LWLockRelease(ReplicationOriginLock);
tuple = SearchSysCache1(REPLORIGIDENT, ObjectIdGetDatum(roident));
+ if (!HeapTupleIsValid(tuple))
+ elog(ERROR, "cache lookup failed for replication origin with oid %u",
+ roident);
+
simple_heap_delete(rel, &tuple->t_self);
ReleaseSysCache(tuple);
Size size = 0;
/*
- * XXX: max_replication_slots is arguablethe wrong thing to use here, here
+ * XXX: max_replication_slots is arguably the wrong thing to use, as here
* we keep the replay state of *remote* transactions. But for now it seems
* sufficient to reuse it, lest we introduce a separate guc.
*/
ereport(PANIC,
(errcode_for_file_access(),
errmsg("could not remove file \"%s\": %m",
- path)));
+ tmppath)));
/*
* no other backend can perform this at the same time, we're protected by
* Tell the replication origin progress machinery that a commit from 'node'
* that originated at the LSN remote_commit on the remote node was replayed
* successfully and that we don't need to do so again. In combination with
- * setting up replorigin_sesssion_origin_lsn and replorigin_sesssion_origin that ensures we
- * won't loose knowledge about that after a crash if the transaction had a
- * persistent effect (think of asynchronous commits).
+ * setting up replorigin_sesssion_origin_lsn and replorigin_sesssion_origin
+ * that ensures we won't loose knowledge about that after a crash if the
+ * transaction had a persistent effect (think of asynchronous commits).
*
* local_commit needs to be a local LSN of the commit so that we can make sure
- * uppon a checkpoint that enough WAL has been persisted to disk.
+ * upon a checkpoint that enough WAL has been persisted to disk.
*
* Needs to be called with a RowExclusiveLock on pg_replication_origin,
* unless running in recovery.
replorigin_session_reset();
- /* FIXME */
replorigin_sesssion_origin = InvalidRepOriginId;
replorigin_sesssion_origin_lsn = InvalidXLogRecPtr;
replorigin_sesssion_origin_timestamp = 0;