Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add s3 minimum part size support #645

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions deploy/crds/planetscale.com_vitessbackupstorages.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,9 @@ spec:
maxLength: 256
pattern: ^[^\r\n]*$
type: string
minPartSize:
format: int64
type: integer
region:
minLength: 1
type: string
Expand Down
3 changes: 3 additions & 0 deletions deploy/crds/planetscale.com_vitessclusters.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,9 @@ spec:
maxLength: 256
pattern: ^[^\r\n]*$
type: string
minPartSize:
format: int64
type: integer
region:
minLength: 1
type: string
Expand Down
3 changes: 3 additions & 0 deletions deploy/crds/planetscale.com_vitesskeyspaces.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,9 @@ spec:
maxLength: 256
pattern: ^[^\r\n]*$
type: string
minPartSize:
format: int64
type: integer
region:
minLength: 1
type: string
Expand Down
3 changes: 3 additions & 0 deletions deploy/crds/planetscale.com_vitessshards.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,9 @@ spec:
maxLength: 256
pattern: ^[^\r\n]*$
type: string
minPartSize:
format: int64
type: integer
region:
minLength: 1
type: string
Expand Down
14 changes: 14 additions & 0 deletions docs/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -1926,6 +1926,20 @@ If set, this must point to a file in the format expected for the
Default: Use the default credentials of the Node.</p>
</td>
</tr>
<tr>
<td>
<code>minPartSize</code><br>
<em>
int64
</em>
</td>
<td>
<p>MinPartSize is optional and is only needed if we want to set a minimum part size
to be used by the S3 uploader, mainly used to avoid too many small requests to S3
when there are too many small shards.
Default: 5242880 (5MiB)</p>
</td>
</tr>
</tbody>
</table>
<h3 id="planetscale.com/v2.SecretSource">SecretSource
Expand Down
14 changes: 14 additions & 0 deletions docs/api/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -1928,6 +1928,20 @@ <h3 id="planetscale.com/v2.S3BackupLocation">S3BackupLocation
Default: Use the default credentials of the Node.</p>
</td>
</tr>
<tr>
<td>
<code>minPartSize</code><br>
<em>
int64
</em>
</td>
<td>
<p>MinPartSize is optional and is only needed if we want to set a minimum part size
to be used by the S3 uploader, mainly used to avoid too many small requests to S3
when there are too many small shards.
Default: 5242880 (5MiB)</p>
</td>
</tr>
</tbody>
</table>
<h3 id="planetscale.com/v2.SecretSource">SecretSource
Expand Down
5 changes: 5 additions & 0 deletions pkg/apis/planetscale/v2/vitessbackupstorage_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,11 @@ type S3BackupLocation struct {
// `~/.aws/credentials` file.
// Default: Use the default credentials of the Node.
AuthSecret *SecretSource `json:"authSecret,omitempty"`
// MinPartSize is optional and is only needed if we want to set a minimum part size
// to be used by the S3 uploader, mainly used to avoid too many small requests to S3
// when there are too many small shards.
// Default: 5242880 (5MiB)
MinPartSize int64 `json:"minPartSize,omitempty"`
}

// AzblobBackupLocation specifies a backup location in Azure Blob Storage.
Expand Down
1 change: 1 addition & 0 deletions pkg/operator/vitessbackup/storage_s3.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ func s3BackupFlags(s3 *planetscalev2.S3BackupLocation, clusterName string) vites
"s3_backup_storage_bucket": s3.Bucket,
"s3_backup_storage_root": rootKeyPrefix(s3.KeyPrefix, clusterName),
"s3_backup_force_path_style": s3.ForcePathStyle,
"s3_backup_aws_min_partsize": s3.MinPartSize,
}
if len(s3.Endpoint) > 0 {
flags["s3_backup_aws_endpoint"] = s3.Endpoint
Expand Down
12 changes: 12 additions & 0 deletions test/endtoend/operator/operator-latest.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -679,6 +679,9 @@ spec:
maxLength: 256
pattern: ^[^\r\n]*$
type: string
minPartSize:
format: int64
type: integer
region:
minLength: 1
type: string
Expand Down Expand Up @@ -1995,6 +1998,9 @@ spec:
maxLength: 256
pattern: ^[^\r\n]*$
type: string
minPartSize:
format: int64
type: integer
region:
minLength: 1
type: string
Expand Down Expand Up @@ -5249,6 +5255,9 @@ spec:
maxLength: 256
pattern: ^[^\r\n]*$
type: string
minPartSize:
format: int64
type: integer
region:
minLength: 1
type: string
Expand Down Expand Up @@ -6696,6 +6705,9 @@ spec:
maxLength: 256
pattern: ^[^\r\n]*$
type: string
minPartSize:
format: int64
type: integer
region:
minLength: 1
type: string
Expand Down
Loading