mirror of
https://git.postgresql.org/git/postgresql.git
synced 2024-09-09 03:39:28 +02:00
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
This commit is contained in:
parent
17b87b3049
commit
c3a79e7192
@ -333,7 +333,6 @@ brinRevmapDesummarizeRange(Relation idxrel, BlockNumber heapBlk)
|
|||||||
OffsetNumber revmapOffset;
|
OffsetNumber revmapOffset;
|
||||||
OffsetNumber regOffset;
|
OffsetNumber regOffset;
|
||||||
ItemId lp;
|
ItemId lp;
|
||||||
BrinTuple *tup;
|
|
||||||
|
|
||||||
revmap = brinRevmapInitialize(idxrel, &pagesPerRange, NULL);
|
revmap = brinRevmapInitialize(idxrel, &pagesPerRange, NULL);
|
||||||
|
|
||||||
@ -365,6 +364,10 @@ brinRevmapDesummarizeRange(Relation idxrel, BlockNumber heapBlk)
|
|||||||
regBuf = ReadBuffer(idxrel, ItemPointerGetBlockNumber(iptr));
|
regBuf = ReadBuffer(idxrel, ItemPointerGetBlockNumber(iptr));
|
||||||
LockBuffer(regBuf, BUFFER_LOCK_EXCLUSIVE);
|
LockBuffer(regBuf, BUFFER_LOCK_EXCLUSIVE);
|
||||||
regPg = BufferGetPage(regBuf);
|
regPg = BufferGetPage(regBuf);
|
||||||
|
/*
|
||||||
|
* We're only removing data, not reading it, so there's no need to
|
||||||
|
* TestForOldSnapshot here.
|
||||||
|
*/
|
||||||
|
|
||||||
/* if this is no longer a regular page, tell caller to start over */
|
/* if this is no longer a regular page, tell caller to start over */
|
||||||
if (!BRIN_IS_REGULAR_PAGE(regPg))
|
if (!BRIN_IS_REGULAR_PAGE(regPg))
|
||||||
@ -386,25 +389,14 @@ brinRevmapDesummarizeRange(Relation idxrel, BlockNumber heapBlk)
|
|||||||
ereport(ERROR,
|
ereport(ERROR,
|
||||||
(errcode(ERRCODE_INDEX_CORRUPTED),
|
(errcode(ERRCODE_INDEX_CORRUPTED),
|
||||||
errmsg("corrupted BRIN index: inconsistent range map")));
|
errmsg("corrupted BRIN index: inconsistent range map")));
|
||||||
tup = (BrinTuple *) PageGetItem(regPg, lp);
|
|
||||||
/* XXX apply sanity checks? Might as well delete a bogus tuple ... */
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* We're only removing data, not reading it, so there's no need to
|
* Placeholder tuples only appear during unfinished summarization, and we
|
||||||
* TestForOldSnapshot here.
|
* hold ShareUpdateExclusiveLock, so this function cannot run concurrently
|
||||||
|
* with that. So any placeholder tuples that exist are leftovers from a
|
||||||
|
* crashed or aborted summarization; remove them silently.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*
|
|
||||||
* Because of ShareUpdateExclusive lock, this function shouldn't run
|
|
||||||
* concurrently with summarization. Placeholder tuples can only exist as
|
|
||||||
* leftovers from crashed summarization, so if we detect any, we complain
|
|
||||||
* but proceed.
|
|
||||||
*/
|
|
||||||
if (BrinTupleIsPlaceholder(tup))
|
|
||||||
ereport(WARNING,
|
|
||||||
(errmsg("leftover placeholder tuple detected in BRIN index \"%s\", deleting",
|
|
||||||
RelationGetRelationName(idxrel))));
|
|
||||||
|
|
||||||
START_CRIT_SECTION();
|
START_CRIT_SECTION();
|
||||||
|
|
||||||
ItemPointerSetInvalid(&invalidIptr);
|
ItemPointerSetInvalid(&invalidIptr);
|
||||||
|
Loading…
Reference in New Issue
Block a user