-
Notifications
You must be signed in to change notification settings - Fork 9.9k
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
migrate experimental-snapshot-catchup-entries flag to snapshot-catchup-entries #19352
migrate experimental-snapshot-catchup-entries flag to snapshot-catchup-entries #19352
Conversation
Hi @ajaysundark. Thanks for your PR. I'm waiting for a etcd-io member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files
... and 22 files with indirect coverage changes @@ Coverage Diff @@
## main #19352 +/- ##
==========================================
- Coverage 68.93% 68.90% -0.04%
==========================================
Files 420 420
Lines 35756 35759 +3
==========================================
- Hits 24649 24638 -11
- Misses 9685 9700 +15
+ Partials 1422 1421 -1 Continue to review full report in Codecov by Sentry.
|
/ok-to-test |
Need to change in tests/framework/e2e/cluster.go func WithSnapshotCatchUpEntries(count uint64) EPClusterOption {
-- return func(c *EtcdProcessClusterConfig) { c.ServerConfig.SnapshotCatchUpEntries = count }
++ return func(c *EtcdProcessClusterConfig) { c.ServerConfig.ExperimentalSnapshotCatchUpEntries = count }
} to keep using the We do not want to use the non-experimental flag yet in those tests because of |
da2d4d8
to
4605e40
Compare
d39df53
to
09c560c
Compare
d11c45d
to
30f96c0
Compare
/retest |
This is blocked by #19354 as we have test framework dependency on the For example:
|
/retest |
/test pull-etcd-e2e-amd64 |
1 similar comment
/test pull-etcd-e2e-amd64 |
tests/framework/e2e/cluster.go
Outdated
@@ -229,7 +229,7 @@ func WithSnapshotCount(count uint64) EPClusterOption { | |||
} | |||
|
|||
func WithSnapshotCatchUpEntries(count uint64) EPClusterOption { | |||
return func(c *EtcdProcessClusterConfig) { c.ServerConfig.SnapshotCatchUpEntries = count } | |||
return func(c *EtcdProcessClusterConfig) { c.ServerConfig.ExperimentalSnapshotCatchUpEntries = count } |
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.
The e2e test failure of TestRecoverSnapshotBackend
is caused by this change. You need to update the line below to use the ExperimentalSnapshotCatchUpEntries
etcd/tests/robustness/failpoint/network.go
Line 147 in 3db3468
return config.ServerConfig.SnapshotCount + config.ServerConfig.SnapshotCatchUpEntries |
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.
Or it might be even better to set both SnapshotCatchUpEntries
and ExperimentalSnapshotCatchUpEntries
in this function WithSnapshotCatchUpEntries
; then no need to update the line below,
etcd/tests/robustness/failpoint/network.go
Line 147 in 3db3468
return config.ServerConfig.SnapshotCount + config.ServerConfig.SnapshotCatchUpEntries |
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.
Thanks for your review, @ahrtr. I considered setting both the flags at test framework, but we explicitly disallow doing so (we validate for both flags being set), as that could allow misconfigurations in real world use-cases.
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 am aware of that setting both flags are disallowed, but what we are talking about here is just test code.
Also note that the robustness test cases test both main and release branches, while ExperimentalSnapshotCatchUpEntries
doesn't exist in stable release branches, so setting both fields here might be best choice.
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.
Or we can revert this change, and keep using c.ServerConfig.SnapshotCatchUpEntries = count
in WithSnapshotCatchUpEntries
.
Note this is a special case, the field ExperimentalSnapshotCatchUpEntries
is a new field being added in this PR. While SnapshotCatchUpEntries
is the existing field.
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.
Sorry for the delay in response. The issue is that if we set both SnapshotCatchupEntries
and ExperimentalSnapshotCatchupEntries
at function WithSnapshotCatchupEntries
:
the tests fail with both the flags are set.
{"level":"warn","ts":"2025-02-11T18:35:13.533795Z","caller":"etcdmain/etcd.go:66","msg":"failed to verify flags","error":"cannot set --experimental-snapshot-catchup-entries and --snapshot-catchup-entries at the same time, please use --snapshot-catchup-entries only"}
Another possible option I tried is setting one of the two flags based on the version (if version < 3.6), say at InitEtcdProcessCluster
here:
etcd/tests/framework/e2e/cluster.go
Line 437 in 3db3468
func InitEtcdProcessCluster(t testing.TB, cfg *EtcdProcessClusterConfig) (*EtcdProcessCluster, error) { |
like:
if cfg.Version != CurrentVersion && UsesExperimentalSnapshotCatchupEntriesFlag(BinPath.EtcdLastRelease) {
cfg.ServerConfig.ExperimentalSnapshotCatchUpEntries = cfg.ServerConfig.SnapshotCatchUpEntries
cfg.ServerConfig.SnapshotCatchUpEntries = etcdserver.DefaultSnapshotCatchUpEntries
}
but for some reason it's failing TestMixVersionsSnapshotByMockingPartition
: timing out the waiting for Verify logs to check leader has saved snapshot
. Any thoughts? cc @ahrtr / @siyuanfoundation
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.
increasing the timeout to more than 30s helped with the test run:
PASSES="e2e" TIMEOUT=5m TESTCASE=TestMixVersionsSnapshotByMockingPartition ./scripts/test.sh
Note that I will cut branch |
This might not be correct. We can still merge this to main, then backport to 3.6. Eventually we will cleanup all experimental flags in main. |
@ajaysundark are you still working on this PR? It's almost ready to be merged with just a couple of comments. If you don't have time, let us know. I am targeting to get it done by tomorrow. |
eb85033
to
189127a
Compare
…p-entries Signed-off-by: Ajay Sundar Karuppasamy <ajaysundar@google.com>
189127a
to
5802231
Compare
/retest-required |
if err != nil { | ||
return false | ||
} | ||
v3_6 := semver.Version{Major: 3, Minor: 6} |
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.
let's reuse
Line 44 in f197f44
V3_6 = semver.Version{Major: 3, Minor: 6} |
if cfg.Version != CurrentVersion && UsesExperimentalSnapshotCatchupEntriesFlag(BinPath.EtcdLastRelease) { | ||
cfg.ServerConfig.ExperimentalSnapshotCatchUpEntries = cfg.ServerConfig.SnapshotCatchUpEntries | ||
cfg.ServerConfig.SnapshotCatchUpEntries = etcdserver.DefaultSnapshotCatchUpEntries | ||
} |
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.
This might not be correct. Let me do a minor refactorig.
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.
Refer to #19388
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.
Or please feel free to cherry pick my PR into this PR. @ajaysundark
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.
Thanks for your review and follow-up changes. I'll take a look at #19388 to get more context.
Also, looks like the cherry-pick is not necessary as we handled merging this PR and following up with required changes in yours. Please clarify if my understanding is correct.
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.
let's just merge this PR. I will do a quick followup PR to resolve the comments.
OK. The alternative is to carry this commit in your pull request and close this one.
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: ajaysundark, fuweid, siyuanfoundation The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Not every people is comfortable with this approach :( |
/cherry-pick release-3.6 |
@ahrtr: new pull request created: #19389 In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
Also resolved the review comment in etcd-io#19352 Signed-off-by: Benjamin Wang <benjamin.ahrtr@gmail.com>
Also resolved the review comment in etcd-io#19352 Signed-off-by: Benjamin Wang <benjamin.ahrtr@gmail.com>
Also resolved the review comment in etcd-io#19352 Signed-off-by: Benjamin Wang <benjamin.ahrtr@gmail.com>
Migrate
experimental-snapshot-catchup-entries
flag tosnapshot-catchup-entries
Sub task from #19141
Note:
experimental-snapshot-catch-up-entries
when cmd-line flagexperimental-snapshot-catchup-entries
was used.experimental-snapshot-catch-up-entries
will set flagexperimental-snapshot-catchup-entries
correctly atFlagsExplicitlySet
. This is required to mark / identify the field if used from 'config-file' as a deprecated flag usage.experimental-snapshot-catch-up-entries
YAML field usage is maintained the same field-name for backward compability.