From c50993b2f7f5f25d0fa5b41ed219a04e2c9ebaea Mon Sep 17 00:00:00 2001 From: Ryan Leung Date: Tue, 9 Jul 2024 17:40:33 +0800 Subject: [PATCH] *: fix the initialization of encryption key manager (#8383) close tikv/pd#8384 Signed-off-by: Ryan Leung --- server/server.go | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/server/server.go b/server/server.go index a272d7d5298..ce3c657ef46 100644 --- a/server/server.go +++ b/server/server.go @@ -458,6 +458,10 @@ func (s *Server) startServer(ctx context.Context) error { Label: idAllocLabel, Member: s.member.MemberValue(), }) + s.encryptionKeyManager, err = encryption.NewManager(s.client, &s.cfg.Security.Encryption) + if err != nil { + return err + } // Initialize an etcd storage as the default storage. defaultStorage := storage.NewStorageWithEtcdBackend(s.client, s.rootPath) // Initialize a specialized LevelDB storage to store the region-related meta info independently. @@ -487,11 +491,6 @@ func (s *Server) startServer(ctx context.Context) error { } } - s.encryptionKeyManager, err = encryption.NewManager(s.client, &s.cfg.Security.Encryption) - if err != nil { - return err - } - s.gcSafePointManager = gc.NewSafePointManager(s.storage, s.cfg.PDServerCfg) s.basicCluster = core.NewBasicCluster() s.cluster = cluster.NewRaftCluster(ctx, clusterID, s.GetBasicCluster(), s.GetStorage(), syncer.NewRegionSyncer(s), s.client, s.httpClient)