Re: postgrsql 9.5: Old WAL files remain in secondary `pg_xlog`

From: Mohan NBSPS <mohan(dot)nbs(dot)ont(at)gmail(dot)com>
To: Kashif Zeeshan <kashi(dot)zeeshan(at)gmail(dot)com>
Cc: pgsql-admin(at)lists(dot)postgresql(dot)org
Subject: Re: postgrsql 9.5: Old WAL files remain in secondary `pg_xlog`
Date: 2024-06-05 00:08:32
Message-ID: CAPCvfWdbZHwwWH+xjFLu2_NAo3c5U0ir0cQBHpAMGU7Akk9AZw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

thank you.
the replication seems to work.

sorry, my question was incomplete.
I see few very old (over 2 years) WAL files remain in the secondary
(primary is clean with only
new WAL files).

On Sun, Jun 2, 2024 at 7:48 AM Kashif Zeeshan <kashi(dot)zeeshan(at)gmail(dot)com>
wrote:

> Hi Mohsn
>
> There can be multiple reasons for that.
>
> 1. If the archiving process on the standby is not working correctly, old
> WAL files will not be removed.
> 2. Ensure that the configuration settings for WAL management are correctly
> set on both primary and standby
> 3. If checkpoints are not happening frequently enough, WAL files will
> accumulate.
>
> To diagnose the issue
>
> 1. Ensure that the replication between the primary and the standby is
> working correctly.
>
> On Primary Server
> SELECT client_addr, state, sent_lsn, write_lsn, flush_lsn, replay_lsn
> FROM pg_stat_replication;
>
> On Standby Server
> SELECT pg_last_wal_receive_lsn(), pg_last_wal_replay_lsn();
>
>
> 2. Check if the archiving process on the standby is working properly. Look
> for any errors or warnings in the PostgreSQL logs related to WAL archiving.
> 3. Ensure that the standby server has the correct restore command
> configured to fetch the archived WAL files.
>
>
> Regards
> Kashif Zeeshan
> Bitnine Global
>
>
>
> On Sat, Jun 1, 2024 at 4:01 AM Mohan NBSPS <mohan(dot)nbs(dot)ont(at)gmail(dot)com>
> wrote:
>
>> Hello Community,
>>
>> Although the WAL retaining settings are default (max size 1GB),
>> `wal_keep_segments` is 25, checkpoint target is 2.5 minutes(default).
>> I noticed a few WAL files in secondary nodes (streaming replication)
>> `pg_xlog`
>> folder.
>>
>> What could be the reason why postgresql did not delete these ?
>>
>> Thank you
>> Regards
>> Mohan
>>
>

In response to

Browse pgsql-admin by date

  From Date Subject
Next Message Mohan NBSPS 2024-06-05 00:09:31 Re: postgrsql 9.5: Old WAL files remain in secondary `pg_xlog`
Previous Message Mohan NBSPS 2024-06-05 00:08:10 Re: postgrsql 9.5: Old WAL files remain in secondary `pg_xlog`