diff --git a/cmd/backup-manager/app/backup/manager.go b/cmd/backup-manager/app/backup/manager.go index f5d30dcdb89..b0d3b712da0 100644 --- a/cmd/backup-manager/app/backup/manager.go +++ b/cmd/backup-manager/app/backup/manager.go @@ -35,6 +35,7 @@ import ( corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" errorutils "k8s.io/apimachinery/pkg/util/errors" + "k8s.io/apimachinery/pkg/util/json" "k8s.io/apimachinery/pkg/util/wait" "k8s.io/klog/v2" ) @@ -101,6 +102,13 @@ func (bm *Manager) ProcessBackup() error { return errorutils.NewAggregate(errs) } + crData, err := json.Marshal(backup) + if err != nil { + klog.Errorf("failed to marshal backup %v to json, err: %v", backup, err) + } else { + klog.Infof("start to process backup: %s", string(crData)) + } + // we treat snapshot backup as restarted if its status is not scheduled when backup pod just start to run // we will clean backup data before run br command if backup.Spec.Mode == v1alpha1.BackupModeSnapshot && (backup.Status.Phase != v1alpha1.BackupScheduled || v1alpha1.IsBackupRestart(backup)) { @@ -132,6 +140,9 @@ func (bm *Manager) ProcessBackup() error { return bm.performBackup(ctx, backup.DeepCopy(), nil) } + klog.Infof("start to connect to tidb server (%s:%d) as the .spec.from field is specified", + backup.Spec.From.Host, backup.Spec.From.Port) + // validate and create from db var db *sql.DB db, err = bm.validateAndCreateFromDB(ctx, backup.DeepCopy()) diff --git a/cmd/backup-manager/app/export/manager.go b/cmd/backup-manager/app/export/manager.go index 6bedab45178..49edfa18683 100644 --- a/cmd/backup-manager/app/export/manager.go +++ b/cmd/backup-manager/app/export/manager.go @@ -32,6 +32,7 @@ import ( corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" errorutils "k8s.io/apimachinery/pkg/util/errors" + "k8s.io/apimachinery/pkg/util/json" "k8s.io/apimachinery/pkg/util/wait" "k8s.io/klog/v2" ) @@ -99,6 +100,13 @@ func (bm *BackupManager) ProcessBackup() error { return errorutils.NewAggregate(errs) } + crData, err := json.Marshal(backup) + if err != nil { + klog.Errorf("failed to marshal backup %v to json, err: %v", backup, err) + } else { + klog.Infof("start to process backup: %s", string(crData)) + } + reason, err := bm.setOptions(backup) if err != nil { errs = append(errs, err) diff --git a/cmd/backup-manager/app/import/manager.go b/cmd/backup-manager/app/import/manager.go index 36e4db7e37c..cdeb15737a4 100644 --- a/cmd/backup-manager/app/import/manager.go +++ b/cmd/backup-manager/app/import/manager.go @@ -27,6 +27,7 @@ import ( corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" errorutils "k8s.io/apimachinery/pkg/util/errors" + "k8s.io/apimachinery/pkg/util/json" "k8s.io/klog/v2" ) @@ -87,6 +88,13 @@ func (rm *RestoreManager) ProcessRestore() error { return errorutils.NewAggregate(errs) } + crData, err := json.Marshal(restore) + if err != nil { + klog.Errorf("failed to marshal restore %v to json, err: %s", restore, err) + } else { + klog.Infof("start to process restore: %s", string(crData)) + } + rm.setOptions(restore) return rm.performRestore(ctx, restore.DeepCopy()) diff --git a/cmd/backup-manager/app/restore/manager.go b/cmd/backup-manager/app/restore/manager.go index 5ba497f7bae..da9bf95c620 100644 --- a/cmd/backup-manager/app/restore/manager.go +++ b/cmd/backup-manager/app/restore/manager.go @@ -30,6 +30,7 @@ import ( corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" errorutils "k8s.io/apimachinery/pkg/util/errors" + "k8s.io/apimachinery/pkg/util/json" "k8s.io/apimachinery/pkg/util/wait" "k8s.io/klog/v2" ) @@ -96,12 +97,22 @@ func (rm *Manager) ProcessRestore() error { return fmt.Errorf("no br config in %s", rm) } + crData, err := json.Marshal(restore) + if err != nil { + klog.Errorf("failed to marshal restore %v to json, err: %s", restore, err) + } else { + klog.Infof("start to process restore: %s", string(crData)) + } + if restore.Spec.To == nil { return rm.performRestore(ctx, restore.DeepCopy(), nil) } rm.setOptions(restore) + klog.Infof("start to connect to tidb server (%s:%d) as the .spec.to field is specified", + restore.Spec.To.Host, restore.Spec.To.Port) + var db *sql.DB var dsn string err = wait.PollImmediate(constants.PollInterval, constants.CheckTimeout, func() (done bool, err error) { diff --git a/cmd/http-service/Dockerfile b/cmd/http-service/Dockerfile index b7221fdb5a7..ba4af321248 100644 --- a/cmd/http-service/Dockerfile +++ b/cmd/http-service/Dockerfile @@ -1,4 +1,4 @@ -FROM pingcap/pingcap-base:v1 +FROM ghcr.io/pingcap-qe/bases/pingcap-base:v1.9.1 ARG TARGETARCH RUN dnf install -y tzdata bind-utils && dnf clean all diff --git a/docs/api-references/docs.md b/docs/api-references/docs.md index f1cad339202..6a96a6bbcc0 100644 --- a/docs/api-references/docs.md +++ b/docs/api-references/docs.md @@ -3394,6 +3394,30 @@ azblob service account credentials.

+storageAccount
+ +string + + + +

StorageAccount is the storage account of the azure blob storage +If this field is set, then use this to set backup-manager env +Otherwise retrieve the storage account from secret

+ + + + +sasToken
+ +string + + + +

SasToken is the sas token of the storage account

+ + + + prefix
string @@ -12321,6 +12345,18 @@ int +initWaitTime
+ +int + + + +

Wait time before pd get started. This wait time is to allow the new DNS record to propagate, +ensuring that the PD DNS resolves to the same IP address as the pod.

+ + + + mode
string diff --git a/examples/backup/backup-azblob.yaml b/examples/backup/backup-azblob.yaml index 03637ebe3d0..e211bf12f55 100644 --- a/examples/backup/backup-azblob.yaml +++ b/examples/backup/backup-azblob.yaml @@ -6,12 +6,6 @@ metadata: spec: cleanPolicy: Delete # backupType: full - # Only needed for TiDB Operator < v1.1.7 or TiDB < v4.0.8 - # from: - # host: ${tidb-host} - # port: ${tidb-port} - # user: ${tidb-user} - # secretName: backup-basic-tidb-secret br: cluster: basic clusterNamespace: default diff --git a/examples/backup/backup-ebs-local.yaml b/examples/backup/backup-ebs-local.yaml index a6d6de03c18..8bc38985b30 100644 --- a/examples/backup/backup-ebs-local.yaml +++ b/examples/backup/backup-ebs-local.yaml @@ -7,12 +7,6 @@ spec: cleanPolicy: Delete backupType: full backupMode: volume-snapshot - # Only needed for TiDB Operator < v1.1.7 or TiDB < v4.0.8 - # from: - # host: ${tidb-host} - # port: ${tidb-port} - # user: ${tidb-user} - # secretName: backup-basic-tidb-secret toolImage: localhost:5000/pingcap/br:latest br: cluster: basic diff --git a/examples/backup/backup-ebs-minio.yaml b/examples/backup/backup-ebs-minio.yaml index 0ea3bb37d86..db55b0084b8 100644 --- a/examples/backup/backup-ebs-minio.yaml +++ b/examples/backup/backup-ebs-minio.yaml @@ -7,12 +7,6 @@ spec: cleanPolicy: Delete backupType: full backupMode: volume-snapshot - # Only needed for TiDB Operator < v1.1.7 or TiDB < v4.0.8 - # from: - # host: ${tidb-host} - # port: ${tidb-port} - # user: ${tidb-user} - # secretName: backup-basic-tidb-secret toolImage: localhost:5000/pingcap/br:latest br: cluster: basic diff --git a/examples/backup/backup-local.yaml b/examples/backup/backup-local.yaml index 0e2022c73af..5889bdc51bc 100644 --- a/examples/backup/backup-local.yaml +++ b/examples/backup/backup-local.yaml @@ -6,12 +6,6 @@ metadata: spec: cleanPolicy: Delete # backupType: full - # Only needed for TiDB Operator < v1.1.7 or TiDB < v4.0.8 - # from: - # host: ${tidb-host} - # port: ${tidb-port} - # user: ${tidb-user} - # secretName: backup-basic-tidb-secret br: cluster: basic clusterNamespace: default diff --git a/examples/backup/backup-nfs.yaml b/examples/backup/backup-nfs.yaml index 6d83f184a9d..0c58383cbc3 100644 --- a/examples/backup/backup-nfs.yaml +++ b/examples/backup/backup-nfs.yaml @@ -6,12 +6,6 @@ metadata: spec: cleanPolicy: Delete # backupType: full - # Only needed for TiDB Operator < v1.1.7 or TiDB < v4.0.8 - # from: - # host: ${tidb-host} - # port: ${tidb-port} - # user: ${tidb-user} - # secretName: backup-basic-tidb-secret br: cluster: basic clusterNamespace: default diff --git a/examples/backup/backup-schedule-azblob.yaml b/examples/backup/backup-schedule-azblob.yaml index 734df81fa01..4cf78540159 100644 --- a/examples/backup/backup-schedule-azblob.yaml +++ b/examples/backup/backup-schedule-azblob.yaml @@ -9,12 +9,6 @@ spec: # maxReservedTime: "2m" schedule: "*/1 * * * *" backupTemplate: - # Only needed for TiDB Operator < v1.1.7 or TiDB < v4.0.8 - # from: - # host: ${tidb_host} - # port: ${tidb_port} - # user: ${tidb_user} - # secretName: backup-demo1-tidb-secret cleanPolicy: Delete br: cluster: basic diff --git a/examples/backup/backup-schedule-nfs.yaml b/examples/backup/backup-schedule-nfs.yaml index 7175b75921d..def3ead4600 100644 --- a/examples/backup/backup-schedule-nfs.yaml +++ b/examples/backup/backup-schedule-nfs.yaml @@ -9,12 +9,6 @@ spec: # maxReservedTime: "2m" schedule: "*/1 * * * *" backupTemplate: - # Only needed for TiDB Operator < v1.1.7 or TiDB < v4.0.8 - # from: - # host: ${tidb_host} - # port: ${tidb_port} - # user: ${tidb_user} - # secretName: backup-demo1-tidb-secret cleanPolicy: Delete br: cluster: basic diff --git a/examples/backup/restore-azblob.yaml b/examples/backup/restore-azblob.yaml index 500ccf20986..34e5a2127b2 100644 --- a/examples/backup/restore-azblob.yaml +++ b/examples/backup/restore-azblob.yaml @@ -5,12 +5,6 @@ metadata: namespace: default spec: # backupType: full - # Only needed for TiDB Operator < v1.1.7 or TiDB < v4.0.8 - # to: - # host: ${tidb_host} - # port: ${tidb_port} - # user: ${tidb_user} - # secretName: restore-demo2-tidb-secret br: cluster: basic clusterNamespace: default diff --git a/examples/backup/restore-ebs-minio.yaml b/examples/backup/restore-ebs-minio.yaml index a6164bb59d8..3f208930e8b 100644 --- a/examples/backup/restore-ebs-minio.yaml +++ b/examples/backup/restore-ebs-minio.yaml @@ -6,12 +6,6 @@ metadata: spec: backupType: full backupMode: volume-snapshot - # Only needed for TiDB Operator < v1.1.7 or TiDB < v4.0.8 - # from: - # host: ${tidb-host} - # port: ${tidb-port} - # user: ${tidb-user} - # secretName: backup-basic-tidb-secret toolImage: localhost:5000/pingcap/br:latest br: cluster: basic diff --git a/examples/backup/restore-local.yaml b/examples/backup/restore-local.yaml index 011cefb671d..d4b1e058b67 100644 --- a/examples/backup/restore-local.yaml +++ b/examples/backup/restore-local.yaml @@ -5,12 +5,6 @@ metadata: namespace: default spec: # backupType: full - # Only needed for TiDB Operator < v1.1.7 or TiDB < v4.0.8 - # from: - # host: ${tidb-host} - # port: ${tidb-port} - # user: ${tidb-user} - # secretName: backup-basic-tidb-secret br: cluster: basic clusterNamespace: default diff --git a/examples/backup/restore-nfs.yaml b/examples/backup/restore-nfs.yaml index d5dc6fad924..c8da926fb18 100644 --- a/examples/backup/restore-nfs.yaml +++ b/examples/backup/restore-nfs.yaml @@ -5,12 +5,6 @@ metadata: namespace: default spec: # backupType: full - # Only needed for TiDB Operator < v1.1.7 or TiDB < v4.0.8 - # to: - # host: ${tidb_host} - # port: ${tidb_port} - # user: ${tidb_user} - # secretName: restore-demo2-tidb-secret br: cluster: basic clusterNamespace: default diff --git a/examples/basic/pd-micro-service-cluster.yaml b/examples/basic/pd-micro-service-cluster.yaml index 355831f56ea..6f6a294bc5a 100644 --- a/examples/basic/pd-micro-service-cluster.yaml +++ b/examples/basic/pd-micro-service-cluster.yaml @@ -16,8 +16,9 @@ spec: helper: image: alpine:3.16.0 pd: - baseImage: pingcap/pd - version: v8.1.0 + # TODO: replaced v8.3.0 after v8.3.0 released + baseImage: hub.pingcap.net/devbuild/pd + version: v8.3.0-5427 maxFailoverCount: 0 replicas: 1 # if storageClassName is not set, the default Storage Class of the Kubernetes cluster will be used @@ -28,13 +29,13 @@ spec: mode: "ms" pdms: - name: "tso" - baseImage: pingcap/pd - version: v8.1.0 + baseImage: hub.pingcap.net/devbuild/pd + version: v8.3.0-5427 replicas: 2 - name: "scheduling" - baseImage: pingcap/pd - version: v8.1.0 - replicas: 1 + baseImage: hub.pingcap.net/devbuild/pd + version: v8.3.0-5427 + replicas: 2 tikv: baseImage: pingcap/tikv version: v8.1.0 diff --git a/images/br-federation-manager/Dockerfile b/images/br-federation-manager/Dockerfile index 7f65cb87ee2..13ee5acb6e3 100644 --- a/images/br-federation-manager/Dockerfile +++ b/images/br-federation-manager/Dockerfile @@ -1,4 +1,4 @@ -FROM pingcap/pingcap-base:v1 +FROM ghcr.io/pingcap-qe/bases/pingcap-base:v1.9.1 ARG TARGETARCH RUN dnf install -y bind-utils tzdata && dnf clean all ADD bin/${TARGETARCH}/br-federation-manager /usr/local/bin/br-federation-manager diff --git a/images/br-federation-manager/Dockerfile.e2e b/images/br-federation-manager/Dockerfile.e2e index 626b24ef04d..1dddaa24091 100644 --- a/images/br-federation-manager/Dockerfile.e2e +++ b/images/br-federation-manager/Dockerfile.e2e @@ -1,4 +1,4 @@ -FROM pingcap/pingcap-base:v1 +FROM ghcr.io/pingcap-qe/bases/pingcap-base:v1.9.1 ARG TARGETARCH RUN dnf install -y tzdata bind-utils && dnf clean all diff --git a/images/tidb-backup-manager/Dockerfile b/images/tidb-backup-manager/Dockerfile index 96d8df4a73f..79b5b324d49 100644 --- a/images/tidb-backup-manager/Dockerfile +++ b/images/tidb-backup-manager/Dockerfile @@ -1,4 +1,4 @@ -FROM pingcap/pingcap-base:v1 +FROM ghcr.io/pingcap-qe/bases/pingcap-base:v1.9.1 ARG TARGETARCH ARG RCLONE_VERSION=v1.57.0 ARG SHUSH_VERSION=v1.4.0 diff --git a/images/tidb-backup-manager/Dockerfile.e2e b/images/tidb-backup-manager/Dockerfile.e2e index c77c3fccbaa..04a9c1bf29e 100644 --- a/images/tidb-backup-manager/Dockerfile.e2e +++ b/images/tidb-backup-manager/Dockerfile.e2e @@ -1,4 +1,4 @@ -FROM pingcap/pingcap-base:v1 +FROM ghcr.io/pingcap-qe/bases/pingcap-base:v1.9.1 ARG TARGETARCH=amd64 ARG RCLONE_VERSION=v1.57.0 ARG SHUSH_VERSION=v1.4.0 diff --git a/images/tidb-operator/Dockerfile b/images/tidb-operator/Dockerfile index d4b0495c65e..5aed5287131 100644 --- a/images/tidb-operator/Dockerfile +++ b/images/tidb-operator/Dockerfile @@ -1,4 +1,4 @@ -FROM pingcap/pingcap-base:v1 +FROM ghcr.io/pingcap-qe/bases/pingcap-base:v1.9.1 ARG TARGETARCH RUN dnf install -y tzdata bind-utils && dnf clean all diff --git a/images/tidb-operator/Dockerfile.e2e b/images/tidb-operator/Dockerfile.e2e index 7d1b9a7938f..a700aa92136 100644 --- a/images/tidb-operator/Dockerfile.e2e +++ b/images/tidb-operator/Dockerfile.e2e @@ -1,4 +1,4 @@ -FROM pingcap/pingcap-base:v1 +FROM ghcr.io/pingcap-qe/bases/pingcap-base:v1.9.1 RUN dnf install -y tzdata bash bind-utils && dnf clean all diff --git a/manifests/backup/backup-aws-s3-br.yaml b/manifests/backup/backup-aws-s3-br.yaml index dfafde44495..72b04eb9a32 100644 --- a/manifests/backup/backup-aws-s3-br.yaml +++ b/manifests/backup/backup-aws-s3-br.yaml @@ -21,12 +21,6 @@ spec: # timeAgo: