Skip to content

Commit

Permalink
cherry pick pingcap#899 to release-5.0
Browse files Browse the repository at this point in the history
Signed-off-by: ti-srebot <ti-srebot@pingcap.com>
  • Loading branch information
kennytm authored and ti-srebot committed Mar 24, 2021
1 parent c01fcc7 commit a79a534
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
6 changes: 5 additions & 1 deletion pkg/lightning/lightning.go
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,11 @@ func (l *Lightning) run(taskCtx context.Context, taskCfg *config.Config, g glue.
if err != nil {
return errors.Annotate(err, "parse backend failed")
}
s, err := storage.Create(ctx, u, true)
s, err := storage.New(ctx, u, &storage.ExternalStorageOptions{
// we skip check path in favor of delaying the error to when we actually access the file.
// on S3, performing "check path" requires the additional "s3:ListBucket" permission.
SkipCheckPath: true,
})
if err != nil {
return errors.Annotate(err, "create storage failed")
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/lightning/mydump/loader.go
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ func NewMyDumpLoader(ctx context.Context, cfg *config.Config) (*MDLoader, error)
if err != nil {
return nil, err
}
s, err := storage.Create(ctx, u, true)
s, err := storage.New(ctx, u, &storage.ExternalStorageOptions{SkipCheckPath: true})
if err != nil {
return nil, err
}
Expand Down

0 comments on commit a79a534

Please sign in to comment.