Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Encryption manager is not initialized correctly #8384

Closed
rleungx opened this issue Jul 9, 2024 · 1 comment · Fixed by #8383
Closed

Encryption manager is not initialized correctly #8384

rleungx opened this issue Jul 9, 2024 · 1 comment · Fixed by #8383
Labels
affects-7.1 This bug affects the 7.1.x(LTS) versions. affects-7.5 This bug affects the 7.5.x(LTS) versions. affects-8.1 This bug affects the 8.1.x(LTS) versions. severity/major type/bug The issue is confirmed as a bug.

Comments

@rleungx
Copy link
Member

rleungx commented Jul 9, 2024

Bug Report

pd/server/server.go

Lines 464 to 493 in 90273dd

regionStorage, err := storage.NewRegionStorageWithLevelDBBackend(
ctx,
filepath.Join(s.cfg.DataDir, "region-meta"),
s.encryptionKeyManager)
if err != nil {
return err
}
s.storage = storage.NewCoreStorage(defaultStorage, regionStorage)
s.tsoDispatcher = tsoutil.NewTSODispatcher(tsoProxyHandleDuration, tsoProxyBatchSize)
s.tsoProtoFactory = &tsoutil.TSOProtoFactory{}
s.pdProtoFactory = &tsoutil.PDProtoFactory{}
if !s.IsAPIServiceMode() {
s.tsoAllocatorManager = tso.NewAllocatorManager(s.ctx, mcs.DefaultKeyspaceGroupID, s.member, s.rootPath, s.storage, s, false)
// When disabled the Local TSO, we should clean up the Local TSO Allocator's meta info written in etcd if it exists.
if !s.cfg.EnableLocalTSO {
if err = s.tsoAllocatorManager.CleanUpDCLocation(); err != nil {
return err
}
}
if zone, exist := s.cfg.Labels[config.ZoneLabel]; exist && zone != "" && s.cfg.EnableLocalTSO {
if err = s.tsoAllocatorManager.SetLocalTSOConfig(zone); err != nil {
return err
}
}
}
s.encryptionKeyManager, err = encryption.NewManager(s.client, &s.cfg.Security.Encryption)
if err != nil {
return err
}

We need to initialize it before using it.

@rleungx rleungx added the type/bug The issue is confirmed as a bug. label Jul 9, 2024
@rleungx rleungx added affects-7.1 This bug affects the 7.1.x(LTS) versions. affects-7.5 This bug affects the 7.5.x(LTS) versions. affects-8.1 This bug affects the 8.1.x(LTS) versions. severity/major labels Jul 9, 2024
@ti-chi-bot ti-chi-bot bot closed this as completed in #8383 Jul 9, 2024
@ti-chi-bot ti-chi-bot bot closed this as completed in c50993b Jul 9, 2024
@niubell
Copy link
Contributor

niubell commented Jul 12, 2024

Which scenario or what are the trigger conditions of this issue?

ti-chi-bot pushed a commit to ti-chi-bot/pd that referenced this issue Jul 12, 2024
ti-chi-bot pushed a commit to ti-chi-bot/pd that referenced this issue Jul 12, 2024
ti-chi-bot bot pushed a commit that referenced this issue Jul 16, 2024
close #8384

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

Co-authored-by: Ryan Leung <[email protected]>
ti-chi-bot bot added a commit that referenced this issue Jul 25, 2024
close #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>
ti-chi-bot bot added a commit that referenced this issue Jul 25, 2024
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
affects-7.1 This bug affects the 7.1.x(LTS) versions. affects-7.5 This bug affects the 7.5.x(LTS) versions. affects-8.1 This bug affects the 8.1.x(LTS) versions. severity/major type/bug The issue is confirmed as a bug.
Projects
Status: Need Triage
Development

Successfully merging a pull request may close this issue.

2 participants