Skip to content

pghoard basebackup_incoming is keeping old dated folder that is occupying database node disk space #633

Description

@desorenp

I have the following pghoard configuration , and should be having only 2 pg_basebackups and noticed that the disk is having multiple old dates pg_basebackups.

Could you kindly suggest the correct configuration how to maintain only the required number of pg_basebackups

pghoard_restore list-basebackups --config /var/lib/pghoard/pghoard.json
Available 'default' basebackups:

Basebackup Backup size Orig size Start time


default/basebackup/2024-10-08_07-24_0 357 MB 3889 MB 2024-10-08T07:25:02Z
default/basebackup/2024-10-09_07-25_0 356 MB 3879 MB 2024-10-09T07:25:05Z

[postgres@SHTVNFODB02 ~]$ ls -lrt /data/pghoard/temp_data/default/basebackup_incoming/
total 0
drwxr-xr-x. 2 postgres postgres 45 Sep 1 15:21 2024-09-01_07-20_0
drwxr-xr-x. 2 postgres postgres 45 Sep 2 15:21 2024-09-02_07-20_0
drwxr-xr-x. 2 postgres postgres 45 Sep 3 15:21 2024-09-03_07-21_0
drwxr-xr-x. 2 postgres postgres 45 Sep 4 15:21 2024-09-04_07-21_0
drwxr-xr-x. 2 postgres postgres 45 Sep 5 15:21 2024-09-05_07-21_0
drwxr-xr-x. 2 postgres postgres 45 Sep 6 15:21 2024-09-06_07-21_0
drwxr-xr-x. 2 postgres postgres 45 Sep 7 15:21 2024-09-07_07-21_0
drwxr-xr-x. 2 postgres postgres 45 Sep 8 15:21 2024-09-08_07-21_0
drwxr-xr-x. 2 postgres postgres 45 Sep 9 15:21 2024-09-09_07-21_0
drwxr-xr-x. 2 postgres postgres 45 Sep 10 15:21 2024-09-10_07-21_0
drwxr-xr-x. 2 postgres postgres 45 Sep 11 15:21 2024-09-11_07-21_0
drwxr-xr-x. 2 postgres postgres 45 Sep 12 15:22 2024-09-12_07-21_0
drwxr-xr-x. 2 postgres postgres 45 Sep 13 15:22 2024-09-13_07-21_0

As per my understanding, pghoard stores the basebackup in a temporary location (/var/lib/pghoard/temp_data/default/basebackup_incoming/2024-10-10_07-25_0/base.tar) , and then uploading it to default/basebackup/2024-10-10_07-25_0 , but when it is trying to delete the temporary location, it is using a different location (/var/lib/pghoard/temp_data/default/basebackup/2024-10-10_07-25_0)

Below is the pghoard.json configuration :

{
    "backup_location": "/var/lib/pghoard/temp_data",
    "backup_sites": {
        "default": {
            "active_backup_mode": "pg_receivewal",
            "nodes": [
                {
                    "host": "127.0.0.1",
                    "password": "pghoard",
                    "port": 5432,
                    "user": "pghoard"
                }
            ],
            "object_storage": {
                "directory": "/var/lib/pghoard/backups",
                "storage_type": "local"
            },
            "pg_basebackup_path": "/usr/bin/pg_basebackup",
            "pg_bin_directory": "/usr/pgsql-16/bin",
            "pg_data_directory": "/var/lib/pgsql/16/data"
        }
    },
    "json_state_file_path": "/var/lib/pghoard/pghoard_state.json"

Could you suggest what's wrong in the configuration?


Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions