From: | vignesh C <vignesh21(at)gmail(dot)com> |
---|---|
To: | Amit Kapila <amit(dot)kapila16(at)gmail(dot)com> |
Cc: | Nisha Moond <nisha(dot)moond412(at)gmail(dot)com>, Peter Smith <smithpb2250(at)gmail(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org> |
Subject: | Re: Improve error handling for invalid slots and ensure a same 'inactive_since' time for inactive slots |
Date: | 2025-01-30 14:02:16 |
Message-ID: | CALDaNm1ZUHnKm+PSjjqRrMxcLagrUTS6SADnEsQBfW8rMZFrDA@mail.gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
On Thu, 30 Jan 2025 at 16:02, Amit Kapila <amit(dot)kapila16(at)gmail(dot)com> wrote:
>
> I have made minor changes in the attached. The main change is to raise
> an ERROR before we broadcast to let everybody know we've modified this
> slot. There is no point in broadcasting if the slot is unusable.
>
> > - Updated the test files to match the new error message.
> >
>
> - /ERROR: cannot alter invalid replication slot "vacuum_full_inactiveslot"/
> + /ERROR: can no longer access replication slot "vacuum_full_inactiveslot"/
>
> - "can no longer get changes from replication slot
> \"shared_row_removal_activeslot\""
> + "can no longer access replication slot \"shared_row_removal_activeslot\""
>
> With the above changes, we made the ERROR message generic which was
> required to raise it from the central place. This looks reasonable to
> me. The other option that occurred to me is to write it as: "can no
> longer use replication slot "vacuum_full_inactiveslot" to access WAL
> or modify it" but I find the one used currently in the patch better as
> this is longer and may need modification in future if we start using
> slot for something else.
One of the test was failing because MyReplicationSlot was not set to s
before erroring out which resulted in:
TRAP: failed Assert("s->data.persistency == RS_TEMPORARY"), File:
"slot.c", Line: 777, PID: 280121
postgres: primary: walsender vignesh [local]
START_REPLICATION(ExceptionalCondition+0xbb)[0x578612cd9289]
postgres: primary: walsender vignesh [local]
START_REPLICATION(ReplicationSlotCleanup+0x12b)[0x578612a32348]
postgres: primary: walsender vignesh [local]
START_REPLICATION(WalSndErrorCleanup+0x5e)[0x578612a41995]
Fixed it by setting MyReplicationSlot just before erroring out so that
WalSndErrorCleanup function will have access to it. I also moved the
error reporting above as there is no need to check for slot is active
for pid in case of invalidated slots. The attached patch has the
changes for the same.
Regards,
Vignesh
Attachment | Content-Type | Size |
---|---|---|
v4-0001-Raise-Error-for-Invalid-Slots-in-ReplicationSlotA.patch | text/x-patch | 13.6 KB |
From | Date | Subject | |
---|---|---|---|
Next Message | Alvaro Herrera | 2025-01-30 15:29:35 | Re: why there is not VACUUM FULL CONCURRENTLY? |
Previous Message | Benoit Lobréau | 2025-01-30 13:51:24 | Re: Proposal to Enable/Disable Index using ALTER INDEX (with patch) |