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

Simplify a lot of the mount tuning code #3285

Merged
merged 7 commits into from
Sep 5, 2017
Merged

Conversation

jefferai
Copy link
Member

@jefferai jefferai commented Sep 4, 2017

Make leases much simpler by not trying to compare against system
default/max -- a bit of a fool's errand since a change to config files
can flip whether it's even valid.

For extra credit, add the ability to tune description; closes #2645

Make leases much simpler by not trying to compare against system
default/max -- a bit of a fool's errand since a change to config files
can flip whether it's even valid.

For extra credit, add the ability to tune description; closes #2645
@jefferai jefferai added this to the 0.8.2 milestone Sep 4, 2017
b.Backend.Logger().Error("sys: tune failed: no mount entry found", "path", path)
return handleError(fmt.Errorf("sys: tune of path '%s' failed: no mount entry found", path))
}
if mountEntry != nil && !mountEntry.Local && repState == consts.ReplicationSecondary {
Copy link
Contributor

Choose a reason for hiding this comment

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

This should use the HasState function:

repState.HasState(consts.ReplicationPerformanceSecondary)

Copy link
Member Author

Choose a reason for hiding this comment

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

It's a copy and paste from above, which means it got missed before too :-/

Copy link
Contributor

@briankassouf briankassouf Sep 5, 2017

Choose a reason for hiding this comment

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

It was changed in my locking PR, so i think it has since been updated.

@@ -1586,7 +1606,31 @@ func (b *SystemBackend) handleTuneWriteCommon(
}
}

return nil, nil
var resp *logical.Response
Copy link
Contributor

Choose a reason for hiding this comment

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

This doesn't seem to be used anywhere, should we just return nil, nil below?

Copy link
Member Author

Choose a reason for hiding this comment

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

Ah, it was used for a warning before but that code is now removed, will fix it.

return fmt.Errorf("new backend default lease TTL of %d greater than backend max lease TTL of %d",
int(newDefault.Seconds()), int(meConfig.MaxLeaseTTL.Seconds()))
}
case newDefault != zero && newMax != zero:
Copy link
Contributor

Choose a reason for hiding this comment

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

This switch statement might be cleaner if it only had this case and a default case. Unless you like the verbosity of the other statements + comments.

Copy link
Member Author

Choose a reason for hiding this comment

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

In this instance I found it useful to think through the different cases and leave appropriate comments.

@calvn calvn changed the title Simplify a lot of the mount tuning code. Simplify a lot of the mount tuning code Sep 5, 2017
@calvn
Copy link
Contributor

calvn commented Sep 5, 2017

LGTM aside from the comments that Brian left.

Copy link
Contributor

@chrishoffman chrishoffman 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!

@jefferai
Copy link
Member Author

jefferai commented Sep 5, 2017

Travis failure is from intermittent Cassandra failure; merging.

@jefferai jefferai merged commit a07f3eb into master Sep 5, 2017
@jefferai jefferai deleted the simplify-mount-tuning branch September 5, 2017 14: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.

Feature request: Update mount description
4 participants