-
Notifications
You must be signed in to change notification settings - Fork 16
Drop node simulation in replay #48
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
base: main
Are you sure you want to change the base?
Conversation
02c1cc2 to
63486e9
Compare
ferranbt
left a comment
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!
|








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-runcommand, messages are saved tomessages.flowfile, but other meta data (node names, actions, last sequences) are saved tometaData.flowfile inside the SavedState folder.metaData.flowfile contains data about:Look of
messages.flowfile remains the same.metaData.flowfile, looks as follows:MetaDatastruct is used to store all necessary data tometaData.flowfile. On loading the given file, based onactionTypeproperty, replay knows in which map to store a given action.replay-messagescommand is now changed to receive folder path wheremessages.flowand tometaData.flowfiles are stored, e.g:go run ./e2e/fuzz/cmd/main.go replay-messages -filesDirectory=../SavedDataNOTE: 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
LastSequenceinmetaData.flowfile.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
LastSequenceinmetaData.flowfile.replayNodeExecutionHandlerstarts 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 inRevertNodeaction inmetaData.flowfile.Once all nodes are done with execution,
replayNodeExecutionHandlerwill stop the cluster, and command will exit.