Thread: Free disk space decreasing after running Vaccum Full

Free disk space decreasing after running Vaccum Full

From
Sabyasachi Mukherjee
Date:
Hello All,
The disk space is decreasing drastically after running "Vaccum Full".
I was expecting increase of free disk space after running those commands. I am on Postgresql 16.1
Any guidance/advise?

Sabyasachi Mukherjee

Re: Free disk space decreasing after running Vaccum Full

From
Idelette Tchakounte
Date:
Yes it will decrease as it removes the fragmentation and dirty from existing table.

If you're in cloud environment, it can be done easily from cloud console

body,p,li,div{mso-style-name:signature365-maynzkau;mso-style-priority:99;margin:0cm;color:black}a{mso-style-name:signature365-link-maynzkau;mso-style-priority:99;text-decoration:underline;color:blue;}
ACTIdelette Tchakounte
Sr Database Administrator
Advanced Call Center Technologies, LLC
itchakounte@acttoday.com


From: Sabyasachi Mukherjee <mukherjee.sabyasachi@outlook.com>
Sent: Friday, June 28, 2024 9:58:34 AM
To: pgsql-admin@postgresql.org <pgsql-admin@postgresql.org>; pgsql-admin@lists.postgresql.org <pgsql-admin@lists.postgresql.org>
Subject: Free disk space decreasing after running Vaccum Full
 
CAUTION

This is an external email originating from outside of ACT; do not click links or open attachments unless you know the content is safe.


Hello All,
The disk space is decreasing drastically after running "Vaccum Full".
I was expecting increase of free disk space after running those commands. I am on Postgresql 16.1
Any guidance/advise?

Sabyasachi Mukherjee
Attachment

Re: Free disk space decreasing after running Vaccum Full

From
Ron Johnson
Date:
On Fri, Jun 28, 2024 at 9:58 AM Sabyasachi Mukherjee <mukherjee.sabyasachi@outlook.com> wrote:
Hello All,
The disk space is decreasing drastically after running "Vaccum Full".
I was expecting increase of free disk space after running those commands. I am on Postgresql 16.1
Any guidance/advise?

1. Tell us the exact command(s) that you ran.
2. Why 16.1 instead of 16.3?

Re: Free disk space decreasing after running Vaccum Full

From
Ron Johnson
Date:
On Fri, Jun 28, 2024 at 9:58 AM Sabyasachi Mukherjee <mukherjee.sabyasachi@outlook.com> wrote:
Hello All,
The disk space is decreasing drastically after running "Vaccum Full".
I was expecting increase of free disk space after running those commands. I am on Postgresql 16.1
Any guidance/advise?
 
3. VACUUM FULL should only be run after deleting or updating a significant portion of a table.

Re: Free disk space decreasing after running Vaccum Full

From
Wells Oliver
Date:
VACUUM FULL is designed to release disk space back to the OS by rebuilding the table. Unless I misunderstand, this is the effect and desired intent.

On Fri, Jun 28, 2024 at 7:53 AM Ron Johnson <ronljohnsonjr@gmail.com> wrote:
On Fri, Jun 28, 2024 at 9:58 AM Sabyasachi Mukherjee <mukherjee.sabyasachi@outlook.com> wrote:
Hello All,
The disk space is decreasing drastically after running "Vaccum Full".
I was expecting increase of free disk space after running those commands. I am on Postgresql 16.1
Any guidance/advise?
 
3. VACUUM FULL should only be run after deleting or updating a significant portion of a table.


--

Re: Free disk space decreasing after running Vaccum Full

From
Sabyasachi Mukherjee
Date:
Hello , 
Thanks for your response. I am running vacuum full schema_name.table_name.
And after each table run - the amount of free space in the disk in decreasing.
Though I am not deleting any rows from the table.

Sabyasachi Mukherjee
Press Alt+Down for more options



From: Wells Oliver <wells.oliver@gmail.com>
Sent: 28 June 2024 17:57
To: Ron Johnson <ronljohnsonjr@gmail.com>
Cc: Pgsql-admin <pgsql-admin@lists.postgresql.org>
Subject: Re: Free disk space decreasing after running Vaccum Full
 
VACUUM FULL is designed to release disk space back to the OS by rebuilding the table. Unless I misunderstand, this is the effect and desired intent.

On Fri, Jun 28, 2024 at 7:53 AM Ron Johnson <ronljohnsonjr@gmail.com> wrote:
On Fri, Jun 28, 2024 at 9:58 AM Sabyasachi Mukherjee <mukherjee.sabyasachi@outlook.com> wrote:
Hello All,
The disk space is decreasing drastically after running "Vaccum Full".
I was expecting increase of free disk space after running those commands. I am on Postgresql 16.1
Any guidance/advise?
 
3. VACUUM FULL should only be run after deleting or updating a significant portion of a table.


--

Re: Free disk space decreasing after running Vaccum Full

From
Scott Ribe
Date:
Perhaps WAL is accumulating from those table rewrites. Could be your WAL settings, and that the WAL will get reused
eventually,which is no problem. Could be you have WAL archiving or replication slots, and archiving or replication is
broken,and WAL will accumulate until it fills the disk. 

That needs to be looked at. But the question still remains as to why you are running VACUUM FULL?


Re: Free disk space decreasing after running Vaccum Full

From
Sabyasachi Mukherjee
Date:
I think Scott has a point. I do have a broken logical replication. And the replication is done on the same physical server. I will try to stop that replication.


From: Scott Ribe <scott_ribe@elevated-dev.com>
Sent: 28 June 2024 18:14
To: Sabyasachi Mukherjee <mukherjee.sabyasachi@outlook.com>
Cc: Wells Oliver <wells.oliver@gmail.com>; Ron Johnson <ronljohnsonjr@gmail.com>; Pgsql-admin <pgsql-admin@lists.postgresql.org>
Subject: Re: Free disk space decreasing after running Vaccum Full
 
Perhaps WAL is accumulating from those table rewrites. Could be your WAL settings, and that the WAL will get reused eventually, which is no problem. Could be you have WAL archiving or replication slots, and archiving or replication is broken, and WAL will accumulate until it fills the disk.

That needs to be looked at. But the question still remains as to why you are running VACUUM FULL?

Re: Free disk space decreasing after running Vaccum Full

From
Sabyasachi Mukherjee
Date:
Or I have to find a way to fix that replication. May be you can help me with that as well -
One error is as follows 
2024-06-28 18:44:38.296 CEST [10000] STATEMENT:  CREATE_REPLICATION_SLOT "pg_23568_sync_22182_7319873232440752272" LOGICAL pgoutput (SNAPSHOT 'use')
2024-06-28 18:44:38.318 CEST [11428] ERROR:  duplicate key value violates unique constraint "bgw_job_stat_pkey"
2024-06-28 18:44:38.318 CEST [11428] DETAIL:  Key (job_id)=(1) already exists.

The second error is - 
2024-06-28 18:44:38.318 CEST [11428] CONTEXT:  COPY bgw_job_stat, line 1
2024-06-28 18:44:38.337 CEST [4324] LOG:  logical decoding found consistent point at 9D/AE199788
2024-06-28 18:44:38.337 CEST [4324] DETAIL:  There are no running transactions.
2024-06-28 18:44:38.337 CEST [4324] STATEMENT:  CREATE_REPLICATION_SLOT "pg_23568_sync_22389_7319873232440752272" LOGICAL pgoutput (SNAPSHOT 'use')
2024-06-28 18:44:38.355 CEST [4324] ERROR:  syntax error at or near ")" at character 46
2024-06-28 18:44:38.355 CEST [4324] STATEMENT:  COPY _timescaledb_cache.cache_inval_bgw_job () TO STDOUT
2024-06-28 18:44:38.355 CEST [10676] ERROR:  could not start initial contents copy for table "_timescaledb_cache.cache_inval_bgw_job": ERROR:  syntax error at or near ")"
      LINE 1: COPY _timescaledb_cache.cache_inval_bgw_job () TO STDOUT

Note I have timescale DB installed in the DB as well.

Some pointers would be helpful.

Sabyasachi Mukherjee

From: Sabyasachi Mukherjee <mukherjee.sabyasachi@outlook.com>
Sent: 28 June 2024 18:23
To: Scott Ribe <scott_ribe@elevated-dev.com>
Cc: Wells Oliver <wells.oliver@gmail.com>; Ron Johnson <ronljohnsonjr@gmail.com>; Pgsql-admin <pgsql-admin@lists.postgresql.org>
Subject: Re: Free disk space decreasing after running Vaccum Full
 
I think Scott has a point. I do have a broken logical replication. And the replication is done on the same physical server. I will try to stop that replication.


From: Scott Ribe <scott_ribe@elevated-dev.com>
Sent: 28 June 2024 18:14
To: Sabyasachi Mukherjee <mukherjee.sabyasachi@outlook.com>
Cc: Wells Oliver <wells.oliver@gmail.com>; Ron Johnson <ronljohnsonjr@gmail.com>; Pgsql-admin <pgsql-admin@lists.postgresql.org>
Subject: Re: Free disk space decreasing after running Vaccum Full
 
Perhaps WAL is accumulating from those table rewrites. Could be your WAL settings, and that the WAL will get reused eventually, which is no problem. Could be you have WAL archiving or replication slots, and archiving or replication is broken, and WAL will accumulate until it fills the disk.

That needs to be looked at. But the question still remains as to why you are running VACUUM FULL?