Re: Race condition in SyncRepGetSyncStandbysPriority
Kyotaro Horiguchi <horikyota.ntt@gmail.com>
From: Kyotaro Horiguchi <horikyota.ntt@gmail.com>
To: tgl@sss.pgh.pa.us
Cc: masahiko.sawada@2ndquadrant.com, masao.fujii@oss.nttdata.com,
pgsql-hackers@lists.postgresql.org
Date: 2020-04-13T06:34:24Z
Lists: pgsql-hackers
At Mon, 13 Apr 2020 15:31:01 +0900 (JST), Kyotaro Horiguchi <horikyota.ntt@gmail.com> wrote in > At Sat, 11 Apr 2020 18:30:30 -0400, Tom Lane <tgl@sss.pgh.pa.us> wrote in > > The point that I was trying to make originally is that it seems quite > > insane to imagine that a walsender's sync_standby_priority value is > > somehow more stable than the very existence of the process. Yet we > > only require a walsender to lock its own mutex while claiming or > > disowning its WalSnd entry (by setting or clearing the pid field). > > So I think it's nuts to define those fields as being protected by > > the global SyncRepLock. > > Right. FWIW, furthermore, even SyncRepConfig->syncrep_method can be > inconsistent among walsenders. I haven't thought that it can be > relied on as always consistent and it is enough that it makes a > consistent result only while the setting and the set of walsenders is > stable. Yes, the sentene "and (I haven't thought that) it is enough .." is a mistake of "and I have thought that it is enough that..". regards. -- Kyotaro Horiguchi NTT Open Source Software Center
Commits
-
Fix race conditions in synchronous standby management.
- c65c1aa82105 9.6.18 landed
- f332241a60aa 13.0 landed
- b3fa6d016d82 11.8 landed
- 63ecdaf758c5 10.13 landed
- 00ef5d52c577 12.3 landed
-
When WalSndCaughtUp, sleep only in WalSndWaitForWal().
- 421685812290 13.0 cited