Skip to content
This repository has been archived by the owner on Jul 24, 2024. It is now read-only.

Commit

Permalink
remove meta and fix
Browse files Browse the repository at this point in the history
  • Loading branch information
TennyZhuang committed Mar 17, 2020
1 parent 52c652c commit 4ed1a35
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 12 deletions.
5 changes: 3 additions & 2 deletions cmd/cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import (
"net/http"
"net/http/pprof"
"os"
"path/filepath"
"sync"
"sync/atomic"
"time"
Expand Down Expand Up @@ -46,7 +47,7 @@ const (
)

func timestampLogFileName() string {
return filepath.Join(os.TempDir(), "br-" + time.Now().Format(time.RFC3339))
return filepath.Join(os.TempDir(), "br-"+time.Now().Format(time.RFC3339))
}

// AddFlags adds flags to the given cmd.
Expand Down Expand Up @@ -82,10 +83,10 @@ func Init(cmd *cobra.Command) (err error) {
}
if len(conf.File.Filename) != 0 {
atomic.StoreUint64(&hasLogFile, 1)
summary.InitCollector(true)
} else {
fmt.Printf("log file: %s\n", conf.File.Filename)
}
summary.InitCollector(bool(hasLogFile))
lg, p, e := log.InitLogger(conf)
if e != nil {
err = e
Expand Down
1 change: 0 additions & 1 deletion pkg/task/backup.go
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,6 @@ func RunBackup(c context.Context, g glue.Glue, cmdName string, cfg *BackupConfig

err = client.SaveBackupMeta(ctx, ddlJobs)
if err != nil {
log.Error("save backup meta failed", zap.Reflect("meta", ddlJobs))
return err
}
return nil
Expand Down
3 changes: 0 additions & 3 deletions pkg/task/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,12 @@ import (
"github.com/gogo/protobuf/proto"
"github.com/pingcap/errors"
"github.com/pingcap/kvproto/pkg/backup"
"github.com/pingcap/log"
pd "github.com/pingcap/pd/v4/client"
"github.com/pingcap/tidb-tools/pkg/filter"
"github.com/pingcap/tidb/store/tikv"
"github.com/spf13/cobra"
"github.com/spf13/pflag"
"go.etcd.io/etcd/pkg/transport"
"go.uber.org/zap"

"github.com/pingcap/br/pkg/conn"
"github.com/pingcap/br/pkg/glue"
Expand Down Expand Up @@ -276,7 +274,6 @@ func ReadBackupMeta(
}
backupMeta := &backup.BackupMeta{}
if err = proto.Unmarshal(metaData, backupMeta); err != nil {
log.Error("parse backupmeta failed", zap.Error(err), zap.Binary("meta", metaData))
return nil, nil, nil, errors.Annotate(err, "parse backupmeta failed")
}
return u, s, backupMeta, nil
Expand Down
6 changes: 0 additions & 6 deletions pkg/task/restore.go
Original file line number Diff line number Diff line change
Expand Up @@ -104,12 +104,6 @@ func RunRestore(c context.Context, g glue.Glue, cmdName string, cfg *RestoreConf
return err
}

defer func() {
if err != nil {
log.Error("restore failed", zap.Error(err), zap.Reflect("meta", backupMeta))
}
}()

if err = client.InitBackupMeta(backupMeta, u); err != nil {
return err
}
Expand Down

0 comments on commit 4ed1a35

Please sign in to comment.