Limit GIST_MAX_SPLIT_PAGES to XLR_MAX_BLOCK_ID

From: Gurjeet Singh <gurjeet(at)singh(dot)im>
To: Postgres Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Limit GIST_MAX_SPLIT_PAGES to XLR_MAX_BLOCK_ID
Date: 2015-09-21 02:03:43
Message-ID: CABwTF4UB5OgwBQb8Yj7=qXXb69qjFq5aVENamSbz4LA+Sw4eEw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Gin code respects the XLR_MAX_BLOCK_ID when
calling XLogEnsureRecordSpace(). But it appears that the Gist code does not
try to limit its block-id consumption to XLR_MAX_BLOCK_ID.

The GIST_MAX_SPLIT_PAGES is hard-coded at 75, but XLogEnsureRecordSpace()
would reject a request of more than 32 (XLR_MAX_BLOCK_ID).

The attached patch redefines GIST_MAX_SPLIT_PAGES so that in case of a
split, gistplacetopage() now throws an error when the block-ids needed
exceed 32.

I have used Min(75, XLR_MAX_BLOCK_ID) as the macro expansion, but I believe
it can be set to plain XLR_MAX_BLOCK_ID.

--
Gurjeet Singh http://gurjeet.singh.im/

Attachment Content-Type Size
gist_limit_blockid_to_XLR_MAX_BLOCK_ID.patch application/octet-stream 460 bytes

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2015-09-21 02:19:04 Re: row_security GUC, BYPASSRLS
Previous Message Robert Haas 2015-09-21 01:17:00 Re: RFC: replace pg_stat_activity.waiting with something more descriptive