public inbox for [email protected]
help / color / mirror / Atom feedFrom: Shayon Mukherjee <[email protected]>
To: David Rowley <[email protected]>
Cc: Robert Haas <[email protected]>
Cc: Peter Eisentraut <[email protected]>
Cc: PostgreSQL Hackers <[email protected]>
Subject: Re: Proposal to Enable/Disable Index using ALTER INDEX (with patch)
Date: Wed, 16 Oct 2024 18:01:13 -0400
Message-ID: <[email protected]> (raw)
In-Reply-To: <[email protected]>
References: <CANqtF-oXKe0M=0QOih6H+sZRjE2BWAbkW_1+9nMEAMLxUJg5jA@mail.gmail.com>
<[email protected]>
<CA+TgmoZw+o3UpKVf-=-o-x4fC2A54buK6ogLwk-TZ4C6h2W_ww@mail.gmail.com>
<[email protected]>
<CAApHDvr1a4crBB2CwT6RoscGqwbp6s9_OakBTQg375eiPHg-RA@mail.gmail.com>
<CA+TgmoYGzg2tHJ=-HsCADnAFdDFYo5TdFCK4Hk0EE4v9xusqNA@mail.gmail.com>
<[email protected]>
<CA+TgmobJAAoYhAQdHzq7-oLW=w+b_cWONc0jZzK45ZGQNdnnjw@mail.gmail.com>
<CAApHDvq7iLSfNkxyMqGrqdync-3qCACBrcRD6vMKAEEoaEBn9g@mail.gmail.com>
<[email protected]>
<[email protected]>
> On Oct 16, 2024, at 2:15 PM, Shayon Mukherjee <[email protected]> wrote:
>
>
>> On Oct 16, 2024, at 12:19 PM, Shayon Mukherjee <[email protected]> wrote:
>>
>> - ALTER INDEX ... ENABLE/DISABLE performs an in-place update of the pg_index
>> catalog to protect against indcheckxmin [2] (older unrelated thread).
>
> Performing the in place update of the pg_index row from ATExecEnableDisableIndex using systable_inplace_update_begin was failing in CI weirdly but not on my local MacBook when running spec suite. I am also wondering what is causing the requirement [1] to update the row in-place vs say using CatalogTupleUpdate since using the later is working well locally + CI?
>
I believe I somewhat understand why the issue might be occurring, where CI is failing the create_index regression test and crashing (signal 6 in postmaster logs). I suspect it might be due to a segmentation fault or a similar issue.
IsInplaceUpdateOid is used in systable_inplace_update_begin (recently introduced), but it doesn’t yet support pg_index. Based on check_lock_if_inplace_updateable_rel in heapam.c and IsInplaceUpdateOid in catalog.c, introducing support for in-place updates via this new mechanism might not be straightforward for pg_index. It would require updating the callers to handle in-place updates and locks, I presume?
I did confirm that, based on the v2 PATCH, when not doing in-place updates on pg_index - it means that the xmin for pg_index would increment. I suppose there’s a risk of indcheckxmin being marked as TRUE when xmin exceeds, potentially causing an index to be accidentally skipped ? (I am not 100% sure)
I'll take some time to think this through and familiarize myself with the new systable_inplace_update_begin. In the meantime, aside from the in-place updates on pg_index, I would love to learn any first impressions or feedback on the patch folks may have.
Thank you,
Shayon
view thread (23+ messages) latest in thread
reply
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: [email protected]
Cc: [email protected], [email protected], [email protected], [email protected], [email protected]
Subject: Re: Proposal to Enable/Disable Index using ALTER INDEX (with patch)
In-Reply-To: <[email protected]>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox