Skip to content

Commit

Permalink
vtctl: check ShardReplicationStatuses error
Browse files Browse the repository at this point in the history
tablets was never nil, even with an error, causing the error to never get returned

Signed-off-by: Derek Perkins <derek@nozzle.io>
  • Loading branch information
derekperkins committed Oct 9, 2021
1 parent 2d4689f commit 5311328
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions go/vt/vtctl/backup.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,13 @@ limitations under the License.
package vtctl

import (
"context"
"errors"
"flag"
"fmt"
"io"
"time"

"context"

"vitess.io/vitess/go/vt/logutil"
"vitess.io/vitess/go/vt/mysqlctl"
"vitess.io/vitess/go/vt/mysqlctl/backupstorage"
Expand Down Expand Up @@ -115,7 +114,7 @@ func commandBackupShard(ctx context.Context, wr *wrangler.Wrangler, subFlags *fl
}

tablets, stats, err := wr.ShardReplicationStatuses(ctx, keyspace, shard)
if tablets == nil {
if err != nil {
return err
}

Expand Down

0 comments on commit 5311328

Please sign in to comment.