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

CLOUDP-65729: Add sharded cluster support to Ops Manager #217

Merged
merged 5 commits into from
Jun 25, 2020
Merged

Conversation

gssbzn
Copy link
Collaborator

@gssbzn gssbzn commented Jun 24, 2020

Proposed changes

Jira ticket: CLOUDP-65729

Checklist

  • I have added tests that prove my fix is effective or that my feature works
  • I have added any necessary documentation (if appropriate)
  • I have run make fmt and formatted my code

Further comments

This adds support to list and create sharded clusters, update is still untested

Open to suggestion on naming specially of RSConfig struct

robcarlan-mlab
robcarlan-mlab previously approved these changes Jun 24, 2020
Copy link
Contributor

@robcarlan-mlab robcarlan-mlab left a comment

Choose a reason for hiding this comment

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

Just a couple of comments, lgtm as far as I can see. I don't have the full context so I may have missed things

in.Processes = append(in.Processes[:k], in.Processes[k+1:]...)
out[i].ProcessConfigs[j] = newReplicaSetProcessConfig(m, p)
out[i].addToMongoURI(p)
in.Processes = removeProcess(in.Processes, k)
Copy link
Contributor

Choose a reason for hiding this comment

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

Is there a reason to modify the in argument?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

since this is such a complex search (O(n*m*o)) I'm trying to speed up search by deleting visited processes
I want at some point benchmark this to see how else can we improve it

Copy link
Contributor

Choose a reason for hiding this comment

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

ah got it

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I changed the name from in and added a comment about how this method is dangerous


if constrain.Check(ver) {
return zero, nil
func patchSharding(out *opsmngr.AutomationConfig, s *opsmngr.ShardingConfig) {
Copy link
Contributor

Choose a reason for hiding this comment

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

So this doesn't modify existing sharding configs -- is that not supported? Might be worth putting a comment for the function

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I just didn't want to add test for this and manual test takes all my resources, I've added a TODO with a CLOUDP to test it later


type patcher func(*ProcessConfig, string) *opsmngr.Process

// path is a generic replica set patcher, you'll need to provide a function that
Copy link
Contributor

Choose a reason for hiding this comment

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

[np] missing rest of comment

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

not only that the method name had a typo, fixed

Copy link
Collaborator Author

@gssbzn gssbzn left a comment

Choose a reason for hiding this comment

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

Copy link
Contributor

@robcarlan-mlab robcarlan-mlab left a comment

Choose a reason for hiding this comment

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

lgtm!

@gssbzn gssbzn merged commit 8aed559 into master Jun 25, 2020
@gssbzn gssbzn deleted the om-cluster branch June 25, 2020 08:59
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

2 participants