-
Notifications
You must be signed in to change notification settings - Fork 9.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
20210429 etcdctl v2 backup cindex fix #12906
20210429 etcdctl v2 backup cindex fix #12906
Conversation
79ffd9f
to
7fae99c
Compare
|
||
consistentIndexKeyName = []byte("consistent_index") | ||
ConsistentIndexKeyName = []byte("consistent_index") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's the use case for making this public? If we need, can we document this saying this belongs to meta bucket?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm trying to get rid of duplicated independent constants. In particular this one is used in: server/mvcc/kvstore.go for list of ignored keys when 'hash' is being computed, so no easy way to merge it into cindex package.
Parted port of my PR to this one, to make it consistent: 9fb0aa3
Codecov Report
@@ Coverage Diff @@
## master #12906 +/- ##
==========================================
+ Coverage 66.48% 71.19% +4.71%
==========================================
Files 426 430 +4
Lines 33965 34082 +117
==========================================
+ Hits 22581 24266 +1685
+ Misses 9316 7834 -1482
+ Partials 2068 1982 -86
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
…ency 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) ```
In case of failed verification, the server used to keep opened backend (so the file was locked on OS level).
9fb0aa3
to
e90504f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm thx!
Fix
ETCDCTL_API=2 etcdctl backup --with-v3
consistent index consistencyPrior 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:
etcdctl backup
.Tested with: