Skip to content

Conversation

@etschannen
Copy link
Contributor

No description provided.

…this will overwrite the region configure if both are present
…e tlogs when they become available in a better satellite location
…es or resolvers from being recruited with good fitness
Copy link
Contributor

@mpilman mpilman left a comment

Choose a reason for hiding this comment

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

Looks good to me except for my two minor comments. Please decide whether you want to address or ignore them ;)

if( now() - startTime < SERVER_KNOBS->WAIT_FOR_GOOD_RECRUITMENT_DELAY &&
( RoleFitness(SERVER_KNOBS->EXPECTED_TLOG_FITNESS, req.configuration.getDesiredLogs(), ProcessClass::TLog).betterCount(RoleFitness(tlogs, ProcessClass::TLog)) ||
RoleFitness(std::min(SERVER_KNOBS->EXPECTED_PROXY_FITNESS, SERVER_KNOBS->EXPECTED_RESOLVER_FITNESS), std::max(SERVER_KNOBS->EXPECTED_PROXY_FITNESS, SERVER_KNOBS->EXPECTED_RESOLVER_FITNESS), req.configuration.getDesiredProxies()+req.configuration.getDesiredResolvers(), ProcessClass::NoRole).betterCount(bestFitness) ) ) {
RoleFitness(SERVER_KNOBS->EXPECTED_PROXY_FITNESS, req.configuration.getDesiredProxies(), ProcessClass::Proxy).betterCount(bestFitness.first) ||
Copy link
Contributor

Choose a reason for hiding this comment

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

I know this might be a bit out of scope for this PR, but... before this PR the betterMasterExists method was already 190 lines long - now with this change it might well be over 200 lines (didn't check). Would this maybe the right point in time to refactor this a bit and split it into several functions? I have a hard time reviewing this change just because of the size of this method.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

When I merge master recovery logic into the cluster controller, better master exists will hopefully become much simpler. It is probably not worth any refactoring before it is completely overhauled

Copy link
Contributor

Choose a reason for hiding this comment

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

that's a fair point, doing this in CC instead of master should indeed make this simpler.

@etschannen etschannen merged commit a85f69c into apple:release-6.2 Oct 16, 2019
@etschannen etschannen deleted the feature-recruitment-cleanup branch January 13, 2020 22:23
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.

2 participants