Skip to content

Commit

Permalink
fix the initialization of encryption key manager
Browse files Browse the repository at this point in the history
Signed-off-by: Ryan Leung <rleungx@gmail.com>
  • Loading branch information
rleungx committed Jul 9, 2024
1 parent 90273dd commit 2c60ee6
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions server/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 2c60ee6

Please sign in to comment.