回复:Orphan files filling root partition after crash

2024-03-25 Thread 赵宇鹏(宇彭)
11:15 收件人:"pgsql-general" 主 题:Orphan files filling root partition after crash Hello list, yesterday I was doing: ALTER TABLE x ADD UNIQUE ... , ADD PRIMARY KEY ...; The table is almost a billion rows long but lies in its own TABLESPACE that has plenty of space. But apparently the ALTER TA

Re: Orphan files filling root partition after crash

2024-03-03 Thread Laurenz Albe
On Mon, 2024-03-04 at 00:04 +0100, Peter J. Holzer wrote: > On 2024-02-28 20:30:35 +0100, Dimitrios Apostolou wrote: > > On Wed, 28 Feb 2024, Laurenz Albe wrote: > > > On Wed, 2024-02-28 at 12:16 +0100, Dimitrios Apostolou wrote: > > > > So what is the moral of the story? How to guard against this?

Re: Orphan files filling root partition after crash

2024-03-03 Thread Peter J. Holzer
On 2024-02-28 20:30:35 +0100, Dimitrios Apostolou wrote: > On Wed, 28 Feb 2024, Laurenz Albe wrote: > > On Wed, 2024-02-28 at 12:16 +0100, Dimitrios Apostolou wrote: > > > So what is the moral of the story? How to guard against this? > > > > Monitor disk usage ... > > It happened *fast*. And it w

Re: Orphan files filling root partition after crash

2024-02-28 Thread Laurenz Albe
On Wed, 2024-02-28 at 20:30 +0100, Dimitrios Apostolou wrote: > Lucky you.  It should have been "relfilenode" rather than "oid", > > and some catalog tables don't have their files listed in the catalog, > > because they are needed *before* the database can access tables. > > I actually double chec

Re: Orphan files filling root partition after crash

2024-02-28 Thread Adrian Klaver
On 2/28/24 11:30, Dimitrios Apostolou wrote: Thanks for the feedback Laurenz, On Wed, 28 Feb 2024, Laurenz Albe wrote: On Wed, 2024-02-28 at 12:16 +0100, Dimitrios Apostolou wrote: I ended up doing some risky actions to remediate the problem: Find the filenames that have no identically named

Re: Orphan files filling root partition after crash

2024-02-28 Thread Dimitrios Apostolou
Thanks for the feedback Laurenz, On Wed, 28 Feb 2024, Laurenz Albe wrote: On Wed, 2024-02-28 at 12:16 +0100, Dimitrios Apostolou wrote: I ended up doing some risky actions to remediate the problem: Find the filenames that have no identically named "oid" in pg_class, and delete (move to backup

Re: Orphan files filling root partition after crash

2024-02-28 Thread Laurenz Albe
On Wed, 2024-02-28 at 12:16 +0100, Dimitrios Apostolou wrote: > yesterday I was doing: > > ALTER TABLE x ADD UNIQUE ... , ADD PRIMARY KEY ...; > > The table is almost a billion rows long but lies in its own TABLESPACE > that has plenty of space. But apparently the ALTER TABLE command is > writin

Re: Orphan files filling root partition after crash

2024-02-28 Thread Dimitrios Apostolou
Hi Sergey, On Wed, 28 Feb 2024, Sergey Fukanchik wrote: Hi Dimitrios, Do you have wal archiving enabled? $PGDATA/pg_wal/ is a bit different from tablespaces (including "default" one). It stores transaction journal. I don't think I have WAL archiving enabled. Here are the relevant WAL options

Re: Orphan files filling root partition after crash

2024-02-28 Thread Sergey Fukanchik
Hi Dimitrios, Do you have wal archiving enabled? $PGDATA/pg_wal/ is a bit different from tablespaces (including "default" one). It stores transaction journal. Instructions are here: https://www.postgresql.org/docs/current/continuous-archiving.html#BACKUP-ARCHIVING-WAL Some more info here: https://w

Orphan files filling root partition after crash

2024-02-28 Thread Dimitrios Apostolou
Hello list, yesterday I was doing: ALTER TABLE x ADD UNIQUE ... , ADD PRIMARY KEY ...; The table is almost a billion rows long but lies in its own TABLESPACE that has plenty of space. But apparently the ALTER TABLE command is writing a lot to the default tablespace (not the temp_tablespace, th