Skip to content

Commit

Permalink
*: fix the initialization of encryption key manager (#8383) (#8391)
Browse files Browse the repository at this point in the history
close #8384

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

Co-authored-by: Ryan Leung <[email protected]>
  • Loading branch information
ti-chi-bot and rleungx authored Jul 16, 2024
1 parent 19f65c5 commit 2008f2d
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 @@ -444,6 +444,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
}
regionStorage, err := storage.NewStorageWithLevelDBBackend(ctx, filepath.Join(s.cfg.DataDir, "region-meta"), s.encryptionKeyManager)
if err != nil {
return err
Expand All @@ -468,11 +472,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, s.clusterID, syncer.NewRegionSyncer(s), s.client, s.httpClient)
Expand Down

0 comments on commit 2008f2d

Please sign in to comment.