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

kv: properly merge CollectedSpans for split BatchResponses #17414

Conversation

nvanbenschoten
Copy link
Member

Previously we would only return the CollectedSpans of the last
BatchResponse component for a given BatchRequest sent by
DistSender. This bug was subtle and stayed hidden for two reasons:

  • CollectedSpans are only used for snowball tracing when sending
    remote RPCs, so the issue would never be seen in a single node
    deployment.
  • Very few BatchRequests get split in practice, as we try hard
    to send batches using 1 phase commit wherever possible.

The test added will fail for the node-1 and node-2 subtests without
this fix, which demonstrates the existence of the bug.

Previously we would only return the `CollectedSpans` of the last
`BatchResponse` component for a given `BatchRequest` sent by
`DistSender`. This bug was subtle and stayed hidden for two reasons:
- `CollectedSpans` are only used for snowball tracing when sending
  remote RPCs, so the issue would never be seen in a single node
  deployment.
- Very few `BatchRequest`s get split in practice, as we try hard
  to send batches using 1 phase commit wherever possible.

The test added will fail for the `node-1` and `node-2` subtests without
this fix, which demonstrates the existence of the bug.
@cockroach-teamcity
Copy link
Member

This change is Reviewable

@RaduBerinde
Copy link
Member

LGTM, thanks for the fix!

It's a bit strange that there are two parts of dist-sender that deal with combining responses, and they do it differently (divideAndSendBatchToRanges uses Combine). I'm not familiar enough with this code though.


Review status: 0 of 3 files reviewed at latest revision, all discussions resolved, all commit checks successful.


Comments from Reviewable

@tbg
Copy link
Member

tbg commented Aug 3, 2017

@radu Combine() is used to reassemble a multi-range batch and so it's mostly concerned with combining the responses. It's similar but doesn't quite fit here. I agree the code should somehow be cleaner.

:lgtm:


Reviewed 3 of 3 files at r1.
Review status: :shipit: all files reviewed at latest revision, all discussions resolved, all commit checks successful.


Comments from Reviewable

@nvanbenschoten nvanbenschoten merged commit db457ec into cockroachdb:master Aug 3, 2017
@nvanbenschoten nvanbenschoten deleted the nvanbenschoten/fixCollectedSpans branch August 3, 2017 15:02
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.

4 participants