21829 Commits

Author SHA1 Message Date
Chun-Hung Tseng
65c1213c7c
Fix lint
Signed-off-by: Chun-Hung Tseng <henrybear327@gmail.com>
2024-09-25 15:00:02 +02:00
Chun-Hung Tseng
85f7a9206b
Remove packet modification
Signed-off-by: Chun-Hung Tseng <henrybear327@gmail.com>
2024-09-25 14:36:42 +02:00
Chun-Hung Tseng
e7b77bb914
Remove pause
Signed-off-by: Chun-Hung Tseng <henrybear327@gmail.com>
2024-09-25 14:36:42 +02:00
Siyuan Zhang
ac592a2f97
Fix Blackhole implementation for e2e tests
Based on Fu Wei's idea discussed in the issue [1], we employ the network traffic blocking on L7, using a forward proxy, without the need to use external tools.

[Background]

A peer will
(a) receive traffic from its peers
(b) initiate connections to its peers (via stream and pipeline).

Thus, the current mechanism of only blocking peer traffic via the peer's existing reverse proxy is insufficient, since only scenario (a) is handled, and scenario (b) is not blocked at all.

[Proposed solution]

We introduce a forward proxy for each peer, which will be proxying all the connections initiated from a peer to its peers.

We will remove the current use of the reverse proxy, as the forward proxy holds the information of the destination, we can block all in and out traffic that is initiated from a peer to others, without having to resort to external tools, such as iptables.

The modified architecture will look something like this:
```
A --- A's forward proxy ----- B
   ^ newly introduced
```

It's verified that the blocking of traffic is complete, compared to previous solutions attempted in PRs [2][3].

[Implementation]

The main subtasks are
- redesigned as an L7 forward proxy
- Unix socket support is dropped: e2e test supports unix sockets for peer communication, but only several e2e test cases use Unix sockets as majority of e2e test cases use HTTP/HTTPS
- introduce a new environment variable `E2E_TEST_FORWARD_PROXY_IP`
- implement L7 forward proxy by drastically reducing the existing proxy server code and design to use blocking traffic

Known limitations are
- Doesn't support unix socket (L7 HTTP transport proxy only supports HTTP/HTTPS/and socks5)
- It's L7 so we need to send a perfectly crafted HTTP request
-Doesn’t support reordering, dropping, etc. packets on-the-fly

[Testing]
- `make gofail-enable && make build && make gofail-disable && go test -timeout 60s -run ^TestBlackholeByMockingPartitionLeader$ go.etcd.io/etcd/tests/v3/e2e -v -count=1`
- `make gofail-enable && make build && make gofail-disable && go test -timeout 60s -run ^TestBlackholeByMockingPartitionFollower$ go.etcd.io/etcd/tests/v3/e2e -v -count=1`
- `go test -timeout 30s -run ^TestServer_ go.etcd.io/etcd/pkg/v3/proxy -v -failfast`

[References]
[1] issue https://github.com/etcd-io/etcd/issues/17737
[2] PR (V1) https://github.com/henrybear327/etcd/tree/fix/e2e_blackhole
[3] PR (V2) https://github.com/etcd-io/etcd/pull/17891
[4] https://github.com/etcd-io/etcd/pull/17938#discussion_r1615622709
[5] https://github.com/etcd-io/etcd/pull/17985#discussion_r1598020110

Signed-off-by: Siyuan Zhang <sizhang@google.com>
Co-authored-by: Iván Valdés Castillo <iv@nvald.es>
Signed-off-by: Chun-Hung Tseng <henrybear327@gmail.com>
2024-09-25 14:36:42 +02:00
Benjamin Wang
5704c6148d
Merge pull request #18605 from lucasrod16/use-single-function-to-create-WAL-files
Add function to create WAL files
2024-09-24 19:44:39 +01:00
Lucas Rodriguez
680eadf0d6 Add function to create WAL files
Signed-off-by: Lucas Rodriguez <lucas.rodriguez9616@gmail.com>
2024-09-24 12:55:24 -05:00
Benjamin Wang
59cfd7a61d
Merge pull request #18612 from Kamandlou/km-dev
update: `cobra.ExactValidArgs` method is deprecated
2024-09-24 10:05:29 +01:00
Benjamin Wang
acb1b176ac
Merge pull request #18633 from ivanvc/remove-build-github-workflows
github: remove build job
2024-09-24 10:04:42 +01:00
Benjamin Wang
6619b9f84c
Merge pull request #18580 from myrat92/fix-issue-184113
docs: fix description of WatchResponse.canceled
2024-09-24 09:51:53 +01:00
Benjamin Wang
c79c7d5440
Merge pull request #18625 from redwrasse/redwrasse/ep-command-errors-is
command: Use errors.Is for error equality check in ep_command.go
2024-09-24 09:32:12 +01:00
James Blair
7e04b33349
Merge pull request #18624 from etcd-io/dependabot/github_actions/github/codeql-action-3.26.8
build(deps): bump github/codeql-action from 3.26.7 to 3.26.8
2024-09-24 17:11:37 +10:00
dependabot[bot]
204ef59f81
build(deps): bump github/codeql-action from 3.26.7 to 3.26.8
Bumps [github/codeql-action](https://github.com/github/codeql-action) from 3.26.7 to 3.26.8.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](8214744c54...294a9d9291)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-09-24 02:36:34 +00:00
James Blair
fd83aba9b9
Merge pull request #18623 from etcd-io/dependabot/docker/distroless/static-debian12-b033683de7de51d8cce5aa4b47c1b9906786f6256017ca8b17b2551947fcf6d8
build(deps): bump distroless/static-debian12 from `95eb83a` to `b033683`
2024-09-24 12:35:32 +10:00
dependabot[bot]
3ec8d3fd0b
build(deps): bump distroless/static-debian12 from 95eb83a to b033683
Bumps distroless/static-debian12 from `95eb83a` to `b033683`.

---
updated-dependencies:
- dependency-name: distroless/static-debian12
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-09-23 23:41:27 +00:00
Ivan Valdes
3347d985ec
github: remove build job
This job was migrated to the prow infrastructure in May
(https://github.com/kubernetes/test-infra/pull/32672). Deleting the
GitHub workflow to remove duplicate jobs should be fine.

Signed-off-by: Ivan Valdes <ivan@vald.es>
2024-09-23 14:50:01 -07:00
redwrasse
6767e1ff64 command: Use errors.Is for error equality check in ep_command.go
Signed-off-by: redwrasse <mail@redwrasse.io>
2024-09-23 10:12:40 -07:00
Kamandlou
063627e42f update: cobra.ExactValidArgs method is deprecated
Signed-off-by: Kamandlou <ahkamandlou@gmail.com>
2024-09-23 17:22:05 +03:30
James Blair
bd93a0060a
Merge pull request #18610 from henrybear327/dependencies/09_18_24
[2024-09-19] Bump dependency updates identified by dependabot
2024-09-23 15:09:33 +10:00
Benjamin Wang
112e6a32ef
Merge pull request #18615 from redwrasse/redwrasse/etcdctl/rest-of-errors-is
etcdctl: remaining errors.Is conversions
2024-09-22 19:37:53 +01:00
Benjamin Wang
75ed4ef83b
Merge pull request #18616 from redwrasse/redwrasse/contrib/rest-of-errors-is
contrib: remaining errors.Is conversions
2024-09-22 19:37:29 +01:00
Benjamin Wang
2791941d1d
Merge pull request #18619 from redwrasse/redwrasse/ioutil/remaining-errors-is
ioutil: remaining errors.Is conversions
2024-09-22 19:34:06 +01:00
Chun-Hung Tseng
35edbf91ad dependency: bump github.com/golangci/golangci-lint from 1.60.3 to 1.61.0 and google.golang.org/genproto/googleapis/rpc from v0.0.0-20240822170219-fc7c04adadcd to v0.0.0-20240903143218-8af14fe29dc1
Also fix the inconsistent version issue.

Reference:
- https://github.com/etcd-io/etcd/pull/18596

Signed-off-by: Chun-Hung Tseng <henrybear327@gmail.com>
2024-09-22 17:50:56 +02:00
Chun-Hung Tseng
1199fa89a0 dependency: bump golang.org/x/net from 0.28.0 to 0.29.0
Reference:
- https://github.com/etcd-io/etcd/pull/18597

Signed-off-by: Chun-Hung Tseng <henrybear327@gmail.com>
2024-09-22 17:50:12 +02:00
Benjamin Wang
2f9532bfca
Merge pull request #18608 from srivastav-abhishek/periodic-compaction-flake-fix
Fixed periodic compaction tests
2024-09-22 09:17:13 +01:00
redwrasse
c568ce621b ioutil: remaining errors.Is conversions
Signed-off-by: redwrasse <mail@redwrasse.io>
2024-09-20 15:57:00 -07:00
redwrasse
f6278ef2a9 contrib: remaining errors.Is conversions
Signed-off-by: redwrasse <mail@redwrasse.io>
2024-09-20 15:44:13 -07:00
redwrasse
0a355d3fbd etcdctl: remaining errors.Is conversions for error equality and inequality checks
Signed-off-by: redwrasse <mail@redwrasse.io>
2024-09-20 15:38:46 -07:00
redwrasse
d59fa331c5 Replaces rest of error equality checks with errors.Is
Signed-off-by: redwrasse <mail@redwrasse.io>
2024-09-20 15:06:10 -07:00
Benjamin Wang
6ea81c1a34
Merge pull request #18600 from ivanvc/update-release-doc-after-observations-from-3.4.34
docs: update release.md with improvements from v3.4.34 release
2024-09-20 10:42:34 +01:00
Marek Siarkowicz
1820d3b7d5
Merge pull request #18510 from redwrasse/redwrasse/errors-is
Use errors.Is for error equality checks
2024-09-20 09:02:40 +02:00
Joshua Zhang
b8cb654be6 Use strict synchronization for revision getter to minimize flaky result caused by time racing.
Signed-off-by: Joshua Zhang <joshuazh@microsoft.com>

Addressed review comments

Co-authored-by: Abhishek Kr Srivastav <Abhishek.kr.srivastav@ibm.com>
Signed-off-by: Abhishek Kr Srivastav <Abhishek.kr.srivastav@ibm.com>
2024-09-19 17:34:24 +05:30
Benjamin Wang
9fc3b2ad40
Merge pull request #18590 from henrybear327/ci/fix
Add tools/mod to module_dirs
2024-09-19 10:36:12 +01:00
Marek Siarkowicz
ce07474c0b
Merge pull request #18603 from lekaf974/feat/rename-module-exp
Rename modules_exp to modules_for_bom to improve code and clarity
2024-09-19 10:00:30 +02:00
mevrin
5b2faec983
fea: Remane modules_exp to modules_for_bom to improve code and clarity
Signed-off-by: mevrin <matthieu.evrin@gmail.com>
2024-09-18 21:45:07 -04:00
Chun-Hung Tseng
fc901bd019 Add tools/mod to module_dirs
As `tools/mod` also contains the `go.mod` file. We should add it to the
`module_dirs` variable, so that when executing `./scripts/fix.sh`, the
proper checks and fixes can be applied.

To address the issue of broken unit tests and code coverage due to the
directory's lack of Go code, we've introduced a new doc.go file. This
file acts as a placeholder, enabling tools like golangci-lint and
go test to function correctly.

---

Discovered when working on https://github.com/etcd-io/etcd/pull/18575

The directories are checked against the following:
- Command: `find . -type f -name go.mod -exec dirname {} \;`
- Output:
```
./etcdutl
.
./tools/testgrid-analysis
./tools/rw-heatmaps
./tools/mod
./etcdctl
./tests
./server
./api
./client/internal/v2
./client/v3
./client/pkg
./pkg
```

Signed-off-by: Chun-Hung Tseng <henrybear327@gmail.com>
2024-09-18 14:33:13 +02:00
zhanghangfeng
4155d8bb5b docs: fix description of WatchResponse.canceled
Signed-off-by: Myrat92 <zjsegzhf@gmail.com>
2024-09-18 15:10:07 +08:00
Ivan Valdes
7e3901fb04
docs: update release.md with improvements from v3.4.34 release
Signed-off-by: Ivan Valdes <ivan@vald.es>
2024-09-17 13:57:20 -07:00
Marek Siarkowicz
2ed418c191
Merge pull request #18574 from lucasrod16/18571-ensure-consistent-permissions-for-broken-WAL-files
Ensure consistent file permissions on broken WAL files
2024-09-17 09:54:59 +02:00
James Blair
4b8655ea00
Merge pull request #18598 from etcd-io/dependabot/github_actions/github/codeql-action-3.26.7
build(deps): bump github/codeql-action from 3.26.6 to 3.26.7
2024-09-17 06:08:57 +10:00
Lucas Rodriguez
d12bb7e0fb Ensure consistent file permissions on broken WAL
Signed-off-by: Lucas Rodriguez <lucas.rodriguez9616@gmail.com>
2024-09-16 14:07:16 -05:00
dependabot[bot]
2d5e1858cd
build(deps): bump github/codeql-action from 3.26.6 to 3.26.7
Bumps [github/codeql-action](https://github.com/github/codeql-action) from 3.26.6 to 3.26.7.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](4dd16135b6...8214744c54)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-09-16 17:47:08 +00:00
Benjamin Wang
7f399ee50c
Merge pull request #18592 from jmhbnz/main
Ensure commits are signed in `scripts/release.sh`
2024-09-16 14:09:51 +01:00
James Blair
7e8e0bf1f9
Ensure commits are signed in scripts/release.sh.
Signed-off-by: James Blair <mail@jamesblair.net>
2024-09-16 11:31:30 +12:00
James Blair
6c1fe4a92a
Merge pull request #18575 from henrybear327/dependencies/09_11_24
[2024-09-11] Bump dependency updates identified by dependabot
2024-09-15 17:28:45 +10:00
Chun-Hung Tseng
14d54893e0 dependency: bump golang.org/x/crypto from 0.26.0 to 0.27.0
golang.org/x/sys and golang.org/x/text version inconsistency are also
addressed:
- bump golang.org/x/sys from 0.24.0 to 0.25.0
- bump golang.org/x/text from 0.17.0 to 0.18.0

Reference:
- https://github.com/etcd-io/etcd/pull/18563
- https://github.com/etcd-io/etcd/pull/18558
- https://github.com/etcd-io/etcd/pull/18566
- https://github.com/etcd-io/etcd/pull/18565

Signed-off-by: Chun-Hung Tseng <henrybear327@gmail.com>
2024-09-14 22:29:31 +02:00
Chun-Hung Tseng
a976ba136d dependency: bump github.com/prometheus/client_golang from 1.20.2 to 1.20.3
Reference:
- https://github.com/etcd-io/etcd/pull/18564
- https://github.com/etcd-io/etcd/pull/18559

Signed-off-by: Chun-Hung Tseng <henrybear327@gmail.com>
2024-09-14 22:10:04 +02:00
Chun-Hung Tseng
636f191368 dependency: bump github.com/prometheus/common from 0.57.0 to 0.59.1
Reference:
- https://github.com/etcd-io/etcd/pull/18562
- https://github.com/etcd-io/etcd/pull/18567

Signed-off-by: Chun-Hung Tseng <henrybear327@gmail.com>
2024-09-14 21:48:11 +02:00
James Blair
981061a495
Merge pull request #18577 from ivanvc/update-release-3.4.34-release-date
CHANGELOG: set release 3.4.34 date
2024-09-12 07:32:08 +10:00
Ivan Valdes
94e5502112
CHANGELOG: set release 3.4.34 date
Signed-off-by: Ivan Valdes <ivan@vald.es>
2024-09-11 13:27:10 -07:00
James Blair
fdbde77a92
Merge pull request #18444 from henrybear327/go/1.23.0
[main] Bump go toolchain to 1.22.7
2024-09-12 04:23:50 +10:00