From 8b65cf4c5edabdcae45ceaef7b9ac236879aae50 Mon Sep 17 00:00:00 2001 From: Kevin Grittner Date: Fri, 8 Apr 2016 14:30:10 -0500 Subject: Modify BufferGetPage() to prepare for "snapshot too old" feature This patch is a no-op patch which is intended to reduce the chances of failures of omission once the functional part of the "snapshot too old" patch goes in. It adds parameters for snapshot, relation, and an enum to specify whether the snapshot age check needs to be done for the page at this point. This initial patch passes NULL for the first two new parameters and BGP_NO_SNAPSHOT_TEST for the third. The follow-on patch will change the places where the test needs to be made. --- src/backend/commands/sequence.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src/backend/commands/sequence.c') diff --git a/src/backend/commands/sequence.c b/src/backend/commands/sequence.c index c98f9811119..f38126f4f98 100644 --- a/src/backend/commands/sequence.c +++ b/src/backend/commands/sequence.c @@ -337,7 +337,7 @@ fill_seq_with_data(Relation rel, HeapTuple tuple) buf = ReadBuffer(rel, P_NEW); Assert(BufferGetBlockNumber(buf) == 0); - page = BufferGetPage(buf); + page = BufferGetPage(buf, NULL, NULL, BGP_NO_SNAPSHOT_TEST); PageInit(page, BufferGetPageSize(buf), sizeof(sequence_magic)); sm = (sequence_magic *) PageGetSpecialPointer(page); @@ -462,7 +462,7 @@ AlterSequence(AlterSeqStmt *stmt) { xl_seq_rec xlrec; XLogRecPtr recptr; - Page page = BufferGetPage(buf); + Page page = BufferGetPage(buf, NULL, NULL, BGP_NO_SNAPSHOT_TEST); XLogBeginInsert(); XLogRegisterBuffer(0, buf, REGBUF_WILL_INIT); @@ -584,7 +584,7 @@ nextval_internal(Oid relid) /* lock page' buffer and read tuple */ seq = read_seq_tuple(elm, seqrel, &buf, &seqtuple); - page = BufferGetPage(buf); + page = BufferGetPage(buf, NULL, NULL, BGP_NO_SNAPSHOT_TEST); last = next = result = seq->last_value; incby = seq->increment_by; @@ -923,7 +923,7 @@ do_setval(Oid relid, int64 next, bool iscalled) { xl_seq_rec xlrec; XLogRecPtr recptr; - Page page = BufferGetPage(buf); + Page page = BufferGetPage(buf, NULL, NULL, BGP_NO_SNAPSHOT_TEST); XLogBeginInsert(); XLogRegisterBuffer(0, buf, REGBUF_WILL_INIT); @@ -1115,7 +1115,7 @@ read_seq_tuple(SeqTable elm, Relation rel, Buffer *buf, HeapTuple seqtuple) *buf = ReadBuffer(rel, 0); LockBuffer(*buf, BUFFER_LOCK_EXCLUSIVE); - page = BufferGetPage(*buf); + page = BufferGetPage(*buf, NULL, NULL, BGP_NO_SNAPSHOT_TEST); sm = (sequence_magic *) PageGetSpecialPointer(page); if (sm->magic != SEQ_MAGIC) @@ -1591,7 +1591,7 @@ seq_redo(XLogReaderState *record) elog(PANIC, "seq_redo: unknown op code %u", info); buffer = XLogInitBufferForRedo(record, 0); - page = (Page) BufferGetPage(buffer); + page = BufferGetPage(buffer, NULL, NULL, BGP_NO_SNAPSHOT_TEST); /* * We always reinit the page. However, since this WAL record type is also -- cgit v1.2.3