Conversation
Since the per-topic config landed, `build()` only ran its checks for topics that have their own max transmit size. The default mesh params, the default max transmit size and topics configured through `set_topic_config` / `mesh_*_for_topic` were never validated. Check the default params and every entry of `topic_mesh_params`, and the default and per-topic transmit sizes.
Contributor
|
This pull request has merge conflicts. Could you please resolve them @Bruce039? 🙏 |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
After the per-topic configuration was added (#5868),
ConfigBuilder::buildonly loops overprotocol.max_transmit_sizes.keys(). So the checks forMeshParametersInvalid,MeshOutboundInvalidandMaxTransmissionSizeTooSmallonly run for topics that have a custom max transmit size. The default mesh params, the defaultmax_transmit_size, and topics configured throughset_topic_configormesh_*_for_topicwithout a size are never checked.For example
ConfigBuilder::default().mesh_n(20).build()returnsOk. With such a config the heartbeat computespeers.len() - mesh_nin themesh_n_highbranch, which overflows in debug builds and in release prunes almost the whole mesh.This validates the transmit sizes first and then runs the mesh checks on the default params plus every entry in
topic_mesh_params. Three tests cover the default params, a topic config and a too small default size; all of them fail on master.test_mesh_subtraction_with_topic_config_min_outboundused a config withmesh_outbound_min(7) abovemesh_n_low(3), which only built because of this bug. I changed it to a valid config that still checks that the outbound peers are kept when the mesh is reduced tomesh_n.