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 <[email protected]>
  • Loading branch information
rleungx authored and ti-chi-bot committed Jul 12, 2024
1 parent cb8da1b commit 079db44
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 @@ -453,6 +453,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 @@ -482,11 +486,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 079db44

Please sign in to comment.