Skip to content

Commit 16a0067

Browse files
okJiangti-chi-bot
authored andcommitted
This is an automated cherry-pick of tikv#9900
close tikv#10034 Signed-off-by: ti-chi-bot <ti-community-prow-bot@tidb.io>
1 parent d08fd48 commit 16a0067

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

53 files changed

+2290
-88
lines changed

.github/workflows/check.yaml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,10 @@ jobs:
1010
steps:
1111
- name: Checkout code
1212
uses: actions/checkout@v4
13-
- uses: actions/setup-go@v5
13+
- uses: actions/setup-go@v6
1414
with:
15-
go-version: '1.23'
15+
go-version: '1.25'
16+
check-latest: true
1617
- name: Make Check
1718
run: |
1819
SWAGGER=1 make build

.github/workflows/pd-docker-image.yaml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,9 @@ jobs:
1717
steps:
1818
- name: Checkout code
1919
uses: actions/checkout@v4
20-
- uses: actions/setup-go@v5
20+
- uses: actions/setup-go@v6
2121
with:
22-
go-version: '1.23'
22+
go-version: '1.25'
23+
check-latest: true
2324
- name: Make
2425
run: make docker-image

.github/workflows/pd-tests.yaml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,10 @@ jobs:
5151
steps:
5252
- name: Checkout code
5353
uses: actions/checkout@v4
54-
- uses: actions/setup-go@v5
54+
- uses: actions/setup-go@v6
5555
with:
56-
go-version: '1.23'
56+
go-version: '1.25'
57+
check-latest: true
5758
- name: ${{ matrix.name }}
5859
env:
5960
WORKER_ID: ${{ matrix.worker_id }}

.github/workflows/tso-function-test.yaml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,9 @@ jobs:
2323
steps:
2424
- name: Checkout code
2525
uses: actions/checkout@v4
26-
- uses: actions/setup-go@v5
26+
- uses: actions/setup-go@v6
2727
with:
28-
go-version: '1.23'
28+
go-version: '1.25'
29+
check-latest: true
2930
- name: Make TSO Function Test
3031
run: make test-tso-function

.golangci.yml

Lines changed: 268 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ linters:
2727
- makezero
2828
- protogetter
2929
- reassign
30+
<<<<<<< HEAD
3031
- intrange
3132
linters-settings:
3233
gocritic:
@@ -75,6 +76,273 @@ linters-settings:
7576
ignore-generated-header: false
7677
severity: error
7778
confidence: 0.8
79+
=======
80+
- recvcheck
81+
- revive
82+
- staticcheck
83+
- testifylint
84+
- unconvert
85+
- unparam
86+
- whitespace
87+
settings:
88+
depguard:
89+
rules:
90+
denied-deps:
91+
deny:
92+
- pkg: go.uber.org/atomic
93+
desc: Use 'sync/atomic' instead of 'go.uber.org/atomic'
94+
- pkg: github.com/pkg/errors
95+
desc: Use 'github.com/pingcap/errors' instead of 'github.com/pkg/errors'
96+
- pkg: "math/rand$"
97+
desc: "Use 'math/rand/v2' instead of 'math/rand'"
98+
errcheck:
99+
exclude-functions:
100+
- (*github.com/unrolled/render.Render).JSON
101+
- (*github.com/unrolled/render.Render).Data
102+
- (*github.com/unrolled/render.Render).Text
103+
- (net/http.ResponseWriter).Write
104+
- github.com/pingcap/log.Sync
105+
- (github.com/tikv/pd/pkg/ratelimit.Runner).RunTask
106+
gocritic:
107+
disabled-checks:
108+
- regexpMust
109+
- appendAssign
110+
- exitAfterDefer
111+
- ifElseChain
112+
- deprecatedComment
113+
# govet:
114+
# disable:
115+
# - buildtag
116+
goheader:
117+
values:
118+
regexp:
119+
COPYRIGHT-HEADER: Copyright \d{4} TiKV Project Authors.
120+
template: |-
121+
{{ COPYRIGHT-HEADER }}
122+
123+
Licensed under the Apache License, Version 2.0 (the "License");
124+
you may not use this file except in compliance with the License.
125+
You may obtain a copy of the License at
126+
127+
http://www.apache.org/licenses/LICENSE-2.0
128+
129+
Unless required by applicable law or agreed to in writing, software
130+
distributed under the License is distributed on an "AS IS" BASIS,
131+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
132+
See the License for the specific language governing permissions and
133+
limitations under the License.
134+
gosec:
135+
excludes:
136+
- G402
137+
- G404
138+
- G115
139+
perfsprint:
140+
string-format: false
141+
revive:
142+
confidence: 0.8
143+
severity: error
144+
rules:
145+
- name: atomic
146+
severity: warning
147+
disabled: false
148+
exclude:
149+
- ""
150+
- name: blank-imports
151+
severity: warning
152+
disabled: false
153+
exclude:
154+
- ""
155+
- name: confusing-naming
156+
severity: warning
157+
disabled: false
158+
exclude:
159+
- ""
160+
- name: confusing-results
161+
severity: warning
162+
disabled: false
163+
exclude:
164+
- ""
165+
- name: context-as-argument
166+
arguments:
167+
- allowTypesBefore: "*testing.T,*github.com/user/repo/testing.Harness"
168+
severity: warning
169+
disabled: false
170+
exclude:
171+
- ""
172+
- name: datarace
173+
severity: warning
174+
disabled: false
175+
exclude:
176+
- ""
177+
- name: defer
178+
arguments:
179+
- - call-chain
180+
- loop
181+
severity: warning
182+
disabled: false
183+
exclude:
184+
- ""
185+
- name: dot-imports
186+
severity: warning
187+
disabled: false
188+
exclude:
189+
- ""
190+
- name: duplicated-imports
191+
severity: warning
192+
disabled: false
193+
exclude:
194+
- ""
195+
- name: empty-block
196+
severity: warning
197+
disabled: false
198+
exclude:
199+
- ""
200+
- name: empty-lines
201+
severity: warning
202+
disabled: false
203+
exclude:
204+
- ""
205+
- name: error-return
206+
severity: warning
207+
disabled: false
208+
exclude:
209+
- ""
210+
- name: error-strings
211+
severity: warning
212+
disabled: false
213+
exclude:
214+
- ""
215+
- name: error-naming
216+
severity: warning
217+
disabled: false
218+
exclude:
219+
- ""
220+
- name: exported
221+
arguments:
222+
- checkPrivateReceivers
223+
- sayRepetitiveInsteadOfStutters
224+
severity: warning
225+
disabled: false
226+
exclude:
227+
- ""
228+
- name: identical-branches
229+
severity: warning
230+
disabled: false
231+
exclude:
232+
- ""
233+
- name: if-return
234+
severity: warning
235+
disabled: false
236+
exclude:
237+
- ""
238+
- name: modifies-parameter
239+
severity: warning
240+
disabled: false
241+
exclude:
242+
- ""
243+
- name: optimize-operands-order
244+
severity: warning
245+
disabled: false
246+
exclude:
247+
- ""
248+
- name: range
249+
severity: warning
250+
disabled: false
251+
exclude:
252+
- ""
253+
- name: range-val-in-closure
254+
severity: warning
255+
disabled: false
256+
exclude:
257+
- ""
258+
- name: range-val-address
259+
severity: warning
260+
disabled: false
261+
exclude:
262+
- ""
263+
- name: receiver-naming
264+
severity: warning
265+
disabled: false
266+
exclude:
267+
- ""
268+
- name: indent-error-flow
269+
severity: warning
270+
disabled: false
271+
exclude:
272+
- ""
273+
- name: superfluous-else
274+
severity: warning
275+
disabled: false
276+
exclude:
277+
- ""
278+
- name: unnecessary-stmt
279+
severity: warning
280+
disabled: false
281+
exclude:
282+
- ""
283+
- name: unreachable-code
284+
severity: warning
285+
disabled: false
286+
exclude:
287+
- ""
288+
- name: unused-parameter
289+
arguments:
290+
- allowRegex: ^_
291+
severity: warning
292+
disabled: false
293+
exclude:
294+
- ""
295+
- name: unused-receiver
296+
severity: warning
297+
disabled: false
298+
exclude:
299+
- ""
300+
- name: useless-break
301+
severity: warning
302+
disabled: false
303+
exclude:
304+
- ""
305+
- name: var-naming
306+
severity: warning
307+
disabled: false
308+
exclude:
309+
- ""
310+
arguments:
311+
- [""] # AllowList
312+
- [""] # DenyList
313+
- - skip-package-name-checks: true
314+
- name: waitgroup-by-value
315+
severity: warning
316+
disabled: false
317+
exclude:
318+
- ""
319+
testifylint:
320+
enable:
321+
- blank-import
322+
- bool-compare
323+
- compares
324+
- empty
325+
- error-is-as
326+
- error-nil
327+
- expected-actual
328+
- formatter
329+
- len
330+
- negative-positive
331+
- require-error
332+
- suite-dont-use-pkg
333+
- suite-extra-assert-call
334+
- suite-subtest-run
335+
- useless-assert
336+
disable:
337+
- float-compare
338+
- go-require
339+
exclusions:
340+
generated: lax
341+
presets:
342+
- common-false-positives
343+
- legacy
344+
- std-error-handling
345+
>>>>>>> 27c2705800 (go: update Go version to 1.25.3 (#9900))
78346
rules:
79347
- name: atomic
80348
severity: warning

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM golang:1.23-alpine as builder
1+
FROM golang:1.25-alpine as builder
22

33
RUN apk add --no-cache \
44
make \

Makefile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,11 @@ SHELL := env PATH='$(PATH)' GOBIN='$(GO_TOOLS_BIN_PATH)' $(shell which bash)
170170

171171
install-tools:
172172
@mkdir -p $(GO_TOOLS_BIN_PATH)
173+
<<<<<<< HEAD
173174
@which golangci-lint >/dev/null 2>&1 || curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(GO_TOOLS_BIN_PATH) v1.61.0
175+
=======
176+
@which golangci-lint >/dev/null 2>&1 || curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(GO_TOOLS_BIN_PATH) v2.6.0
177+
>>>>>>> 27c2705800 (go: update Go version to 1.25.3 (#9900))
174178
@grep '_' tools.go | sed 's/"//g' | awk '{print $$2}' | xargs go install
175179

176180
.PHONY: install-tools

client/client.go

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -729,6 +729,7 @@ func (c *client) GetTSAsync(ctx context.Context) TSFuture {
729729
}
730730

731731
// GetLocalTSAsync implements the TSOClient interface.
732+
<<<<<<< HEAD
732733
func (c *client) GetLocalTSAsync(ctx context.Context, dcLocation string) TSFuture {
733734
defer trace.StartRegion(ctx, "pdclient.GetLocalTSAsync").End()
734735
if span := opentracing.SpanFromContext(ctx); span != nil && span.Tracer() != nil {
@@ -737,6 +738,15 @@ func (c *client) GetLocalTSAsync(ctx context.Context, dcLocation string) TSFutur
737738
}
738739

739740
return c.dispatchTSORequestWithRetry(ctx, dcLocation)
741+
=======
742+
//
743+
// Deprecated: the Local TSO feature has been deprecated. Regardless of the
744+
// parameters passed, the behavior of this interface will be equivalent to
745+
// `GetTSAsync`. If you want to use a separately deployed TSO service,
746+
// please refer to the deployment of the TSO microservice.
747+
func (c *client) GetLocalTSAsync(ctx context.Context, _ string) tso.TSFuture {
748+
return c.GetTSAsync(ctx)
749+
>>>>>>> 27c2705800 (go: update Go version to 1.25.3 (#9900))
740750
}
741751

742752
func (c *client) dispatchTSORequestWithRetry(ctx context.Context, dcLocation string) TSFuture {
@@ -781,9 +791,19 @@ func (c *client) GetTS(ctx context.Context) (physical int64, logical int64, err
781791
}
782792

783793
// GetLocalTS implements the TSOClient interface.
794+
<<<<<<< HEAD
784795
func (c *client) GetLocalTS(ctx context.Context, dcLocation string) (physical int64, logical int64, err error) {
785796
resp := c.GetLocalTSAsync(ctx, dcLocation)
786797
return resp.Wait()
798+
=======
799+
//
800+
// Deprecated: the Local TSO feature has been deprecated. Regardless of the
801+
// parameters passed, the behavior of this interface will be equivalent to
802+
// `GetTS`. If you want to use a separately deployed TSO service,
803+
// please refer to the deployment of the TSO microservice.
804+
func (c *client) GetLocalTS(ctx context.Context, _ string) (physical int64, logical int64, err error) {
805+
return c.GetTS(ctx)
806+
>>>>>>> 27c2705800 (go: update Go version to 1.25.3 (#9900))
787807
}
788808

789809
// GetMinTS implements the TSOClient interface.

0 commit comments

Comments
 (0)