-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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
kv: mark AddSSTable requests "unsplittable" #24299
Conversation
This is part of a collection of changes that teaches As part of that larger CL, I have tests that cover this in 334a8fd#diff-1603e8373747484ccf4a1f6d121e8573R290, but would also be happy to have suggestion on if/how to test it in isolation too. |
Several typos in commit message: reuquest, recipieant Review status: 0 of 3 files reviewed at latest revision, all discussions resolved, some commit checks failed. Comments from Reviewable |
pkg/kv/dist_sender.go
Outdated
@@ -1125,6 +1130,9 @@ func (ds *DistSender) sendPartialBatch( | |||
if err := evictToken.EvictAndReplace(ctx, replacements...); err != nil { | |||
return response{pErr: roachpb.NewError(err)} | |||
} | |||
if ba.IsUnsplittable() { | |||
return response{pErr: pErr} |
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.
huh, I think I messed this one up and it actually needs to move into divideAndSendBatchToRanges
, right after the check if the batch fits within a (new) single range.
Reworded the commit msg and moved one of the checks from just above the |
Reviewed 2 of 3 files at r1, 1 of 1 files at r2. pkg/kv/dist_sender.go, line 858 at r2 (raw file):
Isn't this check redundant? Comments from Reviewable |
Review status: 2 of 3 files reviewed at latest revision, 2 unresolved discussions. pkg/kv/dist_sender.go, line 858 at r2 (raw file): Previously, tschottdorf (Tobias Schottdorf) wrote…
yep, you're right, once I moved the other call into divideAndSend, this one became redundant. deleted. Comments from Reviewable |
Review status: 2 of 3 files reviewed at latest revision, 2 unresolved discussions, some commit checks failed. Comments from Reviewable |
Reviewed 1 of 1 files at r3. Comments from Reviewable |
@dt, you're holding off on merging this intentionally, right? Just saw this in my list of open PRs. |
@tschottdorf yeah, it doesn't have test coverage here. I'd originally expected to land it together with changes in the calling code that actually use the error and would thus exercise it in tests, but we've re-ordered our backlog a bit and I haven't actually finished up that part of the change yet. I guess I could come up with some more isolated test and land this in isolation instead? |
Your call, I was just curious.
On Thu, Apr 26, 2018 at 10:16 AM David Taylor ***@***.***> wrote:
@tschottdorf <https://github.com/tschottdorf> yeah, it doesn't have test
coverage here. I'd originally expected to land it together with changed in
the calling code that actually use the error and would thus exercise it in
tests, but we're working on some other features before the AddSST-based
index backfill that required that, so I haven't finished that part of the
change yet. I guess I could come up with some more isolated test and land
this in isolation instead?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#24299 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AE135GTerI-8qV_tqwOO6tSYp0X-mhI-ks5tsdasgaJpZM4S_OOq>
.
--
…-- Tobias
|
Usually we split span requests automatically in DistSender however AddSSTable requests are special: their large SST file is an opaque payload that contains keys that could span the post-split requests. We currently assert during ingestion that the span of an SST's contents matches the request's span, as the file is ingested whole, without modification, meaning that currently a split-and-truncated request fails. However we if a request will fail, we can reject it as soon as we'd try to split it, before sending these large, expensive files around. More importantly, if communicate back to the caller the actual range bounds, it can try again, generating re-chunked SSTs with bounds that should be OK. Note: we could try to make the recipient able to correctly ingest only the subset of the unsplit SST by iterating over it and generating a new file containing just those keys in the request span. However this is significant complexity to add to a raft command evaluation, and changes the performance characteristics of `AddSSTable` that make it appealing in the first place. Release note: none.
26811: kv: update the TCS's txn on requests way out r=andreimatei a=andreimatei The TxnCoordSender maintains a copy of the transaction record, used for things like heartbeating and creating new transactions after a TransactionAbortedError. This copy is supposed to be kept in sync with the client.Txn's copy. Before this patch, the syncing was done by updating the TCS's txn when a response comes back from a request. This patch moves to updating the TCS's txn on a request's way out, in addition to continuing to update it when a request comes back. Besides being the sane thing to do™, this assures that, if the heartbeat loop triggers before the response to the BeginTransaction's batch comes back, the transaction already has the key set. Without this patch, if the heartbeat loop triggered before the BeginTxn response, it would heartbeat key /Min, which is non-sensical (and creating load on range 0 for TPCC loadtests). Release note: None 26881: importccl: restart IMPORT on worker node failure r=mjibson a=mjibson Attempt to detect a context canceled error in IMPORT which is caused by a node going away in the dist SQL run. Send a special error back to the job registry indicating a restart should happen instead of a failure. We are shipping this with a skipped test because it is flakey. We are ok doing that because it is still better than what we had before in many cases, just not all. We will work to improve the other things so that we can correctly detect when IMPORT can be restarted due to a node outage, which will allow us to unskip this test. Fixes #25866 Fixes #25480 Release note (bug fix): IMPORT now detects node failure and will restart instead of fail. 26968: settings: bump minimum supported version to v2.0 r=nvanbenschoten a=nvanbenschoten We're currently shipping v2.1 alphas, so enforce a minimum binary version of v2.0. This ensures that no one can upgrade directly from v1.1 to v2.1. Instead, they need to make a pit sop in v2.0. Release note: None 26984: storageccl: retry SST chunks with new splits on err r=dt a=dt Simpler alternative to #26930. Closes #26930. Previously an ImportRequest would fail to add SSTables that spanned the boundries of the target range(s). This reattempts the AddSSTable call with re-chunked SSTables that avoid spanning the bounds returned in range mismatch error. It does this by iterating the SSTable to build and add smaller sstables for either side of the split. This error currently happens rarely in practice -- we usually explicitly split ranges immediately before sending an Import with matching boundsto them. Usually the empty, just-split range has no reason to split again, so the Import usually succeeds. However in some cases, like resuming a prior RESTORE, we may be re-Importing into ranges that are *not* empty and could have split at points other than those picked by the RESTORE statement. Fixes #17819. Subsumes #24299. Closes #24299. Release note: none. Co-authored-by: Andrei Matei <[email protected]> Co-authored-by: Matt Jibson <[email protected]> Co-authored-by: Nathan VanBenschoten <[email protected]> Co-authored-by: David Taylor <[email protected]>
Usually we split span requests automatically in DistSender however
AddSSTable requests are special: their large SST file is an opaque
payload that contains keys that could span the post-split requests.
We currently assert during ingestion that the span of an SST's contents
matches the request's span, as the file is ingested whole, without
modification, meaning that currently a split-and-truncated request
fails.
However we if a request will fail, we can reject it as soon as we'd try
to split it, before sending these large, expensive files around. More
importantly, if communicate back to the caller the actual range bounds,
it can try again, generating re-chunked SSTs with bounds that should be
OK.
Note: we could try to make the recipient able to correctly ingest only
the subset of the unsplit SST by iterating over it and generating a new
file containing just those keys in the request span. However this is
significant complexity to add to a raft command evaluation, and changes
the performance characteristics of
AddSSTable
that make it appealingin the first place.
Release note: none.