Skip to content

Commit 986529c

Browse files
committed
Remove WARNING message from brin_desummarize_range
This message was being emitted on the grounds that only crashed summarization could cause it, but in reality even an aborted vacuum could do it ... which makes it way too noisy, particularly since it shows up in regression tests and makes them die. Reported by Tom Lane. Discussion: https://postgr.es/m/489091.1593534251@sss.pgh.pa.us
1 parent 183926d commit 986529c

File tree

1 file changed

+8
-16
lines changed

1 file changed

+8
-16
lines changed

src/backend/access/brin/brin_revmap.c

Lines changed: 8 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -333,7 +333,6 @@ brinRevmapDesummarizeRange(Relation idxrel, BlockNumber heapBlk)
333333
OffsetNumber revmapOffset;
334334
OffsetNumber regOffset;
335335
ItemId lp;
336-
BrinTuple *tup;
337336

338337
revmap = brinRevmapInitialize(idxrel, &pagesPerRange, NULL);
339338

@@ -365,6 +364,10 @@ brinRevmapDesummarizeRange(Relation idxrel, BlockNumber heapBlk)
365364
regBuf = ReadBuffer(idxrel, ItemPointerGetBlockNumber(iptr));
366365
LockBuffer(regBuf, BUFFER_LOCK_EXCLUSIVE);
367366
regPg = BufferGetPage(regBuf);
367+
/*
368+
* We're only removing data, not reading it, so there's no need to
369+
* TestForOldSnapshot here.
370+
*/
368371

369372
/* if this is no longer a regular page, tell caller to start over */
370373
if (!BRIN_IS_REGULAR_PAGE(regPg))
@@ -386,24 +389,13 @@ brinRevmapDesummarizeRange(Relation idxrel, BlockNumber heapBlk)
386389
ereport(ERROR,
387390
(errcode(ERRCODE_INDEX_CORRUPTED),
388391
errmsg("corrupted BRIN index: inconsistent range map")));
389-
tup = (BrinTuple *) PageGetItem(regPg, lp);
390-
/* XXX apply sanity checks? Might as well delete a bogus tuple ... */
391-
392-
/*
393-
* We're only removing data, not reading it, so there's no need to
394-
* TestForOldSnapshot here.
395-
*/
396392

397393
/*
398-
* Because of ShareUpdateExclusive lock, this function shouldn't run
399-
* concurrently with summarization. Placeholder tuples can only exist as
400-
* leftovers from crashed summarization, so if we detect any, we complain
401-
* but proceed.
394+
* Placeholder tuples only appear during unfinished summarization, and we
395+
* hold ShareUpdateExclusiveLock, so this function cannot run concurrently
396+
* with that. So any placeholder tuples that exist are leftovers from a
397+
* crashed or aborted summarization; remove them silently.
402398
*/
403-
if (BrinTupleIsPlaceholder(tup))
404-
ereport(WARNING,
405-
(errmsg("leftover placeholder tuple detected in BRIN index \"%s\", deleting",
406-
RelationGetRelationName(idxrel))));
407399

408400
START_CRIT_SECTION();
409401

0 commit comments

Comments
 (0)