Skip to content
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

Faulty transition for robustness test #29

Merged
merged 4 commits into from
Nov 16, 2023
Merged

Faulty transition for robustness test #29

merged 4 commits into from
Nov 16, 2023

Conversation

joshuazh-x
Copy link
Owner

This is a network transition fault test in message level. It covers various network faults that raft shall tolerate, including blocked transition, message lost, message duplication, message delay, and message reordering. Some of these faults cannot be easily applied via existing test framework.

@@ -163,6 +164,9 @@ func (ep *EtcdServerProcess) Start(ctx context.Context) error {
return err
}
}
if ep.cfg.FaultyTransitionEnabled {
ep.Failpoints().SetupEnv("faultyNetwork", "return")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This failpoint is specific for message transition, we should consider activate it through http in message_transition.go

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I haven't figured out a good way to enable this failpoint on the fly given that it would require to reconnect peers to make the new encoder effective. So far the easiest way is to set it up in the very beginning.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about keep using SetupEnv() but move it into Inject(). Kill all members, setup env for gofail and then restart members. It will minimize the unnecessary influence on other failpoints.
https://github.com/joshuazh-x/etcd/blob/55516234d324f64a97e1d49b7a8e3dba68de6ffd/tests/robustness/failpoint/gofail.go#L159-L178

return err
}
}
return nil
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Before exit, use latest gofail to get the execution count for this failpoint to check whether it was really executed.
$curl http://127.0.0.1:1234/SomeFuncString/count -XGET

return fe
}

func (fe *faultyEncoder) encode(m *raftpb.Message) error {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In which part of the robustness test will this method be invoked? I only found it in unit tests.

@joshuazh-x joshuazh-x marked this pull request as ready for review November 16, 2023 13:46
@joshuazh-x joshuazh-x merged commit 68ec653 into main Nov 16, 2023
51 of 55 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants