Skip to content

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

Merged
avsej merged 2 commits intocouchbase:mainfrom
avsej:CXXCBC-284-reduce-config-polling-traffic
Jan 22, 2024
Merged

CXXCBC-284: Use round-robin for config polling#504
avsej merged 2 commits intocouchbase:mainfrom
avsej:CXXCBC-284-reduce-config-polling-traffic

Conversation

@avsej
Copy link
Copy Markdown
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 a team, mikereiche and thejcfactor 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
Copy Markdown

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?

Comment thread core/bucket.cxx
do {
auto ptr = sessions_.find(i % sessions_.size());
if (ptr != sessions_.end() && ptr->second.supports_gcccp()) {
session = ptr->second;
Copy link
Copy Markdown

@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
Copy Markdown

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
Copy Markdown

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