Skip to content

Commit

Permalink
br: add warmup param to restore CR
Browse files Browse the repository at this point in the history
Signed-off-by: WangLe1321 <[email protected]>
  • Loading branch information
WangLe1321 committed Jun 30, 2023
1 parent f0b71e4 commit e1394da
Show file tree
Hide file tree
Showing 17 changed files with 264 additions and 64 deletions.
60 changes: 60 additions & 0 deletions docs/api-references/docs.md
Original file line number Diff line number Diff line change
Expand Up @@ -1473,6 +1473,32 @@ For BR image, if it does not contain tag, Pod will use image &lsquo;ToolImage:${
</tr>
<tr>
<td>
<code>warmup</code></br>
<em>
<a href="#restorewarmupmode">
RestoreWarmupMode
</a>
</em>
</td>
<td>
<em>(Optional)</em>
<p>Warmup represents whether to initialize TiKV volumes after volume snapshot restore</p>
</td>
</tr>
<tr>
<td>
<code>warmupImage</code></br>
<em>
string
</em>
</td>
<td>
<em>(Optional)</em>
<p>WarmupImage represents using what image to initialize TiKV volumes</p>
</td>
</tr>
<tr>
<td>
<code>podSecurityContext</code></br>
<em>
<a href="https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.19/#podsecuritycontext-v1-core">
Expand Down Expand Up @@ -13890,6 +13916,32 @@ For BR image, if it does not contain tag, Pod will use image &lsquo;ToolImage:${
</tr>
<tr>
<td>
<code>warmup</code></br>
<em>
<a href="#restorewarmupmode">
RestoreWarmupMode
</a>
</em>
</td>
<td>
<em>(Optional)</em>
<p>Warmup represents whether to initialize TiKV volumes after volume snapshot restore</p>
</td>
</tr>
<tr>
<td>
<code>warmupImage</code></br>
<em>
string
</em>
</td>
<td>
<em>(Optional)</em>
<p>WarmupImage represents using what image to initialize TiKV volumes</p>
</td>
</tr>
<tr>
<td>
<code>podSecurityContext</code></br>
<em>
<a href="https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.19/#podsecuritycontext-v1-core">
Expand Down Expand Up @@ -14008,6 +14060,14 @@ RestoreConditionType
</tr>
</tbody>
</table>
<h3 id="restorewarmupmode">RestoreWarmupMode</h3>
<p>
(<em>Appears on:</em>
<a href="#restorespec">RestoreSpec</a>)
</p>
<p>
<p>RestoreWarmupMode represents when to initialize TiKV volumes</p>
</p>
<h3 id="s3storageprovider">S3StorageProvider</h3>
<p>
(<em>Appears on:</em>
Expand Down
24 changes: 24 additions & 0 deletions docs/api-references/federation-docs.md
Original file line number Diff line number Diff line change
Expand Up @@ -1235,6 +1235,30 @@ string
<p>PriorityClassName of Restore Job Pods</p>
</td>
</tr>
<tr>
<td>
<code>warmup</code></br>
<em>
github.com/pingcap/tidb-operator/pkg/apis/pingcap/v1alpha1.RestoreWarmupMode
</em>
</td>
<td>
<em>(Optional)</em>
<p>Warmup represents whether to initialize TiKV volumes after volume snapshot restore</p>
</td>
</tr>
<tr>
<td>
<code>warmupImage</code></br>
<em>
string
</em>
</td>
<td>
<em>(Optional)</em>
<p>WarmupImage represents using what image to initialize TiKV volumes</p>
</td>
</tr>
</tbody>
</table>
<h3 id="volumerestorespec">VolumeRestoreSpec</h3>
Expand Down
4 changes: 4 additions & 0 deletions manifests/crd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14305,6 +14305,10 @@ spec:
type: boolean
volumeAZ:
type: string
warmup:
type: string
warmupImage:
type: string
type: object
status:
properties:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -945,6 +945,10 @@ spec:
type: array
toolImage:
type: string
warmup:
type: string
warmupImage:
type: string
type: object
type: object
status:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -945,6 +945,10 @@ spec:
type: array
toolImage:
type: string
warmup:
type: string
warmupImage:
type: string
type: object
type: object
status:
Expand Down
4 changes: 4 additions & 0 deletions manifests/crd/v1/pingcap.com_restores.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2083,6 +2083,10 @@ spec:
type: boolean
volumeAZ:
type: string
warmup:
type: string
warmupImage:
type: string
type: object
status:
properties:
Expand Down
4 changes: 4 additions & 0 deletions manifests/crd/v1beta1/pingcap.com_restores.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2082,6 +2082,10 @@ spec:
type: boolean
volumeAZ:
type: string
warmup:
type: string
warmupImage:
type: string
type: object
status:
properties:
Expand Down
4 changes: 4 additions & 0 deletions manifests/crd_v1beta1.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14285,6 +14285,10 @@ spec:
type: boolean
volumeAZ:
type: string
warmup:
type: string
warmupImage:
type: string
type: object
status:
properties:
Expand Down
4 changes: 4 additions & 0 deletions manifests/federation-crd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2019,6 +2019,10 @@ spec:
type: array
toolImage:
type: string
warmup:
type: string
warmupImage:
type: string
type: object
type: object
status:
Expand Down
4 changes: 4 additions & 0 deletions manifests/federation-crd_v1beta1.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2023,6 +2023,10 @@ spec:
type: array
toolImage:
type: string
warmup:
type: string
warmupImage:
type: string
type: object
type: object
status:
Expand Down
14 changes: 14 additions & 0 deletions pkg/apis/federation/pingcap/v1alpha1/openapi_generated.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions pkg/apis/federation/pingcap/v1alpha1/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -327,6 +327,12 @@ type VolumeRestoreMemberSpec struct {
ServiceAccount string `json:"serviceAccount,omitempty"`
// PriorityClassName of Restore Job Pods
PriorityClassName string `json:"priorityClassName,omitempty"`
// Warmup represents whether to initialize TiKV volumes after volume snapshot restore
// +optional
Warmup pingcapv1alpha1.RestoreWarmupMode `json:"warmup,omitempty"`
// WarmupImage represents using what image to initialize TiKV volumes
// +optional
WarmupImage string `json:"warmupImage,omitempty"`
}

type VolumeRestoreMemberBackupInfo struct {
Expand Down
14 changes: 14 additions & 0 deletions pkg/apis/pingcap/v1alpha1/openapi_generated.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 14 additions & 4 deletions pkg/apis/pingcap/v1alpha1/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -2433,12 +2433,12 @@ type RestoreSpec struct {
ImagePullSecrets []corev1.LocalObjectReference `json:"imagePullSecrets,omitempty"`
// TableFilter means Table filter expression for 'db.table' matching. BR supports this from v4.0.3.
TableFilter []string `json:"tableFilter,omitempty"`
// ImagePullSecrets represents whether to initialize TiKV volumes after volume snapshot restore
// Warmup represents whether to initialize TiKV volumes after volume snapshot restore
// +optional
WarmUp bool `json:"warmUp,omitempty"`
// ImagePullSecrets represents using what image to initialize TiKV volumes
Warmup RestoreWarmupMode `json:"warmup,omitempty"`
// WarmupImage represents using what image to initialize TiKV volumes
// +optional
WarmUpImage string `json:"warmUpImage,omitempty"`
WarmupImage string `json:"warmupImage,omitempty"`

// PodSecurityContext of the component
// +optional
Expand All @@ -2460,6 +2460,16 @@ const (
FederalVolumeRestoreFinish FederalVolumeRestorePhase = "restore-finish"
)

// RestoreWarmupMode represents when to initialize TiKV volumes
type RestoreWarmupMode string

const (
// RestoreWarmupModeSync means initialize TiKV volumes before TiKV starts
RestoreWarmupModeSync RestoreWarmupMode = "sync"
// RestoreWarmupModeASync means initialize TiKV volumes after restore complete
RestoreWarmupModeASync RestoreWarmupMode = "async"
)

// RestoreStatus represents the current status of a tidb cluster restore.
type RestoreStatus struct {
// TimeStarted is the time at which the restore was started.
Expand Down
Loading

0 comments on commit e1394da

Please sign in to comment.