walkdir does not honor elevel because of call to AllocateDir,possibly causing issues in abort handler - Mailing list pgsql-hackers

From Jelte Fennema
Subject walkdir does not honor elevel because of call to AllocateDir,possibly causing issues in abort handler
Date
Msg-id HE1PR83MB0218D385BCA08C32F0B10163F7830@HE1PR83MB0218.EURPRD83.prod.outlook.com
Whole thread Raw
List pgsql-hackers
walkdir is used indirectly in the abort handler of SharedFileSetOnDetach, which has the following comment:

/*
* Callback function that will be invoked when this backend detaches from a
* DSM segment holding a SharedFileSet that it has created or attached to. If
* we are the last to detach, then try to remove the directories and
* everything in them. We can't raise an error on failures, because this runs
* in error cleanup paths.
*/

walkdir itself has elevel, which is set to LOG in that case, so it should ot throw an ERROR.

The fix seems simple enough: AllocateDir and reserveAllocatedDesc should take an elevel argument and honor that. To not change the signature of AllocateDir and possibly break extions, it could simply become a wrapper of a new function like AllocateDirWithElevel(dirname, ERROR).

pgsql-hackers by date:

Previous
From: Odin Ugedal
Date:
Subject: Re: [PATCH] Add support for choosing huge page size
Next
From: Amit Khandekar
Date:
Subject: Re: Auto-vectorization speeds up multiplication of large-precision numerics