]> git.ipfire.org Git - thirdparty/postgresql.git/commit
Fix assertion failure and segmentation fault in backup code.
authorFujii Masao <fujii@postgresql.org>
Tue, 12 Jul 2022 02:53:29 +0000 (11:53 +0900)
committerFujii Masao <fujii@postgresql.org>
Wed, 20 Jul 2022 00:54:10 +0000 (09:54 +0900)
commit80c3ea918526378b00b7c90918e7f980c2799e1c
tree247a875fc9ba47263e0e788d407b80731056d5ee
parent87e504487740b4301781f0cd09000f70430ca830
Fix assertion failure and segmentation fault in backup code.

When a non-exclusive backup is canceled, do_pg_abort_backup() is called
and resets some variables set by pg_backup_start (pg_start_backup in v14
or before). But previously it forgot to reset the session state indicating
whether a non-exclusive backup is in progress or not in this session.

This issue could cause an assertion failure when the session running
BASE_BACKUP is terminated after it executed pg_backup_start and
pg_backup_stop (pg_stop_backup in v14 or before). Also it could cause
a segmentation fault when pg_backup_stop is called after BASE_BACKUP
in the same session is canceled.

This commit fixes the issue by making do_pg_abort_backup reset
that session state.

Back-patch to all supported branches.

Author: Fujii Masao
Reviewed-by: Kyotaro Horiguchi, Masahiko Sawada, Michael Paquier, Robert Haas
Discussion: https://postgr.es/m/3374718f-9fbf-a950-6d66-d973e027f44c@oss.nttdata.com
src/backend/access/transam/xlog.c