Re: Flush some statistics within running transactions
Hi,
On 2026-01-30 15:37:57 +0100, Álvaro Herrera wrote:
I'm now wondering if CheckDeadLockAlert() really needed to have this in
the first place, or it was just an exercise in paranoia ... it was added
by commit 6753333f55e1, with the discussion in [1], and it's not clear
to me that there was any theoretical or experimental evidence that it
was necessary; the thread didn't discuss it, and the commit message
doesn't either. Added Andres to CC as committer to this thread, maybe
he remembers.
I don't remember. But back then way more complicated things were still running
in signal handlers, and some signal handlers were capable of interrupting
other signal handlers. Including doing crazy things like starting transactions
in signal handlers (e.g. to process notify interrupts), which in turn could
clear latches. So there was a lot more potential to stomp on each others work.
WRT the subject of this thread: I hope we aren't just enabling a timer to fire
once a second forever but only when there actually is outstanding work?
Greetings,
Andres Freund
Import Notes
Reply to msg id not found: 202601301359.pwvtc26izo5z@alvherre.pgsqlReference msg id not found: 202601301136.kvw5jklzhkru@alvherre.pgsqlReference msg id not found: 202601301359.pwvtc26izo5z@alvherre.pgsql
On 2026-Jan-30, Andres Freund wrote:
I don't remember. But back then way more complicated things were still running
in signal handlers, and some signal handlers were capable of interrupting
other signal handlers. Including doing crazy things like starting transactions
in signal handlers (e.g. to process notify interrupts), which in turn could
clear latches. So there was a lot more potential to stomp on each others work.
OK, thanks for clarifying. I think my proposal of moving the SetLatch()
needs more research, but it's likely the best way to address this
wrinkle.
WRT the subject of this thread: I hope we aren't just enabling a timer
to fire once a second forever but only when there actually is
outstanding work?
I hope so too. (Just to be clear, I'm not claiming $SUBJECT as its
potential committer, and haven't actually reviewed it.)
--
Álvaro Herrera Breisgau, Deutschland — https://www.EnterpriseDB.com/
"People get annoyed when you try to debug them." (Larry Wall)