mirror of
https://github.com/postgres/postgres.git
synced 2025-05-29 00:03:09 -04:00
Don't rewrite _map files on the save_principal_key redo
We create a new WAL key during the extension init, which happens before the redo. This means that in case of a crash, pg_tde_save_principal_key_redo was rewriting a WAL _map file and destroying a newly created key. Since we emit an XLog record after the key was successfully written to the file (the file was created), we can safely assume that we should not change the file if it exists.
This commit is contained in:
parent
e735727c8e
commit
1fa786fa29
@ -309,7 +309,7 @@ pg_tde_save_principal_key_redo(const TDESignedPrincipalKeyInfo *signed_key_info)
|
||||
|
||||
LWLockAcquire(tde_lwlock_enc_keys(), LW_EXCLUSIVE);
|
||||
|
||||
map_fd = pg_tde_open_file_write(db_map_path, signed_key_info, true, &curr_pos);
|
||||
map_fd = pg_tde_open_file_write(db_map_path, signed_key_info, false, &curr_pos);
|
||||
close(map_fd);
|
||||
|
||||
LWLockRelease(tde_lwlock_enc_keys());
|
||||
|
Loading…
x
Reference in New Issue
Block a user