etcd/server
Piotr Tabor 911204cd76 Fix `ETCDCTL_API=2 etcdctl backup --with-v3` consistent index consistency
Prior to this CL, `ETCDCTL_API=2 etcdctl backup --with-v3` was readacting WAL log
(by removal of some entries), but was NOT updating consistent_index in the backend.
Also the WAL editing logic was buggy, as it didn't took in consideration the fact
that when TERM changes, there can be entries with duplicated indexes in
the log. So its NOT sufficient to subtract number of removed entries to
get accurate log indexes.

The PR replaces removing and shifting of WAL entries with replacing them with an no-op entries.
Thanks to this consistent-index references are staying up to date.

The PR also:
  - updates 'verification' logic to check whether consistent_index does not lag befor last snapshot
  - env-gated execution of verification framework in `etcdctl backup`.

Tested with:
```
(./build.sh && cd tests && EXPECT_DEBUG=TRUE 'env' 'go' 'test' '-timeout=300m' 'go.etcd.io/etcd/tests/v3/e2e' -run=TestCtlV2Backup --count=1000 2>&1 | tee TestCtlV2BackupV3.log)
```
2021-04-29 11:51:24 +02:00
..
auth mvcc/backend tests: Refactor: Do not mix testing&prod code. 2021-04-21 09:43:13 +02:00
config Create 'datadir' package responsible for paths. 2021-04-28 07:56:13 +02:00
datadir Create 'datadir' package responsible for paths. 2021-04-28 07:56:13 +02:00
embed Integrate verification framework 2021-04-28 07:56:16 +02:00
etcdmain Address review comments a.d. logging. 2021-04-15 17:54:37 +02:00
etcdserver Fix `ETCDCTL_API=2 etcdctl backup --with-v3` consistent index consistency 2021-04-29 11:51:24 +02:00
lease mvcc/backend tests: Refactor: Do not mix testing&prod code. 2021-04-21 09:43:13 +02:00
mock Migrate dependencies pkg/foo -> client/pkg/foo 2021-04-07 00:38:47 +02:00
mvcc Membership: Add additional methods to trim/manage membership data in backend. 2021-04-27 17:17:31 +02:00
proxy etcdhttp/metrics.go: exclude alarms from health check conditionally with ?exclude=NOSPACE 2021-04-20 13:17:09 -07:00
verify Fix `ETCDCTL_API=2 etcdctl backup --with-v3` consistent index consistency 2021-04-29 11:51:24 +02:00
wal Verification package: Verified given data-dir. 2021-04-28 07:56:15 +02:00
LICENSE server: Update go.mod 2020-10-26 13:02:32 +01:00
go.mod Update go for 3.5: 1.15 -> 1.16.(3). 2021-04-19 16:50:54 +02:00
go.sum Update go for 3.5: 1.15 -> 1.16.(3). 2021-04-19 16:50:54 +02:00
main.go server: Update go.mod 2020-10-26 13:02:32 +01:00
main_test.go server: Update go.mod 2020-10-26 13:02:32 +01:00