Re: Set 1s WaitLatch timeout if standby limit has expired in ResolveRecoveryConflictWithBufferPin - Mailing list pgsql-hackers

From shihao zhong
Subject Re: Set 1s WaitLatch timeout if standby limit has expired in ResolveRecoveryConflictWithBufferPin
Date
Msg-id CAGRkXqSn-PU-KwU6GwwhhJxZ8yyjioRf-kxzR0UrS5y_Hbk3yA@mail.gmail.com
Whole thread
In response to Re: Set 1s WaitLatch timeout if standby limit has expired in ResolveRecoveryConflictWithBufferPin  (Álvaro Herrera <alvherre@kurilemu.de>)
List pgsql-hackers
Hi,

I reviewed v2. The bug is real on master and v2 fixes it. With
Dmytro's steps, master never cancels the cursor session. With v2 it
gets FATAL about one second after it takes the pin.

I had a few small comments, so I just made the changes. v3 is
attached.

- It calls WaitLatch directly in standby.c, so proc.c and proc.h are
  not touched. That should be easier to backpatch.
- The comment no longer names PROCSIG_RECOVERY_CONFLICT_BUFFERPIN,
  which is gone since 17f51ea8187.
- The 1s is a define now, and the commit message is shorter.

The patch in [1] rewrites the same wait as a loop, so the two do not
apply together. Its expired path still sleeps with no timeout, so
this fix is still needed after it.

Attachment

pgsql-hackers by date:

Previous
From: shihao zhong
Date:
Subject: Re: Throwing away unnecessary spin-locks
Next
From: Michael Paquier
Date:
Subject: Re: pg_dump: ALTER INDEX SET STATISTICS missing for index-backed constraints