Skip to content

Commit b1cc94c

Browse files
committed
Merge branch 'main' into fix-hex-json-printer
2 parents d39583f + 8e44d3a commit b1cc94c

File tree

10 files changed

+91
-63
lines changed

10 files changed

+91
-63
lines changed

CHANGELOG/CHANGELOG-3.6.md

+10
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,16 @@ Previous change logs can be found at [CHANGELOG-3.5](https://github.com/etcd-io/
88

99
<hr>
1010

11+
## v3.6.0-rc.1 (TBD)
12+
13+
### etcdctl v3
14+
15+
- Add [`DowngradeInfo` in result of endpoint status](https://github.com/etcd-io/etcd/pull/19471)
16+
17+
### etcd server
18+
19+
- Add [`DowngradeInfo` to endpoint status response](https://github.com/etcd-io/etcd/pull/19471)
20+
1121
## v3.6.0-rc.0 (2025-02-13)
1222

1323
See [code changes](https://github.com/etcd-io/etcd/compare/v3.5.0...v3.6.0).

Documentation/contributor-guide/release.md

+4-2
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,18 @@ The procedure includes some manual steps for sanity checking, but it can probabl
66

77
## Release management
88

9-
The following pool of release candidates manages the release of each etcd major/minor version as well as manages patches
9+
Under the leadership of **James Blair** [@jmhbnz](https://github.com/jmhbnz) and **Ivan Valdes Castillo** [@ivanvc](https://github.com/ivanvc), the following pool of release candidates manages the release of each etcd major/minor version as well as manages patches
1010
to each stable release branch. They are responsible for communicating the timelines and status of each release and
1111
for ensuring the stability of the release branch.
1212

1313
- Benjamin Wang [@ahrtr](https://github.com/ahrtr)
14+
- Fu Wei [@fuweid](https://github.com/fuweid)
1415
- James Blair [@jmhbnz](https://github.com/jmhbnz)
16+
- Ivan Valdes Castillo [@ivanvc](https://github.com/ivanvc)
1517
- Marek Siarkowicz [@serathius](https://github.com/serathius)
1618
- Sahdev Zala [@spzala](https://github.com/spzala)
19+
- Siyuan Zhang [@siyuanfoundation](https://github.com/siyuanfoundation)
1720
- Wenjia Zhang [@wenjiaswe](https://github.com/wenjiaswe)
18-
- Ivan Valdes Castillo [@ivanvc](https://github.com/ivanvc)
1921

2022
All release version numbers follow the format of [semantic versioning 2.0.0](http://semver.org/).
2123

tests/common/lease_test.go

+18-2
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ func TestLeaseGrantTimeToLiveExpired(t *testing.T) {
122122

123123
for _, tc := range clusterTestCases() {
124124
t.Run(tc.name, func(t *testing.T) {
125-
ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second)
125+
ctx, cancel := context.WithTimeout(context.Background(), 15*time.Second)
126126
defer cancel()
127127
clus := testRunner.NewCluster(ctx, t, config.WithClusterConfig(tc.config))
128128
defer clus.Close()
@@ -139,7 +139,23 @@ func TestLeaseGrantTimeToLiveExpired(t *testing.T) {
139139
require.NoError(t, err)
140140
require.Equal(t, int64(1), getResp.Count)
141141

142-
time.Sleep(3 * time.Second)
142+
// FIXME: When leader changes, old leader steps
143+
// back to follower and ignores the lease revoking.
144+
// The new leader will restart TTL counting. If so,
145+
// we should call time.Sleep again and wait for revoking.
146+
// It can't avoid flakey but reduce flakey possiblility.
147+
for i := 0; i < 3; i++ {
148+
currentLeader := clus.WaitLeader(t)
149+
t.Logf("[%d] current leader index %d", i, currentLeader)
150+
151+
time.Sleep(3 * time.Second)
152+
153+
newLeader := clus.WaitLeader(t)
154+
if newLeader == currentLeader {
155+
break
156+
}
157+
t.Logf("[%d] leader changed, new leader index %d", i, newLeader)
158+
}
143159

144160
ttlResp, err := cc.TimeToLive(ctx, leaseResp.ID, config.LeaseOption{})
145161
require.NoError(t, err)

tests/integration/clientv3/examples/example_cluster_test.go

+10-10
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,12 @@ import (
2222
clientv3 "go.etcd.io/etcd/client/v3"
2323
)
2424

25-
func mockCluster_memberList() {
25+
func mockClusterMemberList() {
2626
fmt.Println("members: 3")
2727
}
2828

2929
func ExampleCluster_memberList() {
30-
forUnitTestsRunInMockedContext(mockCluster_memberList, func() {
30+
forUnitTestsRunInMockedContext(mockClusterMemberList, func() {
3131
cli, err := clientv3.New(clientv3.Config{
3232
Endpoints: exampleEndpoints(),
3333
DialTimeout: dialTimeout,
@@ -46,13 +46,13 @@ func ExampleCluster_memberList() {
4646
// Output: members: 3
4747
}
4848

49-
func mockCluster_memberAdd() {
49+
func mockClusterMemberAdd() {
5050
fmt.Println("added member.PeerURLs: [http://localhost:32380]")
5151
fmt.Println("members count: 4")
5252
}
5353

5454
func ExampleCluster_memberAdd() {
55-
forUnitTestsRunInMockedContext(mockCluster_memberAdd, func() {
55+
forUnitTestsRunInMockedContext(mockClusterMemberAdd, func() {
5656
cli, err := clientv3.New(clientv3.Config{
5757
Endpoints: exampleEndpoints(),
5858
DialTimeout: dialTimeout,
@@ -81,13 +81,13 @@ func ExampleCluster_memberAdd() {
8181
// members count: 4
8282
}
8383

84-
func mockCluster_memberAddAsLearner() {
84+
func mockClusterMemberAddAsLearner() {
8585
fmt.Println("members count: 4")
8686
fmt.Println("added member.IsLearner: true")
8787
}
8888

8989
func ExampleCluster_memberAddAsLearner() {
90-
forUnitTestsRunInMockedContext(mockCluster_memberAddAsLearner, func() {
90+
forUnitTestsRunInMockedContext(mockClusterMemberAddAsLearner, func() {
9191
cli, err := clientv3.New(clientv3.Config{
9292
Endpoints: exampleEndpoints(),
9393
DialTimeout: dialTimeout,
@@ -116,10 +116,10 @@ func ExampleCluster_memberAddAsLearner() {
116116
// added member.IsLearner: true
117117
}
118118

119-
func mockCluster_memberRemove() {}
119+
func mockClusterMemberRemove() {}
120120

121121
func ExampleCluster_memberRemove() {
122-
forUnitTestsRunInMockedContext(mockCluster_memberRemove, func() {
122+
forUnitTestsRunInMockedContext(mockClusterMemberRemove, func() {
123123
cli, err := clientv3.New(clientv3.Config{
124124
Endpoints: exampleEndpoints(),
125125
DialTimeout: dialTimeout,
@@ -147,10 +147,10 @@ func ExampleCluster_memberRemove() {
147147
})
148148
}
149149

150-
func mockCluster_memberUpdate() {}
150+
func mockClusterMemberUpdate() {}
151151

152152
func ExampleCluster_memberUpdate() {
153-
forUnitTestsRunInMockedContext(mockCluster_memberUpdate, func() {
153+
forUnitTestsRunInMockedContext(mockClusterMemberUpdate, func() {
154154
cli, err := clientv3.New(clientv3.Config{
155155
Endpoints: exampleEndpoints(),
156156
DialTimeout: dialTimeout,

tests/integration/clientv3/examples/example_kv_test.go

+23-23
Original file line numberDiff line numberDiff line change
@@ -16,17 +16,18 @@ package clientv3_test
1616

1717
import (
1818
"context"
19+
"errors"
1920
"fmt"
2021
"log"
2122

2223
"go.etcd.io/etcd/api/v3/v3rpc/rpctypes"
2324
clientv3 "go.etcd.io/etcd/client/v3"
2425
)
2526

26-
func mockKV_put() {}
27+
func mockKVPut() {}
2728

2829
func ExampleKV_put() {
29-
forUnitTestsRunInMockedContext(mockKV_put, func() {
30+
forUnitTestsRunInMockedContext(mockKVPut, func() {
3031
cli, err := clientv3.New(clientv3.Config{
3132
Endpoints: exampleEndpoints(),
3233
DialTimeout: dialTimeout,
@@ -46,12 +47,12 @@ func ExampleKV_put() {
4647
// Output:
4748
}
4849

49-
func mockKV_putErrorHandling() {
50+
func mockKVPutErrorHandling() {
5051
fmt.Println("client-side error: etcdserver: key is not provided")
5152
}
5253

5354
func ExampleKV_putErrorHandling() {
54-
forUnitTestsRunInMockedContext(mockKV_putErrorHandling, func() {
55+
forUnitTestsRunInMockedContext(mockKVPutErrorHandling, func() {
5556
cli, err := clientv3.New(clientv3.Config{
5657
Endpoints: exampleEndpoints(),
5758
DialTimeout: dialTimeout,
@@ -65,27 +66,26 @@ func ExampleKV_putErrorHandling() {
6566
_, err = cli.Put(ctx, "", "sample_value")
6667
cancel()
6768
if err != nil {
68-
switch err {
69-
case context.Canceled:
69+
if errors.Is(err, context.Canceled) {
7070
fmt.Printf("ctx is canceled by another routine: %v\n", err)
71-
case context.DeadlineExceeded:
71+
} else if errors.Is(err, context.DeadlineExceeded) {
7272
fmt.Printf("ctx is attached with a deadline is exceeded: %v\n", err)
73-
case rpctypes.ErrEmptyKey:
73+
} else if errors.Is(err, rpctypes.ErrEmptyKey) {
7474
fmt.Printf("client-side error: %v\n", err)
75-
default:
75+
} else {
7676
fmt.Printf("bad cluster endpoints, which are not etcd servers: %v\n", err)
7777
}
7878
}
7979
})
8080
// Output: client-side error: etcdserver: key is not provided
8181
}
8282

83-
func mockKV_get() {
83+
func mockKVGet() {
8484
fmt.Println("foo : bar")
8585
}
8686

8787
func ExampleKV_get() {
88-
forUnitTestsRunInMockedContext(mockKV_get, func() {
88+
forUnitTestsRunInMockedContext(mockKVGet, func() {
8989
cli, err := clientv3.New(clientv3.Config{
9090
Endpoints: exampleEndpoints(),
9191
DialTimeout: dialTimeout,
@@ -113,12 +113,12 @@ func ExampleKV_get() {
113113
// Output: foo : bar
114114
}
115115

116-
func mockKV_getWithRev() {
116+
func mockKVGetWithRev() {
117117
fmt.Println("foo : bar1")
118118
}
119119

120120
func ExampleKV_getWithRev() {
121-
forUnitTestsRunInMockedContext(mockKV_getWithRev, func() {
121+
forUnitTestsRunInMockedContext(mockKVGetWithRev, func() {
122122
cli, err := clientv3.New(clientv3.Config{
123123
Endpoints: exampleEndpoints(),
124124
DialTimeout: dialTimeout,
@@ -150,14 +150,14 @@ func ExampleKV_getWithRev() {
150150
// Output: foo : bar1
151151
}
152152

153-
func mockKV_getSortedPrefix() {
153+
func mockKVGetSortedPrefix() {
154154
fmt.Println(`key_2 : value`)
155155
fmt.Println(`key_1 : value`)
156156
fmt.Println(`key_0 : value`)
157157
}
158158

159159
func ExampleKV_getSortedPrefix() {
160-
forUnitTestsRunInMockedContext(mockKV_getSortedPrefix, func() {
160+
forUnitTestsRunInMockedContext(mockKVGetSortedPrefix, func() {
161161
cli, err := clientv3.New(clientv3.Config{
162162
Endpoints: exampleEndpoints(),
163163
DialTimeout: dialTimeout,
@@ -192,12 +192,12 @@ func ExampleKV_getSortedPrefix() {
192192
// key_0 : value
193193
}
194194

195-
func mockKV_delete() {
195+
func mockKVDelete() {
196196
fmt.Println("Deleted all keys: true")
197197
}
198198

199199
func ExampleKV_delete() {
200-
forUnitTestsRunInMockedContext(mockKV_delete, func() {
200+
forUnitTestsRunInMockedContext(mockKVDelete, func() {
201201
cli, err := clientv3.New(clientv3.Config{
202202
Endpoints: exampleEndpoints(),
203203
DialTimeout: dialTimeout,
@@ -228,10 +228,10 @@ func ExampleKV_delete() {
228228
// Deleted all keys: true
229229
}
230230

231-
func mockKV_compact() {}
231+
func mockKVCompact() {}
232232

233233
func ExampleKV_compact() {
234-
forUnitTestsRunInMockedContext(mockKV_compact, func() {
234+
forUnitTestsRunInMockedContext(mockKVCompact, func() {
235235
cli, err := clientv3.New(clientv3.Config{
236236
Endpoints: exampleEndpoints(),
237237
DialTimeout: dialTimeout,
@@ -259,12 +259,12 @@ func ExampleKV_compact() {
259259
// Output:
260260
}
261261

262-
func mockKV_txn() {
262+
func mockKVTxn() {
263263
fmt.Println("key : XYZ")
264264
}
265265

266266
func ExampleKV_txn() {
267-
forUnitTestsRunInMockedContext(mockKV_txn, func() {
267+
forUnitTestsRunInMockedContext(mockKVTxn, func() {
268268
cli, err := clientv3.New(clientv3.Config{
269269
Endpoints: exampleEndpoints(),
270270
DialTimeout: dialTimeout,
@@ -306,10 +306,10 @@ func ExampleKV_txn() {
306306
// Output: key : XYZ
307307
}
308308

309-
func mockKV_do() {}
309+
func mockKVDo() {}
310310

311311
func ExampleKV_do() {
312-
forUnitTestsRunInMockedContext(mockKV_do, func() {
312+
forUnitTestsRunInMockedContext(mockKVDo, func() {
313313
cli, err := clientv3.New(clientv3.Config{
314314
Endpoints: exampleEndpoints(),
315315
DialTimeout: dialTimeout,

tests/integration/clientv3/examples/example_lease_test.go

+8-8
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,11 @@ import (
2222
clientv3 "go.etcd.io/etcd/client/v3"
2323
)
2424

25-
func mockLease_grant() {
25+
func mockLeaseGrant() {
2626
}
2727

2828
func ExampleLease_grant() {
29-
forUnitTestsRunInMockedContext(mockLease_grant, func() {
29+
forUnitTestsRunInMockedContext(mockLeaseGrant, func() {
3030
cli, err := clientv3.New(clientv3.Config{
3131
Endpoints: exampleEndpoints(),
3232
DialTimeout: dialTimeout,
@@ -51,12 +51,12 @@ func ExampleLease_grant() {
5151
// Output:
5252
}
5353

54-
func mockLease_revoke() {
54+
func mockLeaseRevoke() {
5555
fmt.Println("number of keys: 0")
5656
}
5757

5858
func ExampleLease_revoke() {
59-
forUnitTestsRunInMockedContext(mockLease_revoke, func() {
59+
forUnitTestsRunInMockedContext(mockLeaseRevoke, func() {
6060
cli, err := clientv3.New(clientv3.Config{
6161
Endpoints: exampleEndpoints(),
6262
DialTimeout: dialTimeout,
@@ -91,12 +91,12 @@ func ExampleLease_revoke() {
9191
// Output: number of keys: 0
9292
}
9393

94-
func mockLease_keepAlive() {
94+
func mockLeaseKeepAlive() {
9595
fmt.Println("ttl: 5")
9696
}
9797

9898
func ExampleLease_keepAlive() {
99-
forUnitTestsRunInMockedContext(mockLease_keepAlive, func() {
99+
forUnitTestsRunInMockedContext(mockLeaseKeepAlive, func() {
100100
cli, err := clientv3.New(clientv3.Config{
101101
Endpoints: exampleEndpoints(),
102102
DialTimeout: dialTimeout,
@@ -132,12 +132,12 @@ func ExampleLease_keepAlive() {
132132
// Output: ttl: 5
133133
}
134134

135-
func mockLease_keepAliveOnce() {
135+
func mockLeaseKeepAliveOnce() {
136136
fmt.Println("ttl: 5")
137137
}
138138

139139
func ExampleLease_keepAliveOnce() {
140-
forUnitTestsRunInMockedContext(mockLease_keepAliveOnce, func() {
140+
forUnitTestsRunInMockedContext(mockLeaseKeepAliveOnce, func() {
141141
cli, err := clientv3.New(clientv3.Config{
142142
Endpoints: exampleEndpoints(),
143143
DialTimeout: dialTimeout,

tests/integration/clientv3/examples/example_maintenance_test.go

+4-4
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,10 @@ import (
2121
clientv3 "go.etcd.io/etcd/client/v3"
2222
)
2323

24-
func mockMaintenance_status() {}
24+
func mockMaintenanceStatus() {}
2525

2626
func ExampleMaintenance_status() {
27-
forUnitTestsRunInMockedContext(mockMaintenance_status, func() {
27+
forUnitTestsRunInMockedContext(mockMaintenanceStatus, func() {
2828
for _, ep := range exampleEndpoints() {
2929
cli, err := clientv3.New(clientv3.Config{
3030
Endpoints: []string{ep},
@@ -44,10 +44,10 @@ func ExampleMaintenance_status() {
4444
// Output:
4545
}
4646

47-
func mockMaintenance_defragment() {}
47+
func mockMaintenanceDefragment() {}
4848

4949
func ExampleMaintenance_defragment() {
50-
forUnitTestsRunInMockedContext(mockMaintenance_defragment, func() {
50+
forUnitTestsRunInMockedContext(mockMaintenanceDefragment, func() {
5151
for _, ep := range exampleEndpoints() {
5252
cli, err := clientv3.New(clientv3.Config{
5353
Endpoints: []string{ep},

0 commit comments

Comments
 (0)