17058 Commits

Author SHA1 Message Date
Pavan BG
facba6c663 client: Replace nil value testing with assert.Nil
Multiple errors in previous commit where `nil` is not being detected by `assert.Equal`
2021-05-21 14:18:01 +05:30
Pavan BG
25d3c1b068 *: Fixed go.sum
Ran fix.sh script to correct for differences in go.sum, perhaps due to multiple Golang versions
2021-05-21 13:28:43 +05:30
Pavan BG
ce5bb69c28 client: Added missing packages
go.etcd.io/etcd/client/pkg/v3/testutil: package github.com/stretchr/testify/assert imported from implicitly required module; to add missing requirements, run:
2021-05-20 21:44:12 +05:30
Pavan BG
319ef4aa42 client: Removed AssertEqual function
Used github.com/stretchr/testify/assert to replace the AssertEqual function definition. Required the use of copyToInterface to copy a string slice to the empty interface slice
2021-05-20 21:33:07 +05:30
Pavan BG
d9c5e1f0a2 *: Replace internal testutil AssertEqual function in favour of github.com/stretchr/testify/assert.Equals
To maintain uniformity in testing methodology, assert.Equals has been used everywhere while replacing testutil.AssertEqual

Fixes #13015
2021-05-20 19:55:45 +05:30
Piotr Tabor
b29e8e47a6
Merge pull request #13014 from lilic/functional-socket-reuse
tests/functional: Set socket-reuse-port and socket-reuse-address
2021-05-20 15:00:43 +02:00
Piotr Tabor
e299264cf3
Merge pull request #13011 from lilic/socket-options-file
WIP: client,server: Expose reuse-port and reuse-address so they can be configured via a config file
2021-05-20 13:50:21 +02:00
Lili Cosic
0ee2aba910 .github/workflows/functional.yaml: Adjust to use new script 2021-05-20 13:41:41 +02:00
Lili Cosic
b23ab1f759 tests/functional: Require same version of protoc everwhere
The main genproto.sh script requires latest version, this confirms the
test protoc to do the same.
2021-05-20 13:41:41 +02:00
Lili Cosic
fe2a9bd7e9 Update go.mod and go.sum files after running scripts 2021-05-20 13:41:41 +02:00
Lili Cosic
cb8c0a0507 tests/functional/rpcpb/rpc.pb.go: Regenerate
run ./scripts/genproto.sh
2021-05-20 13:41:41 +02:00
Lili Cosic
13bf7b0766 tests/functional: Set socket-reuse-port and socket-reuse-address
Due to flakes in CI and locally which resulted due to shared servers
there is suspcion that fixed port numbers are to blame. This reuses port
and address.
2021-05-20 13:41:41 +02:00
Piotr Tabor
41227b7a2b
Merge pull request #13012 from gliptak/patch-2
Correct typo
2021-05-20 12:38:38 +02:00
Lili Cosic
e0e4ddc268 test.sh: Reference test.sh instead of deprecated test 2021-05-20 10:00:27 +02:00
Lili Cosic
7957f4461d server/embed/config_test.go: Add unit test for socket options 2021-05-20 10:00:27 +02:00
Patrice Chalin
96a1efded0
Documentation/README simplification (#13007)
In support of https://github.com/etcd-io/website/issues/65, simply direct the reader to the website (rather than once again defining what etcd it).
2021-05-19 17:51:51 -07:00
Gábor Lipták
204e87cfb8
Correct typo
Signed-off-by: Gábor Lipták gliptak@gmail.com
2021-05-19 17:53:00 -04:00
Lili Cosic
73c530de83 client,server: Expose reuse-port and reuse-address so they can be
configured via a config file.
2021-05-19 18:41:21 +02:00
Hitoshi Mitake
5f60e0d799
Merge pull request #12979 from horizonzy/enhance-role-output
Enhance getRole output when the role is 'root'.
2021-05-19 23:39:51 +09:00
horizonzy
6ab56fc237 enhance GetRole output when role is 'root' and the response perm is nil.
Before output:
Role root
KV Read:
KV Write:

After output:
Role root
KV Read:
	[, <open ended>
KV Write:
	[, <open ended>
2021-05-19 17:35:13 +08:00
Piotr Tabor
159d1916fe
Merge pull request #12985 from ptabor/20210517-fix-not-a-learner-retries
Fix not retryable error codes from: Unavailable -> FailedPrecondition
2021-05-19 08:05:22 +02:00
Piotr Tabor
788bc5359d
Merge pull request #13000 from ptabor/20210519-shouldApplyV3
applyV2 should apply on backend only once
2021-05-19 02:09:36 +02:00
Piotr Tabor
16d51d8c26 Fix not retryable error codes from: Unavailable -> FailedPrecondition
- ErrGRPCNotCapable("etcdserver: not capable") -> codes.FailedPrecondition  (it will not autofix, it requires new version of server)
 - ErrGPRCNotSupportedForLearner("etcdserver: rpc not supported for learner") -> codes.FailedPrecondition (as long as its learner, the call will not work)
 - ErrGRPCClusterVersionUnavailable("etcdserver: cluster version not found during downgrade") -> codes.FailedPrecondition (backend does not contain the version (old etcd?) so retry will not help)

https://github.com/etcd-io/etcd/runs/2599598633?check_suite_focus=true

```
{"level":"warn","ts":"2021-05-17T09:55:30.246Z","logger":"etcd-client","caller":"v3/retry_interceptor.go:62","msg":"retrying of unary invoker failed","target":"etcd-endpoints://0xc000539880/#initially=[unix://localhost:m30]","attempt":0,"error":"rpc error: code = Unavailable desc = etcdserver: rpc not supported for learner"}
{"level":"warn","ts":"2021-05-17T09:55:30.270Z","logger":"etcd-client","caller":"v3/retry_interceptor.go:62","msg":"retrying
of unary invoker
failed","target":"etcd-endpoints://0xc000539880/#initially=[unix://localhost:m30]","attempt":1,"error":"rpc
error: code = Unavailable desc = etcdserver: rpc not supported for
learner"}`
```
2021-05-19 02:08:53 +02:00
Piotr Tabor
0a972a3f05 applyV2 should reapply on backend only once
During review of:  https://github.com/etcd-io/etcd/pull/12988 spotted
that PUT is actially writing to v3-backend.
If we are replaying WAL log, it might happened that backend's
applied_index is > than the WAL's log entry. In such situation we should
skip applying on backend V3.
I think both the methods (setVersion, setMembersAttributes) are in
practice idempotent so its not that 'serious' problem, but for
formal correctness adding the proper checks.
2021-05-18 20:55:05 +02:00
Piotr Tabor
46b49a6ecf
Merge pull request #12991 from ptabor/20210519-mlmhl-buffer-seq
Represent bucket as object instead of []byte name.
2021-05-18 19:32:01 +02:00
Piotr Tabor
66752fef2f Represent bucket as object instead of []byte name.
Thanks to this change:
  - all the maps bucket -> buffer are indexed by int's instead of
string. No need to do: byte[] -> string -> hash conversion on each
access.
  - buckets are strongly typed in backend/mvcc API.
2021-05-18 18:58:53 +02:00
Sam Batschelet
80ccb27ea5
Merge pull request #12997 from hexfusion/fix-etcdutl-build
scripts: add missing etcdutl to release pipeline
2021-05-18 07:36:22 -04:00
Piotr Tabor
fe829fa461
Merge pull request #12995 from ptabor/20210519-simplify-loggers
Simplify client's logger configuration in tests.
2021-05-18 13:22:47 +02:00
Sam Batschelet
86393ecfcd scripts: add missing etcdutl to release pipeline
Signed-off-by: Sam Batschelet <sbatsche@redhat.com>
2021-05-18 07:16:28 -04:00
Piotr Tabor
3dd577ec08 Simplify client's logger configuration in tests. 2021-05-18 13:03:16 +02:00
Piotr Tabor
62b731909f
Merge pull request #12587 from mlmhl/buffer-search
backend: fix buffer range bug
2021-05-18 10:54:30 +02:00
Gyuho Lee
6d451ab61d
Merge pull request #12989 from gyuho/workflow
github/workflow: run arm64 tests for all branches startin from 3.5
2021-05-17 14:58:22 -07:00
Gyuho Lee
41b325a711 github/workflow: run arm64 tests for all branches startin from 3.5
Signed-off-by: Gyuho Lee <leegyuho@amazon.com>
2021-05-17 13:46:30 -07:00
Gyuho Lee
1af7cb22f2
Merge pull request #12988 from chaochn47/updateClusterVersionV2
use v2 api to update cluster version
2021-05-17 13:43:36 -07:00
Chao Chen
8e9b77a2c7 Update CHANGELOG-3.5.md 2021-05-17 11:46:14 -07:00
Chao Chen
783c5ad2d2 use v2 api to update cluster version 2021-05-17 11:45:54 -07:00
Piotr Tabor
e73facb7e2
Merge pull request #12986 from ptabor/20210519-mlmhl-buffer-seq
Reset 'seq' flags between transactions and track per 'bucket'
2021-05-17 20:31:00 +02:00
Piotr Tabor
eebe67d87d Rename seq to bucket2seq. 2021-05-17 17:29:44 +02:00
Piotr Tabor
4a2ffc2cbe Minor formatting fix on top of https://github.com/etcd-io/etcd/pull/12568 2021-05-17 17:08:00 +02:00
mlmhl
79eafb9719 backend: set seq flag for each bucket buffer 2021-05-17 17:08:00 +02:00
Piotr Tabor
932d42b027
Merge pull request #12971 from ptabor/20210514-split-etcdctl
Split etcdctl into etcdctl (public API access) & etcdutl (direct surgery on files)
2021-05-17 14:07:20 +02:00
Piotr Tabor
3f7a038656 Fixed documentation and scripts. 2021-05-17 11:54:03 +02:00
Piotr Tabor
949c1c224b Updated changelog. 2021-05-17 11:54:03 +02:00
Piotr Tabor
d99d0df5a5 Adding etcdutl test coverage. 2021-05-17 11:54:03 +02:00
Piotr Tabor
b6a8ae8372 add etcdutl version. make it cov-tests compatible. 2021-05-17 11:54:03 +02:00
Piotr Tabor
c09aca1ba4 Split etcdctl into etcdctl (public API access) & etcdutl (direct surgery on files)
Motivation is as follows:

  - etcdctl we only depend on clientv3 APIs, no dependencies of bolt, backend, mvcc, file-layout
  - etcdctl can be officially supported across wide range of versions, while etcdutl is pretty specific to file format at particular version.
it's step towards desired modules layout, documented in: https://etcd.io/docs/next/dev-internal/modules/
2021-05-17 11:54:03 +02:00
Piotr Tabor
1675101293
Merge pull request #12981 from ptabor/20210516-fix-release-script
Fix release script: add `go mod tidy` after go.mod changes
2021-05-17 11:35:21 +02:00
Piotr Tabor
2712c787ab Fix release script: add go mod tidy
Seems that additinal refresh of go.sum files is needed during the
release process after editing the versions of modules.

Discovered the problem while I was testing whether etcdutl is
properly included in the target binaries using:

```
DRY_RUN=true REPOSITORY=\`pwd\` BRANCH='branch-with-etcdutl' ./scripts/release 3.5.0-foobar.2
```
2021-05-16 20:43:12 +02:00
Piotr Tabor
f82b5cb776
Bring back original NewZapCoreLoggerBuilder api. (#12973)
The funcion signature has been changed in:
eafbc8c57efc716644c328f63677ca7eadeebdfe .
Instead we should have added new method `NewZapLoggerBuilder()`.
2021-05-16 10:26:10 -07:00
Piotr Tabor
9501e8e874
Merge pull request #12980 from aaronjheng/typo
Fix typo in CHANGELOG
2021-05-16 16:18:46 +02:00