18800 Commits

Author SHA1 Message Date
Benjamin Wang
acfd39f5af
Merge pull request #14785 from clarkfw/functional-options-pattern-EtcdProcessClusterConfig-2-2
tests: refactor EtcdProcessClusterConfig using Functional Options Pattern
2022-11-16 18:29:49 +08:00
Clark
7180267d56 tests: refactor EtcdProcessClusterConfig with Functional Options Pattern
remove `cfg *EtcdProcessClusterConfig` param from `NewEtcdProcessCluster` function

Signed-off-by: Clark <fwyongxing@gmail.com>
2022-11-16 15:05:29 +08:00
Clark
9406de0033 tests: refactor EtcdProcessClusterConfig with Functional Options Pattern
replace all initialisations with `DefaultConfig`, `NewConfig` and `EPClusterOption`

Signed-off-by: Clark <fwyongxing@gmail.com>
2022-11-16 15:05:28 +08:00
Benjamin Wang
8438ddae3e
Merge pull request #14767 from sashamelentyev/print
all: Change Printf and friends to Print if there is no formatting
2022-11-16 10:38:20 +08:00
Benjamin Wang
bf5c936ff1
Merge pull request #14731 from ramil600/grpc_withinsecure
client/v3: replace deprecated grpc.WithInsecure()  issue #14732
2022-11-16 06:41:29 +08:00
Benjamin Wang
47e71d925a
Merge pull request #14765 from serathius/linearizability-compact
Linearizability compact
2022-11-16 06:23:14 +08:00
Sasha Melentyev
2c9c209eb6 all: Changing Printf and friends to Print if there is no formatting
Signed-off-by: Sasha Melentyev <sasha@melentyev.io>
2022-11-15 22:11:23 +03:00
Marek Siarkowicz
8ae4420c4c tests: Add compact failpoints
Signed-off-by: Marek Siarkowicz <siarkowicz@google.com>
2022-11-15 15:00:18 +01:00
Marek Siarkowicz
f96957adba tests: Add compact failpoints
Signed-off-by: Marek Siarkowicz <siarkowicz@google.com>
2022-11-15 14:59:03 +01:00
Marek Siarkowicz
a6997644c3
Merge pull request #14761 from tjungblu/main
Update CodeQL to v2
2022-11-15 13:58:47 +01:00
Thomas Jungblut
89bfa4b95c Update CodeQL to v2
CodeQL@v1 is going to be deprecated in three weeks. This PR updates the
branches to track only the currently maintained release branches and
moves the actions to its v2 version.

Signed-off-by: Thomas Jungblut <tjungblu@redhat.com>
2022-11-15 13:30:44 +01:00
Benjamin Wang
39ca876f38
Merge pull request #14757 from ahrtr/add_failpoint_20221115
etcdserver: add failpoints for backend
2022-11-15 17:14:14 +08:00
Benjamin Wang
cf190fb5b0 test: apply backend failpoints into the linearizablity test
Signed-off-by: Benjamin Wang <wachao@vmware.com>
2022-11-15 16:36:56 +08:00
Marek Siarkowicz
f8162919f9
Merge pull request #14744 from clarkfw/functional-options-pattern-EtcdProcessClusterConfig-2-1
tests: refactor `EtcdProcessClusterConfig` using Functional Options Pattern
2022-11-15 09:27:24 +01:00
Benjamin Wang
f49d96f8b7
Merge pull request #14756 from sashamelentyev/time
all: Change time unit
2022-11-15 15:54:30 +08:00
Benjamin Wang
015196ec10
Merge pull request #14754 from sashamelentyev/clientfmt
client: Use func without format
2022-11-15 15:25:22 +08:00
Benjamin Wang
386e08f5fa
Merge pull request #14747 from falser101/fix/log_test
feat: raft/log_test se testify packages in tests
2022-11-15 11:10:08 +08:00
jianfei.zhang
cadf9de3f8 feat: raft/log_test se testify packages in tests
Signed-off-by: jianfei.zhang <jianfei.zhang@daocloud.io>
2022-11-15 10:35:30 +08:00
Benjamin Wang
d62e018495
Merge pull request #14755 from serathius/linearizability-traffic
tests: Make linearizability traffic extendable
2022-11-15 09:11:40 +08:00
Benjamin Wang
4f824336ad etcdserver: add two failpoints for backend
1. before and after create boltDB transaction;
2. before and after writebuf back to read buffer;

Signed-off-by: Benjamin Wang <wachao@vmware.com>
2022-11-15 08:09:05 +08:00
Benjamin Wang
970ecfcddb
Merge pull request #14721 from nvanbenschoten/nvanbenschoten/noCommittedOnSnap
raft: don't apply entries when applying snapshot
2022-11-15 06:41:12 +08:00
Tobias Grieger
edd4d5122f
Merge pull request #14723 from nvanbenschoten/nvanbenschoten/localMsgCleanup 2022-11-14 23:34:39 +01:00
Sasha Melentyev
006e747a44 all: Change time unit
Signed-off-by: Sasha Melentyev <sasha@melentyev.io>
2022-11-15 01:15:01 +03:00
Marek Siarkowicz
2fc1485f29 tests: Make linearizability traffic extendable
Signed-off-by: Marek Siarkowicz <siarkowicz@google.com>
2022-11-14 23:14:10 +01:00
Sasha Melentyev
95c520976a client: Use func without format
Signed-off-by: Sasha Melentyev <sasha@melentyev.io>
2022-11-15 01:02:24 +03:00
Benjamin Wang
efa144a66a
Merge pull request #14753 from sashamelentyev/replaceall
all: Use ReplaceAll instead of Replace with -1 pos
2022-11-15 05:43:10 +08:00
Sasha Melentyev
855aa4f7a7 all: Use ReplaceAll instead of Replace with -1 pos
Signed-off-by: Sasha Melentyev <sasha@melentyev.io>
2022-11-15 00:06:09 +03:00
Marek Siarkowicz
ca8baeb308
Merge pull request #14685 from serathius/linearizability-revision
Revision inconsistency caused by panic during defrag
2022-11-14 12:49:22 +01:00
Marek Siarkowicz
77cd6a660f
Merge pull request #14742 from fuweid/deflake-issue-14694
tests/e2e: disable testShellCompletion if enable cov flag
2022-11-14 12:41:40 +01:00
Marek Siarkowicz
4cdcb91fac
Merge pull request #14672 from tjungblu/etcd-14638
Expect exit code enhancement
2022-11-14 12:34:43 +01:00
Marek Siarkowicz
ff6c93f630 tests: Add revision to etcd linearizability model
Signed-off-by: Marek Siarkowicz <siarkowicz@google.com>
2022-11-14 12:20:55 +01:00
Tobias Grieger
e64d644989
Merge pull request #14624 from pavelkalinnikov/limit_inflight_bytes 2022-11-14 12:10:13 +01:00
Benjamin Wang
ae7e7241b3
Merge pull request #14734 from ahrtr/changelog_rev_inconsistency
changelog: add item for 3.5 to cover the revision inconsistency issue
2022-11-14 18:28:51 +08:00
Thomas Jungblut
5b163aa507 Expect exit code enhancement
ExpectProcess and ExpectFunc now take the exit code of the process into
account, not just the matching of the tty output.

This also refactors the many tests that were previously succeeding on
matching an output from a failing cmd execution.

Signed-off-by: Thomas Jungblut <tjungblu@redhat.com>
2022-11-14 11:19:41 +01:00
Wei Fu
c2f27a0070 tests/e2e: disable testShellCompletion if enable cov flag
The etcdctl and etcdutl built with `-tags cov` mode will show go-test result
after each execution, like

```
...

PASS
coverage: 0.0% of statements in ./...
```

Since the PASS is not real command, the `source completion` command will
fail with command-not-found error. And there is no easy way to disable
the (*testing.M).Run's output. Therefore, this patch uses build tag !cov
to disable cases when enable coverage.

Fixes: #14694

Signed-off-by: Wei Fu <fuweid89@gmail.com>
2022-11-14 17:58:18 +08:00
Benjamin Wang
3232c04138
Merge pull request #14746 from ahrtr/add_gofailpoint_OnPreCommitUnsafe
etcdserver: Add gofailpoints for pre commit hook
2022-11-14 17:54:04 +08:00
Benjamin Wang
d3c64ed94f
Merge pull request #14743 from fuweid/test-downgrade-with-latest-point-release
e2e: test DowngradeVersion with latest point release
2022-11-14 15:23:50 +08:00
Benjamin Wang
2532ca84d1 test: add failpoints into linearizablity test for commitBeforePreCommitHook and commitAfterPreCommitHook
Signed-off-by: Benjamin Wang <wachao@vmware.com>
2022-11-14 11:11:48 +08:00
Benjamin Wang
3f18816e7d etcdserver: add gofail points before and after OnPreCommitUnsafe
Signed-off-by: Benjamin Wang <wachao@vmware.com>
2022-11-14 11:02:18 +08:00
Benjamin Wang
3cf2e79e16
Merge pull request #14537 from ahrtr/add_hash_rev
Add a new field hash_revision into HashKVResponse
2022-11-14 09:20:44 +08:00
Benjamin Wang
f77b8a735f etcdserver: populate HashRevision when responding to leader or client's HashKV request
Signed-off-by: Benjamin Wang <wachao@vmware.com>
2022-11-14 08:33:44 +08:00
Benjamin Wang
228f493c76 rpc.proto: regenerate rpc.proto related files
Run
1. ./script/genproto.sh
2. ./scripts/update_proto_annotations.sh

Signed-off-by: Benjamin Wang <wachao@vmware.com>
2022-11-14 08:33:44 +08:00
Benjamin Wang
cd746de14e rpc.proto: added a new field hash_revision into HashKVResponse
Signed-off-by: Benjamin Wang <wachao@vmware.com>
2022-11-14 08:33:44 +08:00
Tobias Grieger
4c8244622e
Merge pull request #14717 from falser101/fix/testify 2022-11-13 23:08:30 +01:00
Pavel Kalinnikov
0ef5df11a6 raft: update changelog
Signed-off-by: Pavel Kalinnikov <pavel@cockroachlabs.com>
2022-11-13 23:05:16 +01:00
Pavel Kalinnikov
68af01ca6e raft: add MaxInflightBytes to Config
This commit introduces the max inflight bytes setting at the Config level, and
tests that raft flow control honours it.

Signed-off-by: Pavel Kalinnikov <pavel@cockroachlabs.com>
2022-11-13 23:05:16 +01:00
Pavel Kalinnikov
8c9c557d85 raft: factor out payloadsSize helper
Signed-off-by: Pavel Kalinnikov <pavel@cockroachlabs.com>
2022-11-13 23:05:16 +01:00
Pavel Kalinnikov
7bda0d7773 raft/tracker: add MaxInflightBytes to ProgressTracker
This commit plumbs the max total byte size of the Inflights type higher up the
stack to the ProgressTracker.

Signed-off-by: Pavel Kalinnikov <pavel@cockroachlabs.com>
2022-11-13 23:05:16 +01:00
Pavel Kalinnikov
bfb7b16f4f raft/tracker: add byte size limit to Inflights type
The Inflights type has limits on the message size and the number of inflight
messages. However, a single large entry that exceeds the size limit can still
be sent. In combination with the max messages count limit, many large messages
can be sent in a row and overflow the receiver. In effect, the "max" values act
as "target" rather than hard limits.

This commit adds an additional soft limit on the total size of inflight
messages, which catches such situations and prevents the receiver overflow.

Signed-off-by: Pavel Kalinnikov <pavel@cockroachlabs.com>
2022-11-13 23:05:16 +01:00
Tobias Grieger
de97f6aa3d raft: tidy up the unit tests some more
Use `t.Run` for each test case, and make some tests more idiomatic.

Signed-off-by: Tobias Grieger <tobias.b.grieger@gmail.com>
2022-11-13 22:34:47 +01:00