Skip to content

Commit

Permalink
add more log
Browse files Browse the repository at this point in the history
Signed-off-by: Wenqi Mou <wenqimou@gmail.com>
  • Loading branch information
Tristan1900 committed Nov 25, 2024
1 parent 1cc3695 commit ab6cb2d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
10 changes: 5 additions & 5 deletions br/pkg/backup/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -143,14 +143,14 @@ func (l *MainBackupLoop) CollectStoreBackupsAsync(
cases = append(cases, reflect.SelectCase{Dir: reflect.SelectRecv, Chan: reflect.ValueOf(ch)})
}

remainingProducers := len(cases)
logutil.CL(ctx).Info("start wait store backups", zap.Int("remainingProducers", remainingProducers))
for remainingProducers > 0 {
remainingStores := len(cases)
logutil.CL(ctx).Info("start to wait store backups", zap.Int("remainingStores", remainingStores))
for remainingStores > 0 {
chosen, value, ok := reflect.Select(cases)
if !ok {
// The chosen channel has been closed, so zero out the channel to disable the case
cases[chosen].Chan = reflect.ValueOf(nil)
remainingProducers -= 1
remainingStores -= 1
continue
}

Expand Down Expand Up @@ -278,7 +278,7 @@ mainLoop:
}
if storeBackupInfo.One != 0 {
storeID := storeBackupInfo.One
logutil.CL(mainCtx).Info("receive notifaction and retry backup on this store",
logutil.CL(mainCtx).Info("receive notification and retry backup on this store",
zap.Uint64("storeID", storeID), zap.Uint64("round", round))
store, err := bc.mgr.GetPDClient().GetStore(mainCtx, storeID)
if err != nil {
Expand Down
2 changes: 1 addition & 1 deletion br/pkg/backup/store.go
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ func startBackup(
retry := -1
return utils.WithRetry(ectx, func() error {
retry += 1
logutil.CL(ectx).Info("backup to store", zap.Uint64("storeID", storeID),
logutil.CL(ectx).Info("back up range to store", zap.Uint64("storeID", storeID),
zap.Int("retry", retry), zap.Int("reqIndex", reqIndex))
return doSendBackup(ectx, backupCli, bkReq, func(resp *backuppb.BackupResponse) error {
// Forward all responses (including error).
Expand Down

0 comments on commit ab6cb2d

Please sign in to comment.