Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit f6cae81

Browse files
committed
fix ptrack. Do not write ptrack for unlogged index relations
1 parent da44165 commit f6cae81

File tree

5 files changed

+2
-8
lines changed

5 files changed

+2
-8
lines changed

src/backend/access/brin/brin.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -748,7 +748,6 @@ brinbuildempty(Relation index)
748748
LockBuffer(metabuf, BUFFER_LOCK_EXCLUSIVE);
749749

750750
/* Initialize and xlog metabuffer. */
751-
ptrack_add_block(index, BufferGetBlockNumber(metabuf));
752751
START_CRIT_SECTION();
753752
brin_metapage_init(BufferGetPage(metabuf), BrinGetPagesPerRange(index),
754753
BRIN_CURRENT_VERSION);

src/backend/access/gin/gininsert.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -447,8 +447,6 @@ ginbuildempty(Relation index)
447447
LockBuffer(RootBuffer, BUFFER_LOCK_EXCLUSIVE);
448448

449449
/* Initialize and xlog metabuffer and root buffer. */
450-
ptrack_add_block(index, BufferGetBlockNumber(MetaBuffer));
451-
ptrack_add_block(index, BufferGetBlockNumber(RootBuffer));
452450
START_CRIT_SECTION();
453451
GinInitMetabuffer(MetaBuffer);
454452
MarkBufferDirty(MetaBuffer);

src/backend/access/gist/gist.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,6 @@ gistbuildempty(Relation index)
129129
LockBuffer(buffer, BUFFER_LOCK_EXCLUSIVE);
130130

131131
/* Initialize and xlog buffer */
132-
ptrack_add_block(index, BufferGetBlockNumber(buffer));
133132
START_CRIT_SECTION();
134133
GISTInitBuffer(buffer, F_LEAF);
135134
MarkBufferDirty(buffer);

src/backend/access/nbtree/nbtree.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -303,8 +303,6 @@ btbuildempty(Relation index)
303303
smgrwrite(index->rd_smgr, INIT_FORKNUM, BTREE_METAPAGE,
304304
(char *) metapage, true);
305305

306-
/* Don't forget to set ptrack bit even if we're skipping bufmgr stage */
307-
ptrack_add_block_redo(index->rd_smgr->smgr_rnode.node, BTREE_METAPAGE);
308306
log_newpage(&index->rd_smgr->smgr_rnode.node, INIT_FORKNUM,
309307
BTREE_METAPAGE, metapage, false);
310308
/* Ensure rd_smgr is open (could have been closed by relcache flush!) */

src/include/access/ptrack.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@
88
#include "utils/relcache.h"
99

1010
/* Ptrack version as a string */
11-
#define PTRACK_VERSION "1.5"
11+
#define PTRACK_VERSION "1.6"
1212
/* Ptrack version as a number */
13-
#define PTRACK_VERSION_NUM 105
13+
#define PTRACK_VERSION_NUM 106
1414

1515
/* Number of bits allocated for each heap block. */
1616
#define PTRACK_BITS_PER_HEAPBLOCK 1

0 commit comments

Comments
 (0)