This is an automated email from the ASF dual-hosted git repository.

maxyang pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/cloudberry.git


The following commit(s) were added to refs/heads/main by this push:
     new eaf15c53036 Fix: fix bug When the TDE feature is enabled, backend 
panic will cause the database to be in an abnormal state
eaf15c53036 is described below

commit eaf15c53036d9346e6b68ade419085f72917dbe0
Author: kongfanshen <[email protected]>
AuthorDate: Mon Oct 27 17:29:29 2025 +0800

    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.
---
 src/backend/postmaster/postmaster.c | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/src/backend/postmaster/postmaster.c 
b/src/backend/postmaster/postmaster.c
index 5c11b8125f9..92e830164e8 100644
--- a/src/backend/postmaster/postmaster.c
+++ b/src/backend/postmaster/postmaster.c
@@ -1541,9 +1541,6 @@ PostmasterMain(int argc, char *argv[])
        }
 #endif
 
-       InitializeKmgr();
-       InitializeBufferEncryption();
-
        if (terminal_fd != -1)
                close(terminal_fd);
 
@@ -3202,6 +3199,14 @@ reset_shared(void)
         * clean up dead IPC objects if the postmaster crashes and is restarted.
         */
        CreateSharedMemoryAndSemaphores();
+
+       /*
+        * When backend process crashes, postmaster restart database,
+        * we need to init kmgr share memory.
+        */
+       InitializeKmgr();
+       InitializeBufferEncryption();
+
 }
 
 


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to