Re: BUG #17449: Disk space not released

From: Jeff Janes <jeff(dot)janes(at)gmail(dot)com>
To: Giorgio Saviane <gsaviane(at)gmail(dot)com>
Cc: Bharath Rupireddy <bharath(dot)rupireddyforpostgres(at)gmail(dot)com>, PostgreSQL mailing lists <pgsql-bugs(at)lists(dot)postgresql(dot)org>
Subject: Re: BUG #17449: Disk space not released
Date: 2022-06-02 02:51:26
Message-ID: CAMkU=1yeu-ERPy8AK9nyNrHZKFENa740t7_y9MoAP7Biyv5N+w@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

On Tue, May 31, 2022 at 5:26 AM Giorgio Saviane <gsaviane(at)gmail(dot)com> wrote:

> >>
> >> >>>
> >> >>> > Despite any attempt
> >> >>> > of full vacuum the discrepancy remained the same. I suspect that
> Postgres
> >> >>> > started leaking disk space. I could see many 1Gb files with a
> timestamp of
> >> >>> > two months back in time in the postgres data folder.
> >> >
> >> >
> >> > If the database suffers a crash (or immediate shutdown) in the middle
> of something like VACUUM FULL or CLUSTER, it might leave orphaned
> in-process files such as the ones you describe behind and have no way to
> know to clean them up. The knowledge about what it was working on just
> before the crash was lost in the crash.
> >> >
> >> > Files not touched in 2 months and also not referenced in
> pg_class.relfilenode are almost certainly such orphaned files and could,
> with extreme nervousness, be cleaned up by hand. Especially if the
> human-readable log files support a crash having happened at that time.
> >>
> >> That was not the case. The server has been running seamlessly since I
> >> rebuilt the master.
> >
> >
> > But as i understand it, you rebuilt the master as a response to the
> problem, so the time period in question is before the rebuild, not after.
> >
>
> Yes, but then after the master was rebuilt it happened that the master
> started logging "requested WAL segment XXX has already been removed"
> again.
>

It is expected that the replica will be out of sync after the master is
rebuilt, and will need to be recreated. If it had happened before the
rebuild, that might indicate something interesting. We don't know what
caused the problem to start with, but there is no indication it is a bug,
rather than just an unfortunately timed crash/immediate shutdown/power
failure.

Cheers,

Jeff

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Michael Paquier 2022-06-02 05:39:41 Re: BUG #17504: psql --single-transaction -vON_ERROR_STOP=1 still commits after client-side error
Previous Message PG Bug reporting form 2022-06-02 02:02:38 BUG #17508: ja.po for pg_ctl has an obvious mistake