Using XLogFileNameP in critical section - Mailing list pgsql-hackers

From Masahiko Sawada
Subject Using XLogFileNameP in critical section
Date
Msg-id CA+fd4k5gC9H4uoWMLg9K_QfNrnkkdEw+-AFveob9YX7z8JnKTA@mail.gmail.com
Whole thread Raw
Responses Re: Using XLogFileNameP in critical section  (Michael Paquier <michael@paquier.xyz>)
List pgsql-hackers
Hi,

I encountered that the assertion error is reported instead of a proper
PANIC message when failed to fsync WAL. The cause is that there are
multiple places where we call XLogFileNameP function that calls palloc
during critical section, for example XLogWrite function.

TRAP: FailedAssertion("CritSectionCount == 0 ||
(context)->allowInCritSection", File: "mcxt.c", Line: 956)

As far as I can see there are five places we need to fix.I've attached a patch.

Regards,

--
Masahiko Sawada            http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

Attachment

pgsql-hackers by date:

Previous
From: Amit Langote
Date:
Subject: Re: pgbench -i progress output on terminal
Next
From: David Fetter
Date:
Subject: Make autovacuum sort tables in descending order of xid_age