Extension proposal to deal with existing orphaned files - Mailing list pgsql-hackers

From Drouvot, Bertrand
Subject Extension proposal to deal with existing orphaned files
Date
Msg-id 7ff08868-843a-c39c-c96d-7e7f77fe5f5c@amazon.com
Whole thread Raw
List pgsql-hackers

Hi hackers,

There is an ongoing effort of cleaning up orphaned files using undo logs [1].

Until this get implemented and databases get upgraded to the version(s) that will benefit from this ongoing work, one still need to handle orphaned files (if any).

I started to work on this subject some time ago by creating an extension that is able to list the orphaned files, see [2].

I have in mind to extend the extension capability to provide 4 more APIs to:

  • move orphaned files to a dedicated backup directory (that the extension will create on the fly)
  • list the files that are part of this backup directory
  • move back the files from this backup directory to their original location
  • remove files that are located in the backup directory

That would help dealing with existing orphaned files in a more secure way (means less error prone).

Would that make sense sharing this work with you and later add this extension in the contrib directory?

Thanks in advance for your feedback,
Bertrand

[1]: https://commitfest.postgresql.org/34/3228/

[2]: https://github.com/bdrouvot/pg_orphaned

pgsql-hackers by date:

Previous
From: Michael Paquier
Date:
Subject: Re: stat() vs ERROR_DELETE_PENDING, round N + 1
Next
From: Ronan Dunklau
Date:
Subject: Re: pg_receivewal starting position