-
Notifications
You must be signed in to change notification settings - Fork 55
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
Put query updates on a diet #86
Conversation
Signed-off-by: Geoffrey Biggs <gbiggs@killbots.net>
Signed-off-by: Geoffrey Biggs <gbiggs@killbots.net>
Signed-off-by: Geoffrey Biggs <gbiggs@killbots.net>
Signed-off-by: Geoffrey Biggs <gbiggs@killbots.net>
Signed-off-by: Geoffrey Biggs <gbiggs@killbots.net>
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 haven't reviewed everything yet, but I've looked over the MirrorManager
class pretty closely and left some feedback. This design and implementation is looking fantastic; I just have some recommendations, most of which are nitpicks, but some may be actual soundness concerns.
rmf_traffic_ros2/src/rmf_traffic_ros2/schedule/MirrorManager.cpp
Outdated
Show resolved
Hide resolved
rmf_traffic_ros2/src/rmf_traffic_ros2/schedule/MirrorManager.cpp
Outdated
Show resolved
Hide resolved
rmf_traffic_ros2/src/rmf_traffic_ros2/schedule/MirrorManager.cpp
Outdated
Show resolved
Hide resolved
rmf_traffic_ros2/src/rmf_traffic_ros2/schedule/MirrorManager.cpp
Outdated
Show resolved
Hide resolved
}); | ||
update_timer = node.create_wall_timer( | ||
5s, | ||
[&]() -> void |
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 is relevant to #71
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.
That just shows how easy a mistake it is to make...
rmf_traffic_ros2/src/rmf_traffic_ros2/schedule/MirrorManager.cpp
Outdated
Show resolved
Hide resolved
rmf_traffic_ros2/src/rmf_traffic_ros2/schedule/MirrorManager.cpp
Outdated
Show resolved
Hide resolved
rmf_traffic_ros2/src/rmf_traffic_ros2/schedule/MirrorManager.cpp
Outdated
Show resolved
Hide resolved
rmf_traffic_ros2/test/mock_monitor_nodes/missing_query_monitor.cpp
Outdated
Show resolved
Hide resolved
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've finished reviewing the rest of the files! Just adding a few more comments. I'll start doing some manual tests of the fail over now.
rmf_traffic_ros2/test/mock_monitor_nodes/delayed_query_broadcast_monitor.cpp
Show resolved
Hide resolved
rmf_traffic_ros2/test/mock_monitor_nodes/missing_query_monitor.cpp
Outdated
Show resolved
Hide resolved
Signed-off-by: Michael X. Grey <grey@openrobotics.org>
Signed-off-by: Michael X. Grey <grey@openrobotics.org>
Signed-off-by: Michael X. Grey <grey@openrobotics.org>
Signed-off-by: Geoffrey Biggs <gbiggs@killbots.net>
Signed-off-by: Geoffrey Biggs <gbiggs@killbots.net>
Signed-off-by: Geoffrey Biggs <gbiggs@killbots.net>
Signed-off-by: Geoffrey Biggs <gbiggs@killbots.net>
Signed-off-by: Geoffrey Biggs <gbiggs@killbots.net>
…updates-on-a-diet Signed-off-by: Geoffrey Biggs <gbiggs@killbots.net>
…updates-on-a-diet
Signed-off-by: Geoffrey Biggs <gbiggs@killbots.net>
Signed-off-by: Michael X. Grey <grey@openrobotics.org>
Signed-off-by: Geoffrey Biggs <gbiggs@killbots.net> Signed-off-by: Michael X. Grey <grey@openrobotics.org> Co-authored-by: Michael X. Grey <grey@openrobotics.org> Signed-off-by: Arjo Chakravarty <arjo@openrobotics.org>
Closes open-rmf/rmf#75.
New feature implementation
Implemented feature
Remove the query and query ID from the
MirrorUpdate
message.Implementation description
The query ID was previously used to know if a query update should be ignored or applied to the mirror's internal copy of the database. This is no longer necessary because query updates are separated by topic, so a mirror will only receive the updates for its registered query. Thus the query ID is removed from the
MirrorUpdate
message along with checks on it in theMirrorManager
class.The query was added to the query update message as part of the initial redundancy work to allow a
MirrorManager
to verify that it is receiving updates for the correct query (it hasn't subscribed to the wrong topic, or the schedule node hasn't got its queries mixed up, etc.). This is inefficient, as the query may be large and query updates are frequent. Therefore the query is removed from the query update message. To retain the functionality that it allowed, theMirrorManager
now subscribes to the latched "registered queries" broadcast topic. Each time it receives the list of registered queries from the Schedule node, it verifies both that its own query is present and that the query ID assigned by the Schedule node matches its own opinion of the query ID.When the query is missing, or the ID is incorrect, the
MirrorManager
will re-register its query and request a new update.To handle possible corner cases when the Schedule node fails and the redundant backup takes over (such as a query being registered just before failure and the redundant backup not being aware of it), the
MirrorManager
will force query validation mode on when it receives the fail-over announcement. However there is a possibility of a query update from the new schedule node arriving before the fail-over announcement, which may not be for the correct query anymore. To identify this situation, the Schedule node is given an "edition" number. Each time fail-over occurs, the new schedule node gets a new edition number. The edition number is sent with each query update. TheMirrorManager
checks the received edition number, and if it is greater than the expected edition number, it also enters query validation mode. While in query validation mode, it stashes all updates. If the query is validated, then it processes the stashed updates. If the query is found to be missing or the ID is found to be incorrect, the stashed updates are dumped and a fresh update is requested.