Re: promotion related handling in pg_sync_replication_slots() - Mailing list pgsql-hackers

From shveta malik
Subject Re: promotion related handling in pg_sync_replication_slots()
Date
Msg-id CAJpy0uA4td+ye1o7BiXJmEExrBtBbgFE5AK4Gg9zSyJwAnF0Qw@mail.gmail.com
Whole thread Raw
In response to Re: promotion related handling in pg_sync_replication_slots()  (shveta malik <shveta.malik@gmail.com>)
Responses Re: promotion related handling in pg_sync_replication_slots()
List pgsql-hackers
On Thu, Apr 18, 2024 at 12:35 PM shveta malik <shveta.malik@gmail.com> wrote:
>
> To fix above issues, these changes have been made in v7:

Please find v8 attached. Changes are:

1) It fixes ShutDownSlotSync() issue, where we perform
kill(SlotSyncCtx->pid). There are chances that after we release
spin-lock and before we perform kill, slot-sync worker has error-ed
out and has set SlotSyncCtx->pid to InvalidPid (-1) already. And thus
kill(-1) could result in abnormal process kills on some platforms.
Now, we get pid under spin-lock and then use it to perform kill to
avoid pid=-1 kill. This is on a similar line of how ShutdownWalRcv()
does it.

2) Improved comments in code.

3) Updated commit message with new fixes. I had missed to update it in
the previous version.

thanks
Shveta

Attachment

pgsql-hackers by date:

Previous
From: Aleksander Alekseev
Date:
Subject: Re: [PATCH] Replace magic constant 3 with NUM_MERGE_MATCH_KINDS
Next
From: Ranier Vilela
Date:
Subject: Re: plenty code is confused about function level static