Content-Length: 293324 | pFad | http://github.com/postgrespro/postgres/commit/96675bff1f49d2d846750e344d3adc409e6bad73

D8 Fix bug in the WAL recovery code to finish an incomplete split. · postgrespro/postgres@96675bf · GitHub
Skip to content

Commit 96675bf

Browse files
committed
Fix bug in the WAL recovery code to finish an incomplete split.
CacheInvalidateRelcache() crashes if called in WAL recovery, because the invalidation infrastructure hasn't been initialized yet. Back-patch to 8.2, where the bug was introduced.
1 parent 109940c commit 96675bf

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/backend/access/nbtree/nbtinsert.c

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*
99
*
1010
* IDENTIFICATION
11-
* $PostgreSQL: pgsql/src/backend/access/nbtree/nbtinsert.c,v 1.166 2008/05/12 00:00:45 alvherre Exp $
11+
* $PostgreSQL: pgsql/src/backend/access/nbtree/nbtinsert.c,v 1.167 2008/06/11 08:38:56 heikki Exp $
1212
*
1313
*-------------------------------------------------------------------------
1414
*/
@@ -747,7 +747,8 @@ _bt_insertonpg(Relation rel,
747747
/* release buffers; send out relcache inval if metapage changed */
748748
if (BufferIsValid(metabuf))
749749
{
750-
CacheInvalidateRelcache(rel);
750+
if (!InRecovery)
751+
CacheInvalidateRelcache(rel);
751752
_bt_relbuf(rel, metabuf);
752753
}
753754

@@ -1792,7 +1793,8 @@ _bt_newroot(Relation rel, Buffer lbuf, Buffer rbuf)
17921793
END_CRIT_SECTION();
17931794

17941795
/* send out relcache inval for metapage change */
1795-
CacheInvalidateRelcache(rel);
1796+
if (!InRecovery)
1797+
CacheInvalidateRelcache(rel);
17961798

17971799
/* done with metapage */
17981800
_bt_relbuf(rel, metabuf);

0 commit comments

Comments
 (0)








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: http://github.com/postgrespro/postgres/commit/96675bff1f49d2d846750e344d3adc409e6bad73

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy