Skip to content

pgbackrest archive process in repository host server hungs after database server failure #1726

Closed

Description

@chobostar
  1. pgBackRest version:
    2.35

  2. PostgreSQL version:
    12.4

  3. Operating system/version - if you have more than one server (for example, a database server, a repository host server, one or more standbys), please specify each:
    Linux 4.15.0-162-generic 170-Ubuntu x86_64 - database server.
    Linux 5.4.0-99-generic 112-Ubuntu x86_64 - repository host server

  4. Did you install pgBackRest from source or from a package?
    source

  5. Please attach the following as applicable:

    • pgbackrest.conf file(s)
      on repo host:
[sboxn]
pg1-host=dbhost.example.com
pg1-path=/var/lib/postgresql/12/main

[global]
repo1-path=/mnt/pgbackrest/repo
repo1-retention-full=2 
start-fast=y 
process-max=4
compress-type=gz

[global:archive-push]
compress-type=gz
archive_timeout=6000000

on dbhost:

[sboxn]
pg1-path=/var/lib/postgresql/12/main

[global]
log-level-file=detail
repo1-host=repohost.example.com
- `postgresql.conf` settings applicable to pgBackRest (`archive_command`, `archive_mode`, `listen_addresses`, `max_wal_senders`, `wal_level`, `port`)
 archive_command  | pgbackrest --stanza=sboxn archive-push  %p
 archive_mode     | on
 listen_addresses | 0.0.0.0
 max_wal_senders  | 5
 port             | 5432
 wal_level        | logical
- errors in the postgresql log file before or during the time you experienced the issue
ERROR: [103]: unable to find a valid repository:
       repo1: [LockAcquireError] raised from remote-0 protocol on 'repohost.example.com': unable to acquire lock on file '/tmp/pgbackrest/sboxn-archive.lock': Resource temporarily unavailable
       HINT: is another pgBackRest process running?
- log file in `/var/log/pgbackrest` for the commands run (e.g. `/var/log/pgbackrest/mystanza_backup.log`)

nothing

  1. Describe the issue:

Hunged pgbackrest process on repository server:

pgbackr+ 4172920 90.1  0.2  61764 11144 ?        Rs   08:26  17:33 pgbackrest --exec-id=148312-835f2d1a --log-level-console=off --log-level-file=off --log-level-stderr=error --process=0 --remote-type=repo --repo=1 --stanza=sboxn archive-push:remote

it holds lock file:

$ fuser /tmp/pgbackrest/sboxn-archive.lock 
/tmp/pgbackrest/sboxn-archive.lock: 4172920

and prevents archiving.

  • strace shows nothing
  • perf top output:
  22.91%  libc-2.31.so                                  [.] __vfprintf_internal
  16.79%  libc-2.31.so                                  [.] _IO_default_xsputn
   8.11%  libc-2.31.so                                  [.] __strncpy_avx2
   7.04%  libc-2.31.so                                  [.] __strchrnul_avx2
   5.39%  libc-2.31.so                                  [.] __vsnprintf_internal
   4.78%  libc-2.31.so                                  [.] __strlen_avx2
   3.87%  libc-2.31.so                                  [.] _IO_str_init_static_internal
   3.72%  libc-2.31.so                                  [.] _IO_old_init
   2.39%  pgbackrest                                    [.] stackTraceFmt
   2.12%  libc-2.31.so                                  [.] _IO_no_init
   1.88%  libc-2.31.so                                  [.] _IO_setb
   1.81%  pgbackrest                                    [.] stackTraceToZ
   1.50%  libc-2.31.so                                  [.] __memmove_avx_unaligned_erms
   0.88%  libpthread-2.31.so                            [.] __GI___pthread_cleanup_upto
   0.85%  pgbackrest                                    [.] errorInternalThrow
  • gdb shows:
protocolServerProcess ()

How to reproduce:

  1. generate WALs, for example with $ pgbench -i -s 100
  2. simulate OOM kill of postgres process just by $ kill -9 <any_pid_of_postgres>
  3. after postgres restart see the issue.

Activity

  1. changed the title [-]pgbackrest archive process in repository host server hungs in case of database server failure[/-] [+]pgbackrest archive process in repository host server hungs after database server failure[/+] on Apr 29, 2022
  2. self-assigned this
    on Apr 29, 2022
  3. dwsteele commented on Apr 29, 2022

    @dwsteele
    Member

    This was fixed in 2.36 and additional improvements were made in 2.37 and 2.38. Please let us know if you still see the issue after upgrading to 2.38.

  4. chobostar commented on May 3, 2022

    @chobostar
    Author

    Just tested in 2.38. I confirm it not reproduced and looks like fixed. Thanks!

  5. locked and limited conversation to collaborators on Aug 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions