Extension proposal to deal with existing orphaned files

From: "Drouvot, Bertrand" <bdrouvot(at)amazon(dot)com>
To: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Cc: <guillaume(at)lelarge(dot)info>
Subject: Extension proposal to deal with existing orphaned files
Date: 2021-09-06 06:47:57
Message-ID: 7ff08868-843a-c39c-c96d-7e7f77fe5f5c@amazon.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

Browse pgsql-hackers by date

  From Date Subject
Next Message Ronan Dunklau 2021-09-06 06:50:21 Re: pg_receivewal starting position
Previous Message Michael Paquier 2021-09-06 06:36:33 Re: stat() vs ERROR_DELETE_PENDING, round N + 1