Skip to content

Commit

Permalink
*: fix the initialization of encryption key manager (#8383) (#8390)
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]>
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 0adedca commit fb162bf
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 @@ -425,6 +425,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 @@ -449,11 +453,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.basicCluster = core.NewBasicCluster()
s.cluster = cluster.NewRaftCluster(ctx, s.clusterID, syncer.NewRegionSyncer(s), s.client, s.httpClient)
Expand Down

0 comments on commit fb162bf

Please sign in to comment.