diff options
author | Alvaro Herrera <alvherre@alvh.no-ip.org> | 2022-10-19 10:35:53 +0200 |
---|---|---|
committer | Alvaro Herrera <alvherre@alvh.no-ip.org> | 2022-10-19 10:37:06 +0200 |
commit | df3737a651f40a398c14348b0482e97031e7a7d4 (patch) | |
tree | 69ee6838c88bd709fd00de1edb5263db48079399 /src/backend/jit | |
parent | 9668c4a6618cc4a7a94f4bc0ad5685dd596bab63 (diff) | |
download | postgresql-df3737a651f40a398c14348b0482e97031e7a7d4.tar.gz |
Remove pg_backup_start_callback and reuse similar code
We had two copies of almost identical logic to revert shared memory
state when a running backup aborts; we can remove
pg_backup_start_callback if we adapt do_pg_abort_backup so that it can
be used for this purpose too.
However, in order for this to work, we have to repurpose the flag passed
to do_pg_abort_backup. It used to indicate whether to throw a warning
(and the only caller always passed true). It now indicates whether the
callback is being called at start time (in which case the session backup
state is known not to have been set to RUNNING yet, so action is always
taken) or shmem time (in which case action is only taken if the session
backup state is RUNNING). Thus the meaning of the flag is no longer
superfluous, but it's actually quite critical to get right. I (Álvaro)
chose to change the polarity and the code flow re. the flag from what
Bharath submitted, for coding clarity.
Co-authored-by: Bharath Rupireddy <bharath.rupireddyforpostgres@gmail.com>
Discussion: https://www.postgresql.org/message-id/20221013111330.564fk5tkwe3ha77l%40alvherre.pgsql
Diffstat (limited to 'src/backend/jit')
0 files changed, 0 insertions, 0 deletions