-
Notifications
You must be signed in to change notification settings - Fork 14
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
Drop node simulation in replay #48
base: main
Are you sure you want to change the base?
Conversation
02c1cc2
to
63486e9
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.
A lot of changes are required to support node drop. Do you guys have any insights on whether we can optimize any part?
To answer your question, about optimizing. 80% of these changes are mostly just reorganizing code to different files and structures since it was all clustered up in the ReplayMessageNotifier, so we tried to separate logic for reading, writing and node execution to different files. |
Kudos, SonarCloud Quality Gate passed! 0 Bugs No Coverage information |
Replay messages feature now saves actions that occurred in fuzz run to a separate .flow file so that they can be simulated on replay as well. For now, only Drop Node actions are saved to .flow file and simulated in replay.
When running
fuzz-run
command, messages are saved tomessages.flow
file, but other meta data (node names, actions, last sequences) are saved tometaData.flow
file inside the SavedState folder.metaData.flow
file contains data about:Look of
messages.flow
file remains the same.metaData.flow
file, looks as follows:MetaData
struct is used to store all necessary data tometaData.flow
file. On loading the given file, based onactionType
property, replay knows in which map to store a given action.replay-messages
command is now changed to receive folder path wheremessages.flow
and tometaData.flow
files are stored, e.g:go run ./e2e/fuzz/cmd/main.go replay-messages -filesDirectory=../SavedData
NOTE: both files are needed for replay to execute.
Simulating node actions and stopping nodes when they are done with execution is now handled in
replay_node_execution.go
.Once replay is started, when node reads its next message from queue, it can now recognize if it needs to shut down properly or if it needs to simulate a drop.
We know that a node needs to be stopped when it has nothing to read from the queue and it reached the sequence and round that is defined in its
LastSequence
inmetaData.flow
file.We know that a node needs to be dropped if it has nothing to read from the queue for given sequence and round, but given sequence and round are not the same as the one defined in its
LastSequence
inmetaData.flow
file.replayNodeExecutionHandler
starts a go routine before starting the cluster that listens if a node needs to be dropped, or if its done with execution, or if it needs to be restarted when a sequence is reached in cluster that corresponds to sequence in which node drop was reverted as defined inRevertNode
action inmetaData.flow
file.Once all nodes are done with execution,
replayNodeExecutionHandler
will stop the cluster, and command will exit.