Skip to content

CXXCBC-284: Use round-robin for config polling #504

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

Merged
merged 2 commits into from
Jan 22, 2024

Conversation

avsej
Copy link
Member

@avsej avsej commented Jan 20, 2024

Instead of letting each MCBP session to poll for configuration automatically, make bucket object responsible for the polling orchestration and iterate over the list of known session to use only one socket to fetch configuration.

Instead of letting each MCBP session to poll for configuration
automatically, make bucket object responsible for the polling
orchestration and iterate over the list of known session to use only
one socket to fetch configuration.
@avsej avsej requested review from thejcfactor, mikereiche and a team January 20, 2024 02:00
mikereiche
mikereiche previously approved these changes Jan 20, 2024
@avsej avsej merged commit 842a052 into couchbase:main Jan 22, 2024
@avsej avsej deleted the CXXCBC-284-reduce-config-polling-traffic branch January 22, 2024 16:59
@ingenthr
Copy link

Doesn't the RFC say to have a random list and then iterate through it so we don't have a stampeding herd if there's a network issue?

do {
auto ptr = sessions_.find(i % sessions_.size());
if (ptr != sessions_.end() && ptr->second.supports_gcccp()) {
session = ptr->second;
Copy link

@mikereiche mikereiche Jan 23, 2024

Choose a reason for hiding this comment

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

should this break out of the while loop? Otherwise the only exit condition for the loop is that we have reached the beginning again.

      } while (start % sessions_.size() != i % sessions_.size());

@mikereiche
Copy link

the "SHOULD" leaves a little wiggle room. But I looked again at the code, and it looks like the do/while is missing an an exit condition (other than checking all the possible sessions). It looks like it will always choose the last one it checks (?).

"The SDK MUST perform these connections sequentially and not in parallel, and SHOULD perform this in a consistently random order (the SDK should pre-shuffle the list, and then use the pre-shuffled order consistently). "

@ingenthr
Copy link

Thanks for checking, sounds like we should file anew or reopen that issue @mikereiche?

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.

3 participants