본문으로 건너뛰기

6.2 Streaming backup과 WAL

backup_method = postgres는 PostgreSQL streaming protocol을 이용해 physical backup을 받습니다. WAL은 pg_receivewal 기반 streaming archiver 또는 archive command 방식으로 받을 수 있습니다.

Replication slot은 Barman이 받지 못한 WAL을 primary에 보존하지만, consumer가 멈추면 pg_wal이 계속 증가할 수 있습니다.

SELECT slot_name, active, restart_lsn,
pg_size_pretty(
pg_wal_lsn_diff(pg_current_wal_lsn(), restart_lsn)
) AS retained
FROM pg_replication_slots;

확인할 지표

  • WAL receiver 상태와 마지막 수신 시각
  • Slot retained bytes
  • Primary pg_wal filesystem 여유
  • Barman incoming과 archive queue
  • Backup host storage와 network latency

archive_timeout은 traffic이 적을 때 partially filled WAL segment를 archive로 보내는 최대 지연에 영향을 줍니다. 값이 작으면 RPO visibility는 좋아질 수 있지만 WAL file 수와 archive overhead가 늘어납니다.

Streaming과 archive command를 함께 구성할 때 duplicate segment 처리와 실패 우선순위를 이해합니다. 실제 barman check와 복구 시험으로 필요한 WAL이 완전한지 검증합니다.