Skip to content

Commit eaf15c5

Browse files
kongfanshenmy-ship-it
authored andcommitted
Fix: fix bug When the TDE feature is enabled, backend panic will cause the database to be in an abnormal state
When the backend process panics and the postmaster restarts the database, it is necessary to reinitialize the shared memory related to TDE and set the relevant global variables.
1 parent 9b84324 commit eaf15c5

1 file changed

Lines changed: 8 additions & 3 deletions

File tree

src/backend/postmaster/postmaster.c

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1541,9 +1541,6 @@ PostmasterMain(int argc, char *argv[])
15411541
}
15421542
#endif
15431543

1544-
InitializeKmgr();
1545-
InitializeBufferEncryption();
1546-
15471544
if (terminal_fd != -1)
15481545
close(terminal_fd);
15491546

@@ -3202,6 +3199,14 @@ reset_shared(void)
32023199
* clean up dead IPC objects if the postmaster crashes and is restarted.
32033200
*/
32043201
CreateSharedMemoryAndSemaphores();
3202+
3203+
/*
3204+
* When backend process crashes, postmaster restart database,
3205+
* we need to init kmgr share memory.
3206+
*/
3207+
InitializeKmgr();
3208+
InitializeBufferEncryption();
3209+
32053210
}
32063211

32073212

0 commit comments

Comments
 (0)