Skip to content

Commit 89d7661

Browse files
fgksgfliubog2008
authored andcommitted
Add a feature gate to use PD's ready API as the readiness probe (pingcap#6282)
1 parent 2b92821 commit 89d7661

37 files changed

+476
-32
lines changed

.github/licenserc.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,4 +29,5 @@ header:
2929
- '**/OWNERS'
3030
- OWNERS_ALIASES
3131
- .cursorignore
32+
- .claude/**
3233
comment: on-failure

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,6 @@ output
44
coverage.txt
55
.vscode/
66
.cursorignore
7-
.DS_Store
7+
.DS_Store
8+
CLAUDE.md
9+
.claude/

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,7 @@ bin/kind:
239239
.PHONY: bin/license-eye
240240
LICENSE_EYE = $(BIN_DIR)/license-eye
241241
bin/license-eye:
242-
if [ ! -f $(LICENSE_EYE) ]; then $(ROOT)/hack/download.sh go_install $(LICENSE_EYE) github.com/apache/skywalking-eyes/cmd/license-eye v0.6.0; fi
242+
if [ ! -f $(LICENSE_EYE) ]; then $(ROOT)/hack/download.sh go_install $(LICENSE_EYE) github.com/apache/skywalking-eyes/cmd/license-eye 049742de2276515409e3109ca2a91934053e080d; fi
243243

244244
.PHONY: bin/ginkgo
245245
GINKGO = $(BIN_DIR)/ginkgo

api/meta/v1alpha1/feature.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ package v1alpha1
1818
// NOTE(liubo02): +enum is not supported now, we have to add all enum into comments
1919
// NOTE(liubo02): It's supported by https://github.com/kubernetes-sigs/controller-tools/pull/1179
2020
//
21-
// +kubebuilder:validation:Enum=FeatureModification;VolumeAttributesClass;DisablePDDefaultReadinessProbe
21+
// +kubebuilder:validation:Enum=FeatureModification;VolumeAttributesClass;DisablePDDefaultReadinessProbe;UsePDReadyAPI
2222
// +enum
2323
type Feature string
2424

@@ -56,4 +56,9 @@ const (
5656
// It's not useful and will print so many warn logs in PD's stdout/stderr
5757
DisablePDDefaultReadinessProbe Feature = "DisablePDDefaultReadinessProbe"
5858
DisablePDDefaultReadinessProbeStage FeatureStage = FeatureStageAlpha
59+
60+
// UsePDReadyAPI means use PD's /ready API as the readiness probe.
61+
// It requires PD v8.5.2 or later.
62+
UsePDReadyAPI Feature = "UsePDReadyAPI"
63+
UsePDReadyAPIStage FeatureStage = FeatureStageAlpha
5964
)

go.work.sum

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -491,6 +491,7 @@ github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:
491491
github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc=
492492
github.com/ianlancetaylor/demangle v0.0.0-20240312041847-bd984b5ce465 h1:KwWnWVWCNtNq/ewIX7HIKnELmEx2nDP42yskD/pi7QE=
493493
github.com/ianlancetaylor/demangle v0.0.0-20240312041847-bd984b5ce465/go.mod h1:gx7rwoVhcfuVKG5uya9Hs3Sxj7EIvldVofAWIUtGouw=
494+
github.com/imdario/mergo v0.3.6 h1:xTNEAn+kxVO7dTZGu0CegyqKZmoWFI0rF8UxjlB2d28=
494495
github.com/imdario/mergo v0.3.6/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJh5FfA=
495496
github.com/ionos-cloud/sdk-go/v6 v6.1.11/go.mod h1:EzEgRIDxBELvfoa/uBN0kOQaqovLjUWEB7iW4/Q+t4k=
496497
github.com/jessevdk/go-flags v1.4.0 h1:4IU2WS7AumrZ/40jfhf4QVDMsQwqA7VEHozFRrGARJA=

hack/lib/e2e.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -353,7 +353,7 @@ function e2e::run() {
353353

354354
function e2e::run_upgrade() {
355355
e2e::install_old_version
356-
$GINKGO -v -r --tags=upgrade_e2e --timeout=1h --randomize-all --randomize-suites --fail-on-empty --race --trace "$ROOT/tests/e2e/upgrade"
356+
$GINKGO -v -r --tags=upgrade_e2e --timeout=1h --randomize-all --randomize-suites --fail-on-empty --race --trace --flake-attempts=2 "$ROOT/tests/e2e/upgrade"
357357
}
358358

359359
function e2e::prepare() {

hack/lib/vars.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -59,11 +59,11 @@ readonly V_KIND_CLUSTER=${V_KIND_CLUSTER:-"tidb-operator"}
5959
# V_DEPLOY_NAMESPACE defines namespace of deploy, the default value is tidb-admin
6060
readonly V_DEPLOY_NAMESPACE=${V_DEPLOY_NAMESPACE:-"tidb-admin"}
6161

62-
# V_TIDB_CLUSTER_VERSION defines version of TiDB cluster, the default value is v8.2.0
63-
readonly V_TIDB_CLUSTER_VERSION=${V_TIDB_CLUSTER_VERSION:-"v8.2.0"}
62+
# V_TIDB_CLUSTER_VERSION defines version of TiDB cluster, the default value is v8.5.2
63+
readonly V_TIDB_CLUSTER_VERSION=${V_TIDB_CLUSTER_VERSION:-"v8.5.2"}
6464

65-
# V_TIDB_CLUSTER_VERSION_PREV defines a older version of TiDB cluster, the default value is v8.1.0
66-
readonly V_TIDB_CLUSTER_VERSION_PREV=${V_TIDB_CLUSTER_VERSION_PREV:-"v8.1.0"}
65+
# V_TIDB_CLUSTER_VERSION_PREV defines a older version of TiDB cluster, the default value is v8.5.0
66+
readonly V_TIDB_CLUSTER_VERSION_PREV=${V_TIDB_CLUSTER_VERSION_PREV:-"v8.5.0"}
6767

6868
# V_KUBE_VERSION defines default test version of kubernetes
6969
readonly V_KUBE_VERSION=${V_KUBE_VERSION:-"v1.31.0"}

manifests/crd/core.pingcap.com_clusters.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,7 @@ spec:
8989
- FeatureModification
9090
- VolumeAttributesClass
9191
- DisablePDDefaultReadinessProbe
92+
- UsePDReadyAPI
9293
type: string
9394
required:
9495
- name
@@ -267,6 +268,7 @@ spec:
267268
- FeatureModification
268269
- VolumeAttributesClass
269270
- DisablePDDefaultReadinessProbe
271+
- UsePDReadyAPI
270272
type: string
271273
stage:
272274
type: string

manifests/crd/core.pingcap.com_pdgroups.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,7 @@ spec:
107107
- FeatureModification
108108
- VolumeAttributesClass
109109
- DisablePDDefaultReadinessProbe
110+
- UsePDReadyAPI
110111
type: string
111112
type: array
112113
replicas:

manifests/crd/core.pingcap.com_pds.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@ spec:
8383
- FeatureModification
8484
- VolumeAttributesClass
8585
- DisablePDDefaultReadinessProbe
86+
- UsePDReadyAPI
8687
type: string
8788
type: array
8889
image:

0 commit comments

Comments
 (0)