-
Notifications
You must be signed in to change notification settings - Fork 3.8k
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
backupccl: avoid splitting if the split point might be unsafe #109378
backupccl: avoid splitting if the split point might be unsafe #109378
Conversation
It looks like your PR touches production code but doesn't add or edit any test code. Did you consider adding tests to your PR? 🦉 Hoot! I am a Blathers, a bot for CockroachDB. My owner is dev-inf. |
5bac114
to
e53df5b
Compare
} else if len(splitAt) != 0 { | ||
newSplitKey = splitAt | ||
} | ||
log.VEventf(ctx, 1, "presplitting new key %+v", newSplitKey) | ||
if err := s.db.AdminSplit(ctx, newSplitKey, expirationTime); err != nil { | ||
log.Infof(ctx, "presplitting on safe key %s", newSplitKey) |
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.
did you intend to switch this to info? also, I'm not sure if "safe" if meaningful to reader of the logs here, so I might just revert this line.
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.
did you intend to switch this to info?
yes, I was thinking: 10K splits on a node, 200ish bytes per message, gives us 2MB of spam, not great but really nice to see the actual split that restore asked for. Would make debugging the next unsafe split issue easier. WDYT?
I'm not sure if "safe" if meaningful to reader of the logs here
yep, good point, this was "new key" which I also thought doesn't mean much? changed now to just "key".
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.
I'm a little wary of adding net new behavior to a backport, including 10k log lines during a restore; seems like more than is strictly required to fix the bug.
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.
ah yes, you did say that, oops.
done. thanks!
e53df5b
to
037ca8a
Compare
037ca8a
to
bfe187b
Compare
TFTR! |
🕐 Waiting for PR status (GitHub check) to be set, probably by CI. Bors will automatically try to run when all required PR statuses are set. |
bors cancel I'll merge after Rui's change is in. |
bors r- |
bfe187b
to
b30c7b0
Compare
Canceled. |
// The key might be corrupt, and therefore we cannot guarantee it is a valid | ||
// split key. The restore can still continue without this split. This error | ||
// is not expected after #109483 is fixed. | ||
log.Errorf(ctx, "failed splitting at key %s err: %v", newSplitKey, err) |
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.
Minor, but given your changes to EnsureSafeSplitKey, this will be logging the key twice since err also contains it.
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.
done, thank you.
bors r+ |
bors r- |
Canceled. |
b30c7b0
to
dd2fb6e
Compare
Restore may use unsafe keys as split points, which may cause unsafe splits between column families, which may cause SQL to fail when reading the row, or worse, return wrong resutls. This commit avoids splitting on keys that might be unsafe. See the issue for more info. Epic: none Informs: cockroachdb#109483 Release note: None.
dd2fb6e
to
069f4d4
Compare
bors r+ |
Build succeeded: |
Encountered an error creating backports. Some common things that can go wrong:
You might need to create your backport manually using the backport tool. error creating merge commit from 069f4d4 to blathers/backport-release-22.2-109378: POST https://api.github.com/repos/cockroachdb/cockroach/merges: 409 Merge conflict [] you may need to manually resolve merge conflicts with the backport tool. Backport to branch 22.2.x failed. See errors above. 🦉 Hoot! I am a Blathers, a bot for CockroachDB. My owner is dev-inf. |
Restore may use unsafe keys as split points, which may cause unsafe splits
between column families, which may cause SQL to fail when reading the row, or
worse, return wrong resutls.
This commit avoids splitting on keys that might be unsafe.
See the issue for more info.
Epic: none
Informs: #109483
Release note: None.