Skip to content

Commit

Permalink
*: fix the initialization of encryption key manager (tikv#8383) (tikv…
Browse files Browse the repository at this point in the history
…#8392)

close tikv#8384

Signed-off-by: Ryan Leung <[email protected]>

Co-authored-by: Ryan Leung <[email protected]>
Co-authored-by: ti-chi-bot[bot] <108142056+ti-chi-bot[bot]@users.noreply.github.com>
  • Loading branch information
3 people authored Jul 25, 2024
1 parent f1a9096 commit 2fa8cd0
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 2fa8cd0

Please sign in to comment.