Re: [HACKERS] Restricting maximum keep segments by repslots
Kyotaro Horiguchi <horikyota.ntt@gmail.com>
From: Kyotaro Horiguchi <horikyota.ntt@gmail.com>
To: alvherre@2ndquadrant.com
Cc: jgdr@dalibo.com, andres@anarazel.de, michael@paquier.xyz,
sawada.mshk@gmail.com, peter.eisentraut@2ndquadrant.com,
pgsql-hackers@lists.postgresql.org, thomas.munro@enterprisedb.com,
sk@zsrv.org, michael.paquier@gmail.com
Date: 2020-04-08T07:46:05Z
Lists: pgsql-hackers
Attachments
- 0001-Allow-MyLatch-of-checkpointer-for-other-use.patch (text/x-patch)
At Wed, 08 Apr 2020 14:19:56 +0900 (JST), Kyotaro Horiguchi <horikyota.ntt@gmail.com> wrote in > I saw another issue, the following sequence on the primary freezes > when invalidation happens. > > =# create table tt(); drop table tt; select pg_switch_wal();create table tt(); drop table tt; select pg_switch_wal();create table tt(); drop table tt; select pg_switch_wal(); checkpoint; > > The last checkpoint command is waiting for CV on > CheckpointerShmem->start_cv in RequestCheckpoint(), while Checkpointer > is waiting for the next latch at the end of > CheckpointerMain. new_started doesn't move but it is the same value > with old_started. > > That freeze didn't happen when I removed > ConditionVariableSleep(&s->active_cv) in > InvalidateObsoleteReplicationSlots. > > I continue investigating it. I understand how it happens. The latch triggered by checkpoint request by CHECKPOINT command has been absorbed by ConditionVariableSleep() in InvalidateObsoleteReplicationSlots. The attached allows checkpointer use MyLatch for other than checkpoint request while a checkpoint is running. regards. -- Kyotaro Horiguchi NTT Open Source Software Center
Commits
-
Save slot's restart_lsn when invalidated due to size
- 12e52ba5a76e 13.0 landed
- 0188bb82531f 14.0 landed
-
Fix checkpoint signalling
- 1816a1c6ffe4 13.0 landed
-
Check slot->restart_lsn validity in a few more places
- d0abe78d8427 13.0 landed
-
Allow users to limit storage reserved by replication slots
- c6550776394e 13.0 landed
-
Remove header noise from test_decoding test
- 69360b34589b 13.0 landed
-
Rework WAL-reading supporting structs
- 709d003fbd98 13.0 cited
-
Flip argument order in XLogSegNoOffsetToRecPtr
- a22445ff0be2 12.0 cited