Disk Usages Jumped From 61gb to 99 Gb and Rebuild Fails

Recently I tried to Update and Rebuild my Discourse site. But it is failing again and again as i do not have enough Space now.
my DISK is 100 GB
discourse have 61 gb database but when i try to Rebuild, It goes to 99GB disk usages.
Please help How to deal with it ?

We just enabled a major PostgreSQL upgrade, so this rebuild will need more space than usual.

2 Likes

how can i rebuild without Upgrade. I do not want to change the Discourse Version.Wants to stay in Old Version.
Version: 2.0.0… in app.yml

Is still causing the disk Get full.

I think that a warning is in order. I suspect that there are lots of people that don’t have room for two (or is it three?) copies of their database and will have no idea what’s happening or even how to restart their old functioning version.

2 Likes

Any ideas here @tgxworld?

What @Falco said is correct. We basically do a backup before upgrading PostgreSQL and the extra diskspace usage is due to the backup of the old PostgreSQL cluster which can be found in /shared/postgres_data_old

3 Likes

Perhaps we should warn about this up front somehow? Maybe even check for {x} disk space first and drop out if we don’t have it? Just for this DB upgrade path, which we surely will be using in the future as Postgres goes from version 10 to 11 → 20.

3 Likes

At a minimum we should teach launcher cleanup about these backup files

4 Likes

Could launcher know that Postgres needs to be updated to do require more disk space than it does normally?

For folks with a Digital Ocean 1GB droplet with 25GB of disk, it’s going to be tight.

Probably… its tricky. More like the upgrade script for the DB should explode prior to trying if it knows there is going to be not enough space @tgxworld

3 Likes

The Postgres upgrade can be put off for . . . a pretty long time, right?

For servers that are short on space, it’s possible to add space (whatever DO calls it’s extra storage), move PG there, do the upgrade, move it back, but it’s not for the feint of sysadminning (and not something for the upgrade script). If people had 6-12 months to accomplish it, that’d be pretty great.

Meanwhile, I can work on scripting at least pieces of that, so that I (or others) could offer a service to do the work and perhaps write a HOWTO for the DIY crowd.

Also, a 50GB SSD 2GB droplet now costs what the old 1GB droplet cost, so people could with minimal skills resize their old $10 1GB droplet to a 2GB droplet and do the upgrade automagically. If the script said “You should need X GB to upgrade” that’d be enough to give the hobbyist the info they need to successfully upgrade with the scripts already available.

6 Likes

I added a disk space before the upgrade script

6 Likes

We also got to do something in the cleanup script, otherwise people will carry this around for ever

We detected a backup of your database at … that is taking up 10GB, would you like to remove?

4 Likes

Just confirming, there is a lot of disk space consumed afterward too:

3 Likes

I hit this issue on a server with 6.1G of data in /var/discourse/shared/standalone/postgres_data and the following disk space:

df -h 
Filesystem      Size  Used Avail Use% Mounted on
/dev/vda2        44G   31G   11G  75% /

Am I right in understanding that a minimum of twice the space used by /var/discourse/shared/standalone/postgres_data is needed before the upgrade can run, half for a back and half for the database to upgrade?

4 Likes

Yes, more than 2x the current database size available as free space seems advisable cc @tgxworld

5 Likes

Can anybody tell me please, How can i trigger rebuild without Updating Discourse and Stop automatic Updates.
version: 2.0.1… line in app.yml is not working. I want to rebuilt but do not want my disk get full.

If you don not want to upgrade PostgreSQL at this moment, you can change postgres.template.yml to postgres.9.5.template.yml

6 Likes

Sorry Miss, That is still filling my disk space.

You may want to try these:

./launcher cleanup
./launcher rebuild app

and that probably would free up some disk space for you!

1 Like