-
Notifications
You must be signed in to change notification settings - Fork 454
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
[dbnode] Skip entries for unowned shards in commit log bootstrapper #2145
Conversation
Hm, believe the naive case of this was fixed with PR #2052. Although I guess this could be plausible if a bootstrap is already happening and then a further topology change happens, therefore the current bootstrap is bootstrapping data for shards that was valid at beginning of bootstrap but is invalidated by a consequent topology change. If so, this is a good catch! And unfortunate I introduced it for this upcoming release (in current release candidate) =[ If that's what we're protecting against here, this can also happen in the peer bootstrapper which also uses Maybe we should introduce a third return to the i.e. CheckoutSeriesWithoutLock(
shardID uint32,
id ident.ID,
tags ident.TagIterator,
) (result CheckoutSeriesResult, owned bool, err error)
CheckoutSeriesWithLock(
shardID uint32,
id ident.ID,
tags ident.TagIterator,
) (result CheckoutSeriesResult, owned bool, err error) This should force all existing call sites to be updated (like the peers bootstrapper call site which I don't believe is updated with this change) and any new ones to need to consider the case when the series is no longer owned. I'm thinking maybe something like this: result, owned, err := accumulator.CheckoutSeriesWithoutLock(...)
if err != nil {
// .. normal err case
}
if !owned {
// deal with the series not being owned
}
// otherwise use result Thoughts? |
@robskillington yeah that makes sense. Unfortunately we did hit this issue during multiple topology changes that happened in relatively quick succession. Your proposed interface changes sound good - let me do some refactoring. |
…ns the specified shard; refactor
Codecov Report
@@ Coverage Diff @@
## master #2145 +/- ##
=========================================
+ Coverage 65.2% 72.3% +7.0%
=========================================
Files 991 1016 +25
Lines 102460 87969 -14491
=========================================
- Hits 66885 63654 -3231
+ Misses 30735 20047 -10688
+ Partials 4840 4268 -572
Continue to review full report at Codecov.
|
…ad explicitly set var for case when unowned
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, I changed the commit log source bootstrapper code a tiny bit to be more explicit rather than assume any series with a namespace not set needs to be skipped (would rather that panics as should be since unexpected for that to happen and would be a new code bug introduced)
What this PR does / why we need it:
Fixes #2129
Special notes for your reviewer:
Does this PR introduce a user-facing and/or backwards incompatible change?:
Does this PR require updating code package or user-facing documentation?: