Skip to content

Commit

Permalink
Add comment, fix test, fix error msg
Browse files Browse the repository at this point in the history
  • Loading branch information
proggga committed Sep 15, 2021
1 parent ebfc92a commit 2d0d0a6
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ set -e -x

. /usr/local/export_common.sh

export WALE_S3_PREFIX=s3://mysqlfullxtrabackupbucket
export WALE_S3_PREFIX=s3://mysqlfullxtrabackupbucketwithranges


mysqld --initialize --init-file=/etc/mysql/init.sql
Expand Down
5 changes: 4 additions & 1 deletion pkg/storages/s3/s3reader.go
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,9 @@ func (reader *s3Reader) reconnect() error {
return nil
}

// THIS COde stolen from s3 lib, from vendor/github.com/aws/aws-sdk-go/aws/client/default_retryer.go
// func (d DefaultRetryer) RetryRules( .. ) time.Duration
// this calculate sleep duration (jitter and exponential backoff)
func (reader *s3Reader) getIncrSleep(retryCount int) time.Duration {
minDelay := reader.minRetryDelay
maxDelay := reader.maxRetryDelay
Expand Down Expand Up @@ -151,7 +154,7 @@ func NewS3Reader(body io.ReadCloser, objectPath string, retriesCount int, folder
func getHash(objectPath string, id int) string {
hash := fnv.New32a()
_, err := hash.Write([]byte(objectPath))
tracelog.ErrorLogger.FatalfOnError("Fatal, can't write buffer to hash", err)
tracelog.ErrorLogger.FatalfOnError("Fatal, can't write buffer to hash %v", err)

return fmt.Sprintf("%x_%d", hash.Sum32(), id)
}
Expand Down

0 comments on commit 2d0d0a6

Please sign in to comment.