Barman Sync stage : 2/3 WAL Sent (min) issue

193 views
Skip to first unread message

Vasileios Lagadas

unread,
Nov 10, 2021, 4:18:01 AM11/10/21
to Barman, Backup and Recovery Manager for PostgreSQL
Hi all ,

i use barman for backing up a patroni cluster .

I will give you the result of barman replication-status which concerns me .

. Async WAL streamer
     Application name: barman_receive_wal
     Sync stage      : 2/3 WAL Sent (min)
     Communication   : TCP/IP
     IP Address      : **.**.**.** / Port: 38564 / Host: NAS
     User name       : barman
     Current state   : streaming (async)
     WAL sender PID  : 870381
     Started at      : 2021-11-10 11:10:49.114346+03:00
     Sent LSN   : 38/FB87CF20 (diff: 0 B)
     Write LSN  : 38/FB84C4B0 (diff: -194.6 KiB)

The thing is sometimes the Sync stage is 3/3 Remote write and most of the times is like above . And with this Sync stage the backup taken is not a good one .

How can this be solved and always have Sync stage   : 3/3 Remote write with no difference on  Write LSN  (diff: 0 B)

Because even when backup is taken it shows different location than the Current LSN on master .

Thank you in advance .

Vasileios Lagadas

unread,
Nov 23, 2021, 4:46:19 AM11/23/21
to Barman, Backup and Recovery Manager for PostgreSQL
Just a clarification because i see no answer yet . Everything is working smooth . I just want to know if Sync stage : 2/3 WAL Sent (min)  is an issue or it is ok ? Because when we give barman replication-status  sometimes we see 2/3 sometimes 3/3 . Why is  this happening and what is the right value that we must see always on Sync stage : ?

Barman check is ok as you can see .

barman check DB1
Server DB1:
        PostgreSQL: OK
        superuser or standard user with backup privileges: OK
        PostgreSQL streaming: OK
        wal_level: OK
        directories: OK
        retention policy settings: OK
        backup maximum age: OK (no last_backup_maximum_age provided)
        compression settings: OK
        failed backups: OK (there are 0 failed backups)
        minimum redundancy requirements: OK (have 3 backups, expected at least 0)
        ssh: OK (PostgreSQL server)
        systemid coherence: OK
        pg_receivexlog: OK
        pg_receivexlog compatible: OK
        receive-wal running: OK
        archive_mode: OK
        archive_command: OK
        continuous archiving: OK
        archiver errors: OK

Michael Wallace

unread,
Nov 23, 2021, 7:08:13 AM11/23/21
to pgba...@googlegroups.com
Hi Vasileios,

"2/3 WAL Sent (min)" means that the latest WAL on the primary has been sent to the standby but not yet written to disk on the standby. If the primary is constantly receiving writes then this does not indicate a problem as there will be some delay between the standby between receiving WALs and the standby flushing WALs to disk.

Other possible `Sync stage` values for a WAL streaming standby are:

- "3/3 Remote write": The latest WAL on the primary has been written to disk on the standby.
- "1/3 1-safe": The latest WAL on the primary has not yet been sent to the standby.

If the replication process is healthy you can expect to see `Sync stage` fluctuate between "2/3 WAL Sent (min)" and "3/3 Remote write".

For reference, these stages are determined from the values of `sent_lsn` and `write_lsn` as reported by pg_stat_replication (see https://www.postgresql.org/docs/14/monitoring-stats.html#MONITORING-PG-STAT-REPLICATION-VIEW).

Hope this helps,

Mike

--
--
You received this message because you are subscribed to the "Barman for PostgreSQL" group.
To post to this group, send email to pgba...@googlegroups.com
To unsubscribe from this group, send email to
pgbarman+u...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/pgbarman?hl=en?hl=en-GB

---
You received this message because you are subscribed to the Google Groups "Barman, Backup and Recovery Manager for PostgreSQL" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pgbarman+u...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/pgbarman/d56759ca-a35c-4af3-a9c9-d7463d9eeec6n%40googlegroups.com.

Vasileios Lagadas

unread,
Nov 23, 2021, 7:51:04 AM11/23/21
to Barman, Backup and Recovery Manager for PostgreSQL
Thank you very much for your answer . Now it is cleared for me . Really appreciated .
Reply all
Reply to author
Forward
0 new messages