Re: error "can only drop stats once" brings down database
Michael Paquier <michael@paquier.xyz>
From: Michael Paquier <michael@paquier.xyz>
To: Kyotaro Horiguchi <horikyota.ntt@gmail.com>
Cc: florisvannee@optiver.com, andres@anarazel.de, bertranddrouvot.pg@gmail.com, tgl@sss.pgh.pa.us, pgsql-bugs@lists.postgresql.org
Date: 2024-06-14T00:37:35Z
Lists: pgsql-bugs
On Tue, Jun 11, 2024 at 04:44:57PM +0900, Kyotaro Horiguchi wrote: > We don't simply allow double-drop; instead, we permit this kind of > behavior only during recovery by signaling the redo-execution > functions with the parameter isRedo, like smgr_unlink(). Still, the case is different here, no? Recovery forgives unlinks as long as we are in crash recovery, or consistency has not been reached on a standby. This case is different: we are in a consistent state and a backend on the standby still holds references to the stats entry that is transparently reused after a wraparound. I am wondering if we should tackle this problem by adding a notion of "age" in the stats entries for what's stored in the central dshash and in the hold copies in the backends, so as we dump the "age" of an existing stats entry if we find out that it gets reused in a create path. That requires some design and would not be backpatchable, but it does not seem that invasive at quick glance (I had my eyes on this code the full week). Other thoughts are welcome. -- Michael
Commits
-
Add more debugging information when dropping twice pgstats entry
- 2de059de2c2d 15.8 landed
- 83f415e2d92e 16.4 landed
- d92573adcb02 17.0 landed