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

fix some enhancement issue #53

Merged
merged 1 commit into from
Dec 21, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion cmd/backup.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ func newFullBackupCmd() *cobra.Command {
fmt.Println("Start to backup cluster...")
backupName, err := b.Backup()
if err != nil {
fmt.Println("Backup failed, will try to clean the remaining garbage...")
fmt.Printf("Backup failed: %v, will try to clean the remaining garbage...\n", err)

if backupName != "" {
cleanCfg := &config.CleanupConfig{
Expand Down
11 changes: 8 additions & 3 deletions pkg/clients/meta.go
Original file line number Diff line number Diff line change
Expand Up @@ -202,12 +202,17 @@ func (m *NebulaMeta) RestoreMeta(metaAddr *nebula.HostAddr, hostMap []*meta.Host
req.Hosts = hostMap
req.Files = byteFiles

for try := 1; try <= 3; try++ {
// meta startup time may be very long, so add retry for up to 10 times
for try := 1; try <= 10; try++ {
client, err := connect(metaAddr)
if err != nil {
numsec := 1 << try
if numsec > 32 {
numsec = 32
}
log.WithError(err).WithField("addr", utils.StringifyAddr(metaAddr)).
Errorf("Connect to metad failed, try times %d.", try)
time.Sleep(time.Second * 2)
Errorf("Connect to metad failed, will try after %d seconds, try times %d.", numsec, try)
time.Sleep(time.Second * time.Duration(numsec))
continue
}

Expand Down
6 changes: 3 additions & 3 deletions pkg/restore/restore.go
Original file line number Diff line number Diff line change
Expand Up @@ -494,8 +494,8 @@ func (r *Restore) cleanupOriginalData() error {

// backup_root/backup_name
// - meta
// - xxx.sst
// - ...
// - xxx.sst
// - ...
// - data
// - backup_name.meta
func (r *Restore) Restore() error {
Expand Down Expand Up @@ -579,7 +579,7 @@ func (r *Restore) Restore() error {
if err != nil {
return fmt.Errorf("start meta service failed: %w", err)
}
time.Sleep(time.Second * 3)
time.Sleep(time.Second * 10)
log.Info("Start meta service successfully.")

// restore meta service by map
Expand Down