Skip to content

Commit

Permalink
feat: remove all databases in proxy before restore
Browse files Browse the repository at this point in the history
Signed-off-by: mlycore <[email protected]>
  • Loading branch information
mlycore committed Dec 28, 2023
1 parent 98d19f3 commit 38616d2
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions pitr/cli/internal/cmd/restore.go
Original file line number Diff line number Diff line change
Expand Up @@ -151,10 +151,8 @@ func checkDatabaseExist(proxy pkg.IShardingSphereProxy, bak *model.LsBackup) err
return xerr.NewCliErr(fmt.Sprintf("get cluster metadata failed. err: %s", err))
}

for k := range bak.SsBackup.ClusterInfo.MetaData.Databases {
if _, ok := clusterNow.MetaData.Databases[k]; ok {
databaseNamesExist = append(databaseNamesExist, k)
}
for k := range clusterNow.MetaData.Databases {
databaseNamesExist = append(databaseNamesExist, k)
}

if len(databaseNamesExist) == 0 {
Expand Down

0 comments on commit 38616d2

Please sign in to comment.