Commit 17f5831c authored by Alvaro Herrera's avatar Alvaro Herrera

Fix "sesssion" typo

It was introduced alongside replication origins, by commit
5aa23504, so backpatch to 9.5.

Pointed out by Fujii Masao
parent 60f1e6bc
......@@ -1210,12 +1210,12 @@ RecordTransactionCommit(void)
* Record plain commit ts if not replaying remote actions, or if no
* timestamp is configured.
*/
if (replorigin_sesssion_origin == InvalidRepOriginId ||
replorigin_sesssion_origin == DoNotReplicateId ||
replorigin_sesssion_origin_timestamp == 0)
replorigin_sesssion_origin_timestamp = xactStopTimestamp;
if (replorigin_session_origin == InvalidRepOriginId ||
replorigin_session_origin == DoNotReplicateId ||
replorigin_session_origin_timestamp == 0)
replorigin_session_origin_timestamp = xactStopTimestamp;
else
replorigin_session_advance(replorigin_sesssion_origin_lsn,
replorigin_session_advance(replorigin_session_origin_lsn,
XactLastRecEnd);
/*
......@@ -1224,8 +1224,8 @@ RecordTransactionCommit(void)
* action during replay.
*/
TransactionTreeSetCommitTsData(xid, nchildren, children,
replorigin_sesssion_origin_timestamp,
replorigin_sesssion_origin, false);
replorigin_session_origin_timestamp,
replorigin_session_origin, false);
}
/*
......@@ -5134,12 +5134,12 @@ XactLogCommitRecord(TimestampTz commit_time,
}
/* dump transaction origin information */
if (replorigin_sesssion_origin != InvalidRepOriginId)
if (replorigin_session_origin != InvalidRepOriginId)
{
xl_xinfo.xinfo |= XACT_XINFO_HAS_ORIGIN;
xl_origin.origin_lsn = replorigin_sesssion_origin_lsn;
xl_origin.origin_timestamp = replorigin_sesssion_origin_timestamp;
xl_origin.origin_lsn = replorigin_session_origin_lsn;
xl_origin.origin_timestamp = replorigin_session_origin_timestamp;
}
if (xl_xinfo.xinfo != 0)
......
......@@ -701,11 +701,11 @@ XLogRecordAssemble(RmgrId rmid, uint8 info,
}
/* followed by the record's origin, if any */
if (include_origin && replorigin_sesssion_origin != InvalidRepOriginId)
if (include_origin && replorigin_session_origin != InvalidRepOriginId)
{
*(scratch++) = XLR_BLOCK_ID_ORIGIN;
memcpy(scratch, &replorigin_sesssion_origin, sizeof(replorigin_sesssion_origin));
scratch += sizeof(replorigin_sesssion_origin);
memcpy(scratch, &replorigin_session_origin, sizeof(replorigin_session_origin));
scratch += sizeof(replorigin_session_origin);
}
/* followed by main data, if any */
......
......@@ -148,9 +148,9 @@ typedef struct ReplicationStateCtl
} ReplicationStateCtl;
/* external variables */
RepOriginId replorigin_sesssion_origin = InvalidRepOriginId; /* assumed identity */
XLogRecPtr replorigin_sesssion_origin_lsn = InvalidXLogRecPtr;
TimestampTz replorigin_sesssion_origin_timestamp = 0;
RepOriginId replorigin_session_origin = InvalidRepOriginId; /* assumed identity */
XLogRecPtr replorigin_session_origin_lsn = InvalidXLogRecPtr;
TimestampTz replorigin_session_origin_timestamp = 0;
/*
* Base address into a shared memory array of replication states of size
......@@ -803,7 +803,7 @@ replorigin_redo(XLogReaderState *record)
* 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
* setting up replorigin_session_origin_lsn and replorigin_session_origin
* that ensures we won't loose knowledge about that after a crash if the
* transaction had a persistent effect (think of asynchronous commits).
*
......@@ -1236,7 +1236,7 @@ pg_replication_origin_session_setup(PG_FUNCTION_ARGS)
origin = replorigin_by_name(name, false);
replorigin_session_setup(origin);
replorigin_sesssion_origin = origin;
replorigin_session_origin = origin;
pfree(name);
......@@ -1253,9 +1253,9 @@ pg_replication_origin_session_reset(PG_FUNCTION_ARGS)
replorigin_session_reset();
replorigin_sesssion_origin = InvalidRepOriginId;
replorigin_sesssion_origin_lsn = InvalidXLogRecPtr;
replorigin_sesssion_origin_timestamp = 0;
replorigin_session_origin = InvalidRepOriginId;
replorigin_session_origin_lsn = InvalidXLogRecPtr;
replorigin_session_origin_timestamp = 0;
PG_RETURN_VOID();
}
......@@ -1268,7 +1268,7 @@ pg_replication_origin_session_is_setup(PG_FUNCTION_ARGS)
{
replorigin_check_prerequisites(false, false);
PG_RETURN_BOOL(replorigin_sesssion_origin != InvalidRepOriginId);
PG_RETURN_BOOL(replorigin_session_origin != InvalidRepOriginId);
}
......@@ -1312,8 +1312,8 @@ pg_replication_origin_xact_setup(PG_FUNCTION_ARGS)
(errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
errmsg("no replication origin is configured")));
replorigin_sesssion_origin_lsn = location;
replorigin_sesssion_origin_timestamp = PG_GETARG_TIMESTAMPTZ(1);
replorigin_session_origin_lsn = location;
replorigin_session_origin_timestamp = PG_GETARG_TIMESTAMPTZ(1);
PG_RETURN_VOID();
}
......@@ -1323,8 +1323,8 @@ pg_replication_origin_xact_reset(PG_FUNCTION_ARGS)
{
replorigin_check_prerequisites(true, false);
replorigin_sesssion_origin_lsn = InvalidXLogRecPtr;
replorigin_sesssion_origin_timestamp = 0;
replorigin_session_origin_lsn = InvalidXLogRecPtr;
replorigin_session_origin_timestamp = 0;
PG_RETURN_VOID();
}
......
......@@ -34,9 +34,9 @@ typedef struct xl_replorigin_drop
#define InvalidRepOriginId 0
#define DoNotReplicateId PG_UINT16_MAX
extern PGDLLIMPORT RepOriginId replorigin_sesssion_origin;
extern PGDLLIMPORT XLogRecPtr replorigin_sesssion_origin_lsn;
extern PGDLLIMPORT TimestampTz replorigin_sesssion_origin_timestamp;
extern PGDLLIMPORT RepOriginId replorigin_session_origin;
extern PGDLLIMPORT XLogRecPtr replorigin_session_origin_lsn;
extern PGDLLIMPORT TimestampTz replorigin_session_origin_timestamp;
/* API for querying & manipulating replication origins */
extern RepOriginId replorigin_by_name(char *name, bool missing_ok);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment