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

*: opentracing for Execute,ParseSQL,Compile,runStmt #4929

Merged
merged 6 commits into from Oct 31, 2017

Conversation

Projects
None yet
4 participants
@tiancaiamao
Contributor

tiancaiamao commented Oct 27, 2017

Now we get here:
image

Next time, I'll trace some executor information such as coprocessor read operation...

@tiancaiamao

This comment has been minimized.

Show comment
Hide comment
@tiancaiamao

tiancaiamao Oct 27, 2017

Contributor

/run-all-tests

Contributor

tiancaiamao commented Oct 27, 2017

/run-all-tests

@ngaut

This comment has been minimized.

Show comment
Hide comment
@ngaut

ngaut Oct 27, 2017

Member

👍

Member

ngaut commented Oct 27, 2017

👍

@zz-jason

This comment has been minimized.

Show comment
Hide comment
@zz-jason

zz-jason Oct 27, 2017

Member

LGTM

Member

zz-jason commented Oct 27, 2017

LGTM

@zz-jason

This comment has been minimized.

Show comment
Hide comment
@zz-jason

zz-jason Oct 27, 2017

Member

/run-common-test

Member

zz-jason commented Oct 27, 2017

/run-common-test

@zz-jason zz-jason added this to the 1.1 milestone Oct 28, 2017

@zz-jason

This comment has been minimized.

Show comment
Hide comment
@zz-jason
Member

zz-jason commented Oct 31, 2017

Show outdated Hide outdated tidb.go
@@ -846,7 +869,11 @@ func (s *session) Txn() kv.Transaction {
func (s *session) NewTxn() error {
if s.txn != nil && s.txn.Valid() {
err := s.CommitTxn()
ctx := s.goCtx
if ctx == nil {

This comment has been minimized.

@coocood

coocood Oct 31, 2017

Member

When will ctx be nil?

@coocood

coocood Oct 31, 2017

Member

When will ctx be nil?

This comment has been minimized.

@tiancaiamao

tiancaiamao Oct 31, 2017

Contributor

Normal cases won't go here, but in the testing ctx maybe not set.

@tiancaiamao

tiancaiamao Oct 31, 2017

Contributor

Normal cases won't go here, but in the testing ctx maybe not set.

@@ -66,8 +67,8 @@ type Session interface {
AffectedRows() uint64 // Affected rows by latest executed stmt.
Execute(sql string) ([]ast.RecordSet, error) // Execute a sql statement.
String() string // String is used to debug.
CommitTxn() error
RollbackTxn() error
CommitTxn(goctx.Context) error

This comment has been minimized.

@coocood

coocood Oct 31, 2017

Member

Can we not adding goctx.Context, always use Session.GoCtx in implementation?

@coocood

coocood Oct 31, 2017

Member

Can we not adding goctx.Context, always use Session.GoCtx in implementation?

This comment has been minimized.

@tiancaiamao

tiancaiamao Oct 31, 2017

Contributor

It's better to add this argument, and avoid store ctx in the object if possible.

For example, session start a txn and store the txn to session.GoCtx,
then call function F(ctx),
F(ctx) call CommitTxn() ...
span parent of CommitTxn() should be F(ctx), not the session.GoCtx

@tiancaiamao

tiancaiamao Oct 31, 2017

Contributor

It's better to add this argument, and avoid store ctx in the object if possible.

For example, session start a txn and store the txn to session.GoCtx,
then call function F(ctx),
F(ctx) call CommitTxn() ...
span parent of CommitTxn() should be F(ctx), not the session.GoCtx

@coocood

LGTM

@tiancaiamao tiancaiamao merged commit 29153d7 into pingcap:master Oct 31, 2017

5 checks passed

ci/circleci Your tests passed on CircleCI!
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
coverage/coveralls First build on master at 71.981%
Details
jenkins-ci-tidb/build Jenkins job succeeded.
Details
license/cla Contributor License Agreement is signed.
Details

@tiancaiamao tiancaiamao deleted the tiancaiamao:opentracing-transaction branch Oct 31, 2017

dbjoa added a commit to cloud-pi/tidb that referenced this pull request Nov 6, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment