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

store/tikv: coprocess streaming tiny fix #6186

Merged
merged 14 commits into from
Apr 4, 2018

Conversation

tiancaiamao
Copy link
Contributor

@tiancaiamao tiancaiamao commented Mar 29, 2018

Tiny fix:

  1. Handle that the remote peer close streaming connection when the first time Recv() is called.
  2. Handle that TiKV doesn't set coprocessor.Response.Range field when error happens.

@coocood @winkyao @shenli

@tiancaiamao
Copy link
Contributor Author

/run-all-tests

@zimulala zimulala added the DNM label Mar 30, 2018
@tiancaiamao
Copy link
Contributor Author

/run-all-tests

@tiancaiamao
Copy link
Contributor Author

/run-all-tests

@tiancaiamao
Copy link
Contributor Author

/run-sqllogic-test

@tiancaiamao
Copy link
Contributor Author

/run-unit-test

@iamxy
Copy link
Member

iamxy commented Mar 30, 2018

/run-unit-test
/run-sqllogic-test

1 similar comment
@tiancaiamao
Copy link
Contributor Author

/run-unit-test
/run-sqllogic-test

@tiancaiamao
Copy link
Contributor Author

/run-all-tests

@tiancaiamao
Copy link
Contributor Author

/run-integration-common-test

@tiancaiamao
Copy link
Contributor Author

/run-common-test

1 similar comment
@tiancaiamao
Copy link
Contributor Author

/run-common-test

@tiancaiamao
Copy link
Contributor Author

/run-all-tests

@tiancaiamao tiancaiamao changed the title [DNM] enable coprocess streaming for integrated testing *: enable coprocess streaming API by default Apr 2, 2018
@tiancaiamao tiancaiamao removed the DNM label Apr 2, 2018
@tiancaiamao
Copy link
Contributor Author

/run-integration-common-test

1 similar comment
@tiancaiamao
Copy link
Contributor Author

/run-integration-common-test

@tiancaiamao tiancaiamao changed the title *: enable coprocess streaming API by default store/tikv: coprocess streaming tiny fix Apr 2, 2018
@tiancaiamao
Copy link
Contributor Author

So, I've revert the configuration.
PTAL @disksing @coocood

if errors.Cause(err) != io.EOF {
return nil, errors.Trace(err)
}
log.Info("copstream returns nothing for the request.")
Copy link
Contributor

Choose a reason for hiding this comment

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

Is it expected for tikv to close the stream directly?
If so, I think Debug is better, otherwise I think Warn is better.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'll change it to debug level

@@ -652,7 +656,7 @@ func (it *copIterator) handleCopStreamResult(bo *Backoffer, stream *tikvrpc.CopS

// handleCopResponse checks coprocessor Response for region split and lock,
// returns more tasks when that happens, or handles the response if no error.
func (it *copIterator) handleCopResponse(bo *Backoffer, resp *coprocessor.Response, task *copTask, ch chan copResponse) ([]*copTask, error) {
func (it *copIterator) handleCopResponse(bo *Backoffer, resp *coprocessor.Response, task *copTask, ch chan copResponse, lastResp *coprocessor.Response) ([]*copTask, error) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Could you add the comment for lastResp?

func (it *copIterator) handleCopResponse(bo *Backoffer, resp *coprocessor.Response, task *copTask, ch chan copResponse) ([]*copTask, error) {
// if we're handling streaming coprocessor response, lastResp is the last successful response,
// if we're handling normal request, lastResp and resp is the same.
func (it *copIterator) handleCopResponse(bo *Backoffer, resp *coprocessor.Response, task *copTask, ch chan copResponse, lastResp *coprocessor.Response) ([]*copTask, error) {
Copy link
Member

@coocood coocood Apr 3, 2018

Choose a reason for hiding this comment

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

How about using lastRange *KeyRange instead of lastResp *coprocessor.Response?
It's easier to understand the purpose of the argument.

@tiancaiamao
Copy link
Contributor Author

/run-all-tests

@coocood
Copy link
Member

coocood commented Apr 4, 2018

LGTM

@coocood coocood added status/LGT1 Indicates that a PR has LGTM 1. type/bugfix This PR fixes a bug. labels Apr 4, 2018
@tiancaiamao
Copy link
Contributor Author

PTAL @disksing

Copy link
Contributor

@disksing disksing left a comment

Choose a reason for hiding this comment

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

LGTM.

@tiancaiamao tiancaiamao merged commit bc7638d into pingcap:master Apr 4, 2018
@tiancaiamao tiancaiamao deleted the testing branch April 4, 2018 06:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status/LGT1 Indicates that a PR has LGTM 1. type/bugfix This PR fixes a bug.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants