Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/pingcap/tidb-operator int…
Browse files Browse the repository at this point in the history
…o tikv-rpc-cli

Signed-off-by: hillium <[email protected]>
  • Loading branch information
YuJuncen committed Feb 5, 2025
2 parents 3db819b + f8ebb9c commit 6983051
Show file tree
Hide file tree
Showing 323 changed files with 31,489 additions and 10,418 deletions.
8 changes: 8 additions & 0 deletions .github/renovate.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
"baseBranches": ["master", "feature\/v2"],
"extends": [
"config:recommended"
],
"postUpdateOptions": ["gomodTidy","gomodUpdateImportPaths"]
}
8 changes: 4 additions & 4 deletions .github/workflows/chaos.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,15 @@ on:
jobs:

pull:
runs-on: ubuntu-20.04
runs-on: ubuntu-24.04
steps:
- name: Check out code into the Go module directory
uses: actions/checkout@v2
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha }}
path: go/src/github.com/${{ github.repository }}
- name: Set up Go
uses: actions/setup-go@v3
uses: actions/setup-go@v5
with:
go-version-file: go/src/github.com/${{ github.repository }}/go.mod
go-version: 1.21.3
Expand All @@ -26,7 +26,7 @@ jobs:
echo "GOCACHE=$(go env GOCACHE)" >> $GITHUB_ENV
echo "GOMODCACHE=$(go env GOMODCACHE)" >> $GITHUB_ENV
- name: Try to use build cache
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: |
${{ env.GOCACHE }}
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ on:
jobs:

pull:
runs-on: ubuntu-22.04
runs-on: ubuntu-24.04
strategy:
fail-fast: false
matrix:
Expand All @@ -27,21 +27,21 @@ jobs:
# see https://github.community/t/github-sha-isnt-the-value-expected/17903/2
# so we checkout the repo with `fetch-depth: 2` and let `codecov/codecov-action` to retrieve the real commit hash.
- name: Check out code into the Go module directory
uses: actions/checkout@v2
uses: actions/checkout@v4
with:
path: go/src/github.com/${{ github.repository }}
fetch-depth: 2
- name: Set up Go
uses: actions/setup-go@v3
uses: actions/setup-go@v5
with:
go-version-file: go/src/github.com/${{ github.repository }}/go.mod
go-version: 1.21.3
cache-dependency-path: "**/*.sum"
- name: Set vars
run: |
echo "GOCACHE=$(go env GOCACHE)" >> $GITHUB_ENV
echo "GOMODCACHE=$(go env GOMODCACHE)" >> $GITHUB_ENV
- name: Try to use build cache
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: |
${{ env.GOCACHE }}
Expand All @@ -68,7 +68,7 @@ jobs:
job: ${{ matrix.job }}

- name: Upload test coverage
uses: codecov/codecov-action@v1
uses: codecov/codecov-action@v4
with:
flags: unittest
working-directory: ${{ github.workspace }}/go/src/github.com/${{ github.repository }}
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/stale.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ on:

jobs:
stale:
runs-on: ubuntu-20.04
runs-on: ubuntu-24.04
steps:
- uses: actions/stale@v3
- uses: actions/stale@v9
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
stale-issue-message: 'This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 15 days'
Expand Down
5 changes: 5 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,11 @@ linters-settings:
- G201 # Rule: SQL query construction using format string
- G114 # Rule: Use of net/http serve function that has no support for setting timeouts
- G112 # Rule: Potential slowloris attack
- G115 # Rule: integer overflow conversion

govet:
disable:
- printf # non-constant format string in call

issues:
exclude-rules:
Expand Down
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ TEST_COVER_PACKAGES := go list ./cmd/... ./pkg/... $(foreach mod, $(GO_SUBMODULE

# NOTE: coverage report generated for E2E tests (with `-c`) may not stable, see
# https://github.com/golang/go/issues/23883#issuecomment-381766556
GO_TEST := $(GO) test -cover -covermode=atomic -coverpkg=$$($(TEST_COVER_PACKAGES))
GO_TEST := CGO_ENABLED=0 $(GO) test -cover -covermode=atomic -coverpkg=$$($(TEST_COVER_PACKAGES))

default: build

Expand Down Expand Up @@ -160,7 +160,7 @@ endif
cp -r charts/tidb-operator tests/images/e2e
cp -r charts/tidb-drainer tests/images/e2e
cp -r manifests tests/images/e2e
docker build -t "${DOCKER_REPO}/tidb-operator-e2e:${IMAGE_TAG}" tests/images/e2e
docker build -t "${DOCKER_REPO}/tidb-operator-e2e:${IMAGE_TAG}" --build-arg=TARGETARCH=$(GOARCH) tests/images/e2e

e2e-build: ## Build binaries for test
$(GO_BUILD) -ldflags '$(LDFLAGS)' -o tests/images/e2e/bin/ginkgo github.com/onsi/ginkgo/ginkgo
Expand Down
1 change: 1 addition & 0 deletions OWNERS
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ approvers:
- dragonly
- Ehco1996
- fengou1
- fgksgf
- gozssky
- gregwebs
- grovecai
Expand Down
2 changes: 1 addition & 1 deletion charts/br-federation/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ rbac:
# timezone is the default system timzone
timezone: UTC

image: pingcap/br-federation-manager:v1.6.0-beta.1
image: pingcap/br-federation-manager:v1.6.1
imagePullPolicy: IfNotPresent
# imagePullSecrets: []

Expand Down
2 changes: 1 addition & 1 deletion charts/tidb-drainer/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ timezone: UTC

# clusterName is the TiDB cluster name that should backup from or restore to.
clusterName: demo
clusterVersion: v7.5.1
clusterVersion: v8.5.0

baseImage: pingcap/tidb-binlog
imagePullPolicy: IfNotPresent
Expand Down
2 changes: 1 addition & 1 deletion charts/tidb-lightning/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
# timezone is the default system timzone
timezone: UTC

image: pingcap/tidb-lightning:v7.5.1
image: pingcap/tidb-lightning:v8.5.0
imagePullPolicy: IfNotPresent
# imagePullSecrets: []

Expand Down
19 changes: 8 additions & 11 deletions charts/tidb-operator/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,42 +12,39 @@ rbac:
timezone: UTC

# operatorImage is TiDB Operator image
operatorImage: pingcap/tidb-operator:v1.6.0-beta.1
operatorImage: pingcap/tidb-operator:v1.6.1
imagePullPolicy: IfNotPresent
# imagePullSecrets: []

# tidbBackupManagerImage is tidb backup manager image
tidbBackupManagerImage: pingcap/tidb-backup-manager:v1.6.0-beta.1
tidbBackupManagerImage: pingcap/tidb-backup-manager:v1.6.1

#
# Enable or disable tidb-operator features:
#
# StableScheduling (default: true)
# Enable stable scheduling of tidb servers.
#
# AdvancedStatefulSet (default: false)
# If enabled, tidb-operator will use AdvancedStatefulSet to manage pods
# instead of Kubernetes StatefulSet.
# It's ok to turn it on if this feature is not enabled. However it's not ok
# to turn it off when the tidb-operator already uses AdvancedStatefulSet to
# manage pods. This is in alpha phase.
# manage pods. This is in GA phase.
# Ref: https://docs.pingcap.com/tidb-in-kubernetes/stable/advanced-statefulset
#
# VolumeModifying (default false)
# If enabled, tidb-operator support to increase the size or performance of volumes
# for specific volume provisioner.
# for specific volume provisioner. This is in GA phase for AWS EBS.
#
# VolumeReplacing (default false)
# If enabled, tidb-operator support generic volume changes (size, storageclass & number of volumes)
# by deleting old pod + pvc completely and replacing with new pods/PVCs.
# pd, tikv, tidb supported. If enabled, takes precedence over volume resizing & modifying.
# This works by deleting pod+volumes one at a time (similar to scale-in), and recreating it.
# For PD & TiKV this will first create one new spare replica to take the load before deleting existing ones
# Safely deleting a volume and replacing them can take a long time (Especially TiKV to move regions)
# Safely deleting a volume and replacing them can take a long time (Especially TiKV to move regions).
# This is in Alpha phase.
#
features: []
# - AdvancedStatefulSet=false
# - StableScheduling=true
# - AutoScaling=false
# - VolumeModifying=false
# - VolumeReplacing=false

Expand Down Expand Up @@ -208,7 +205,7 @@ advancedStatefulset:
## resourceLock indicates the type of resource object that will be used for locking during leader election.
## If using "endpoints" before and want to migrate to "leases", you should migrate to "endpointsleases" first.
# resourceLock: "leases"
image: pingcap/advanced-statefulset:v0.4.0
image: pingcap/advanced-statefulset:v0.7.0
imagePullPolicy: IfNotPresent
serviceAccount: advanced-statefulset-controller
logLevel: 4
Expand Down
2 changes: 1 addition & 1 deletion ci/e2e_eks.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ kind: Pod
spec:
containers:
- name: main
image: hub.pingcap.net/tidb-operator/kubekins-e2e:v6-go1.21.3
image: hub.pingcap.net/tidb-operator/kubekins-e2e:v8-go1.23.1
command:
- runner.sh
- sleep
Expand Down
2 changes: 1 addition & 1 deletion ci/e2e_gke.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ kind: Pod
spec:
containers:
- name: main
image: hub.pingcap.net/tidb-operator/kubekins-e2e:v6-go1.21.3
image: hub.pingcap.net/tidb-operator/kubekins-e2e:v8-go1.23.1
command:
- runner.sh
- sleep
Expand Down
2 changes: 1 addition & 1 deletion ci/e2e_kind.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ metadata:
spec:
containers:
- name: main
image: hub.pingcap.net/tidb-operator/kubekins-e2e:v6-go1.21.3
image: hub.pingcap.net/tidb-operator/kubekins-e2e:v8-go1.23.1
command:
- runner.sh
- exec
Expand Down
8 changes: 7 additions & 1 deletion ci/pull_e2e_kind.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ metadata:
spec:
containers:
- name: main
image: hub.pingcap.net/tidb-operator/kubekins-e2e:v6-go1.21.3
image: hub.pingcap.net/tidb-operator/kubekins-e2e:v8-go1.23.1
command:
- runner.sh
- exec
Expand Down Expand Up @@ -170,6 +170,7 @@ def build(String name, String code, Map resources = e2ePodResources) {
echo "====== shell env ======"
echo "pwd: \$(pwd)"
env
unset GOSUMDB
echo "====== go env ======"
go env
echo "====== docker version ======"
Expand All @@ -178,6 +179,7 @@ def build(String name, String code, Map resources = e2ePodResources) {
}
stage('Run') {
sh """#!/bin/bash
unset GOSUMDB
export GOPATH=${WORKSPACE}/go
export ARTIFACTS=${ARTIFACTS}
export RUNNER_SUITE_NAME=${name}
Expand Down Expand Up @@ -351,6 +353,9 @@ try {
sh """#!/bin/bash
set -eu
echo "info: building"
unset GOSUMDB
echo "====== go env ======"
go env
echo "info: patch charts and golang code to enable coverage profile"
./hack/e2e-patch-codecov.sh
export CUSTOM_PORT_TIDB_SERVER=${CUSTOM_PORT_TIDB_SERVER}
Expand Down Expand Up @@ -379,6 +384,7 @@ try {
withCredentials([usernamePassword(credentialsId: 'TIDB_OPERATOR_HUB_AUTH', usernameVariable: 'USERNAME', passwordVariable: 'PASSWORD')]) {
sh """#!/bin/bash
set -eu
unset GOSUMDB
echo "save GTI_COMMIT export script into file"
echo "export GIT_COMMIT=\$(git rev-parse HEAD)" > EXPORT_GIT_COMMIT
echo "info: logging into hub.pingcap.net"
Expand Down
2 changes: 1 addition & 1 deletion ci/pull_e2e_release.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ metadata:
spec:
containers:
- name: main
image: hub.pingcap.net/tidb-operator/kubekins-e2e:v6-go1.21.3
image: hub.pingcap.net/tidb-operator/kubekins-e2e:v8-go1.23.1
command:
- runner.sh
- exec
Expand Down
2 changes: 1 addition & 1 deletion ci/vm.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ kind: Pod
spec:
containers:
- name: main
image: hub.pingcap.net/tidb-operator/kubekins-e2e:v6-go1.21.3
image: hub.pingcap.net/tidb-operator/kubekins-e2e:v8-go1.23.1
command:
- runner.sh
- sleep
Expand Down
28 changes: 28 additions & 0 deletions cmd/backup-manager/app/backup/backup.go
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,20 @@ func (bo *Options) doStartLogBackup(ctx context.Context, backup *v1alpha1.Backup
return bo.brCommandRun(ctx, fullArgs)
}

// doResumeLogBackup generates br args about log backup resume and runs br binary to do the real backup work.
func (bo *Options) doResumeLogBackup(ctx context.Context, backup *v1alpha1.Backup) error {
specificArgs := []string{
"log",
"resume",
fmt.Sprintf("--task-name=%s", backup.Name),
}
fullArgs, err := bo.backupCommandTemplate(backup, specificArgs, false)
if err != nil {
return err
}
return bo.brCommandRun(ctx, fullArgs)
}

// doStoplogBackup generates br args about log backup stop and runs br binary to do the real backup work.
func (bo *Options) doStopLogBackup(ctx context.Context, backup *v1alpha1.Backup) error {
specificArgs := []string{
Expand All @@ -181,6 +195,20 @@ func (bo *Options) doStopLogBackup(ctx context.Context, backup *v1alpha1.Backup)
return bo.brCommandRun(ctx, fullArgs)
}

// doPauselogBackup generates br args about log backup pause and runs br binary to do the real backup work.
func (bo *Options) doPauseLogBackup(ctx context.Context, backup *v1alpha1.Backup) error {
specificArgs := []string{
"log",
"pause",
fmt.Sprintf("--task-name=%s", backup.Name),
}
fullArgs, err := bo.backupCommandTemplate(backup, specificArgs, false)
if err != nil {
return err
}
return bo.brCommandRun(ctx, fullArgs)
}

// doTruncateLogBackup generates br args about log backup truncate and runs br binary to do the real backup work.
func (bo *Options) doTruncateLogBackup(ctx context.Context, backup *v1alpha1.Backup) error {
specificArgs := []string{
Expand Down
Loading

0 comments on commit 6983051

Please sign in to comment.