Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit1f42d35

Browse files
committed
BRIN: Handle concurrent desummarization properly
If a page range is desummarized at just the right time concurrently withan index walk, BRIN would raise an error indicating index corruption.This is scary and unhelpful; silently returning that the page range isnot summarized is sufficient reaction.This bug was introduced by commit975ad4e as additional protectionagainst a bug whose actual fix was elsewhere. Backpatch equally.Reported-By: Anastasia Lubennikova <a.lubennikova@postgrespro.ru>Diagnosed-By: Alexander Lakhin <exclusion@gmail.com>Discussion:https://postgr.es/m/2588667e-d07d-7e10-74e2-7e1e46194491@postgrespro.ruBackpatch: 9.5 - master
1 parent3546cf8 commit1f42d35

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

‎src/backend/access/brin/brin_revmap.c

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -282,10 +282,17 @@ brinGetTupleForHeapBlock(BrinRevmap *revmap, BlockNumber heapBlk,
282282
/* If we land on a revmap page, start over */
283283
if (BRIN_IS_REGULAR_PAGE(page))
284284
{
285+
/*
286+
* If the offset number is greater than what's in the page, it's
287+
* possible that the range was desummarized concurrently. Just
288+
* return NULL to handle that case.
289+
*/
285290
if (*off>PageGetMaxOffsetNumber(page))
286-
ereport(ERROR,
287-
(errcode(ERRCODE_INDEX_CORRUPTED),
288-
errmsg_internal("corrupted BRIN index: inconsistent range map")));
291+
{
292+
LockBuffer(*buf,BUFFER_LOCK_UNLOCK);
293+
returnNULL;
294+
}
295+
289296
lp=PageGetItemId(page,*off);
290297
if (ItemIdIsUsed(lp))
291298
{

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp