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

Mandate flow control in bytes #4353

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

bboston7
Copy link
Contributor

@bboston7 bboston7 commented Jun 7, 2024

This is the first step in addressing #3781. It removes the ENABLE_FLOW_CONTROL_BYTES config option and always uses flow control bytes mode when a peer supports it.

Most of the change is tweaking tests to stress one of two scenarios:

  1. Both parties have flow control bytes enabled
  2. One party has flow control bytes enabled

It is no longer possible for neither party to have flow control bytes enabled.

Once the minimum supported overlay version is at least 35 we can remove all of the code handling cases where a peer does not have flow control bytes enabled.

Checklist

  • Reviewed the contributing document
  • Rebased on top of master (no merge commits)
  • Ran clang-format v8.0.0 (via make format or the Visual Studio extension)
  • Compiles
  • Ran all tests
  • If change impacts performance, include supporting evidence per the performance document

This is the first step in addressing stellar#3781. It removes the
`ENABLE_FLOW_CONTROL_BYTES` config option and always uses flow control
bytes mode when a peer supports it.

Most of the change is tweaking tests to stress one of two scenarios:
1. Both parties have flow control bytes enabled
2. One party has flow control bytes enabled

It is no longer possible for neither party to have flow control bytes
enabled.

Once the minimum supported overlay version is at least 35 we can remove
all of the code handling cases where a peer does not have flow control
bytes enabled.
Comment on lines +1035 to +1051
if (readBool(item))
{
CLOG_WARNING(
Overlay,
"ENABLE_FLOW_CONTROL_BYTES is now mandatory. This "
"config option will be removed in a future release. "
"Please remove the option from your configuration "
"file.");
}
else
{
CLOG_ERROR(Overlay,
"ENABLE_FLOW_CONTROL_BYTES is now mandatory. "
"Overriding to `true`. This config option will "
"be removed in a future release. Please remove "
"the option from your configuration file.");
}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I want to call this out because I'm not sure what our usual policy is around removing config options. I opted to have it ignore the option entirely, but warn or error depending on whether the config option matched the new requirement. Another option would be to fail to start. What approach do we usually take?

Copy link
Contributor

Choose a reason for hiding this comment

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

I think ignoring is fine here. Unlike the BucketListDB config migrations, ENABLE_FLOW_CONTROL_BYTES being silently enabled won't break any operators, so we can just warn for a bit then remove the flag.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sounds good! I left this as-is.

Copy link
Contributor

Choose a reason for hiding this comment

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

Tbh I doubt anyone would be affected by the removal of this flag, since it's sort of an advanced low-level config. You can probably just remove it without graceful deprecation, but we do need to make sure that our own infra isn't using the flag somewhere (to avoid crashing on startup during the release).

Copy link
Contributor

@SirTyson SirTyson left a comment

Choose a reason for hiding this comment

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

LGTM, one comment on changing a flow control bytes check to make deprecation easier.

Comment on lines +1035 to +1051
if (readBool(item))
{
CLOG_WARNING(
Overlay,
"ENABLE_FLOW_CONTROL_BYTES is now mandatory. This "
"config option will be removed in a future release. "
"Please remove the option from your configuration "
"file.");
}
else
{
CLOG_ERROR(Overlay,
"ENABLE_FLOW_CONTROL_BYTES is now mandatory. "
"Overriding to `true`. This config option will "
"be removed in a future release. Please remove "
"the option from your configuration file.");
}
Copy link
Contributor

Choose a reason for hiding this comment

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

I think ignoring is fine here. Unlike the BucketListDB config migrations, ENABLE_FLOW_CONTROL_BYTES being silently enabled won't break any operators, so we can just warn for a bit then remove the flag.

{
msg.auth().flags = AUTH_MSG_FLAG_FLOW_CONTROL_BYTES_REQUESTED;
}
#else
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit: This #else isn't necessary, you can just wrap the if expression:

#ifdef BUILD_TESTS
    if (!mAppConnector.getOverlayManager()
             .isFlowControlBytesDisabledForTesting())
#endif

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done!

enableBytes &&
msg.auth().flags == AUTH_MSG_FLAG_FLOW_CONTROL_BYTES_REQUESTED &&
mAppConnector.getConfig().ENABLE_FLOW_CONTROL_BYTES;
msg.auth().flags == AUTH_MSG_FLAG_FLOW_CONTROL_BYTES_REQUESTED;
Copy link
Contributor

Choose a reason for hiding this comment

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

Should we change this check to

 bool bothWantBytes =
        msg.auth().flags == AUTH_MSG_FLAG_FLOW_CONTROL_BYTES_REQUESTED || getRemoteOverlayVersion() >= 35;

That way once the minimum protocol version >= 35, we can just stop sending/checking AUTH_MSG_FLAG_FLOW_CONTROL_BYTES_REQUESTED entirely, since the flag would be made redundant.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah, I think that's a good idea. I made that change.

Copy link
Contributor

@SirTyson SirTyson left a comment

Choose a reason for hiding this comment

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

LGTM, thanks for the changes!

Copy link
Contributor

@marta-lokhova marta-lokhova left a comment

Choose a reason for hiding this comment

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

I think you can go further with this change and remove support for disabling flow control in bytes completely:

  • Minimum overlay version is far beyond FIRST_VERSION_SUPPORTING_FLOW_CONTROL_IN_BYTES at this point, so most (if not all) nodes on the network will have the feature enabled
  • I doubt there are any nodes outside of our infra that are manually tuning this config. Looking at a snapshot of peers on one of the watchers, I don't see anyone not using the feature.
  • I think we can remove any conditional enabling of flow control in bytes, and just implicitly set it to true. You might be able to get rid of the annoying FlowControl::start call at the end of authentication as well, and basically start flow control automatically when we create Peer.
  • We also don't need to set AUTH_MSG_FLAG_FLOW_CONTROL_BYTES_REQUESTED anymore. I'd suggest we set auth flags back to 0, so we can use it for future feature rollout. AUTH_MSG_FLAG_FLOW_CONTROL_BYTES_REQUESTED can be deprecated.
  • We still need to bump overlay version. While we're at it: the network recently upgraded to v21, so we can actually bump minimum overlay version as well to the one that supports v21 (meaning that we can drop all v20 clients now)
  • Dropping support for this flag means we can drop all the tests dealing with mixed modes. Yay to code removal!

Comment on lines +1035 to +1051
if (readBool(item))
{
CLOG_WARNING(
Overlay,
"ENABLE_FLOW_CONTROL_BYTES is now mandatory. This "
"config option will be removed in a future release. "
"Please remove the option from your configuration "
"file.");
}
else
{
CLOG_ERROR(Overlay,
"ENABLE_FLOW_CONTROL_BYTES is now mandatory. "
"Overriding to `true`. This config option will "
"be removed in a future release. Please remove "
"the option from your configuration file.");
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Tbh I doubt anyone would be affected by the removal of this flag, since it's sort of an advanced low-level config. You can probably just remove it without graceful deprecation, but we do need to make sure that our own infra isn't using the flag somewhere (to avoid crashing on startup during the release).

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.

None yet

3 participants