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

Don't fail on missing system config. #2582

Merged
merged 1 commit into from
Sep 23, 2015
Merged

Conversation

mberhault
Copy link
Contributor

Fixes #2566

When the system config is not loaded, MaxBytes will remain 0 and
be ignored for split purposes.
It will be properly updated the next time the system config callback
runs.

return fmt.Errorf("no system config available")
// This could be before the system config was ever gossiped,
// or it expired. Let the gossip callback set the info.
log.Warningf("no system config available, cannot determine range MaxBytes")
Copy link
Contributor

Choose a reason for hiding this comment

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

can you make this an errors.New and check equality in the caller? That would make me feel better than returning nil.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

why? we're now saying this is no longer an error, merely an acceptable possibility.

Copy link
Contributor

Choose a reason for hiding this comment

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

well, because in this case updateRangeInfo didn't actually do its work, so it did not complete without error. I think what we're saying is that failure in this function is sometimes acceptable. We can either model that as a particular error that is safe to ignore, or break the function into two: one which is allowed to fail, and one which is not.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

this is the last call to GetSystemConfig that throws an error. Everything else just logs a message. Just like failing on this is odd, so would returning an error just in this case.

Copy link
Contributor

Choose a reason for hiding this comment

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

I'm not sold; I'd rather this be broken into two functions (or just change this function to take cfg as an argument) with differing error semantics.

LGTM as-is for the purpose of fixing the flaky tests.

@tbg
Copy link
Member

tbg commented Sep 21, 2015

Is there technically a race here in which updateRangeInfo fails while the gossip callback runs (so that the new range will never get its MaxBytes set)?

@mberhault
Copy link
Contributor Author

splits are fine. Not sure about snapshots, I haven't traced through those, but as long as replicas are added to the store first, they'll be fine as well.

@tbg
Copy link
Member

tbg commented Sep 21, 2015

yeah, SplitRange is ok because the call to updateRangeInfo is under the store lock (so if the callback comes in in parallel, it's processed strictly before or strictly after). Could you add a comment in the call site at SplitRange? For snapshotting, that seems like it would race (so you'd end up with a new range that wouldn't ever split). That's probably worth a new issue.
LGTM otherwise.

Fixes #2566

When the system config is not loaded, MaxBytes will remain 0 and
be ignored for split purposes.
It will be properly updated the next time the system config callback
runs.
@mberhault mberhault force-pushed the marc/ignore_missing_config branch from a0e037b to 7febfd9 Compare September 22, 2015 13:36
@tamird
Copy link
Contributor

tamird commented Sep 23, 2015

Really seeing a ton of these now.

mberhault added a commit that referenced this pull request Sep 23, 2015
@mberhault mberhault merged commit daf8c87 into master Sep 23, 2015
@mberhault mberhault deleted the marc/ignore_missing_config branch September 23, 2015 22:11
@mberhault
Copy link
Contributor Author

Filed #2649

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