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

[Bug]: ut / TestGetExprValue failed in 1.2-dev #16441

Closed
1 task done
xzxiong opened this issue May 28, 2024 · 3 comments
Closed
1 task done

[Bug]: ut / TestGetExprValue failed in 1.2-dev #16441

xzxiong opened this issue May 28, 2024 · 3 comments
Assignees
Labels
kind/bug Something isn't working needs-triage severity/s0 Extreme impact: Cause the application to break down and seriously affect the use
Milestone

Comments

@xzxiong
Copy link
Contributor

xzxiong commented May 28, 2024

Is there an existing issue for the same bug?

  • I have checked the existing issues.

Branch Name

1.2-dev

Commit ID

8dfb81b

Other Environment Information

- Hardware parameters:
- OS type:
- Others:

Actual Behavior

https://github.com/matrixorigin/matrixone/actions/runs/9262813285/job/25480353437?pr=16426

=== RUN   TestGetExprValue

 ++++> set @@x=1
✔✔2024/05/28 03:17:47.937968 +0000 DEBUG cn-service.frontend query trace(ExecStmtInSameSession) {"uuid": "", "connection_id": 4294967295, "session_info": "", "session_id": "018fbd34-3b1e-730f-92f9-dc2a39cec2a9"}
2024/05/28 03:17:47.939394 +0000 DEBUG cn-service.frontend query trace status {"uuid": "", "connection_id": 4294967295, "statement": "", "status": "success", "span": {}, "session_info": "", "session_id": "018fbd34-3b1e-730f-92f9-dc2a39cec2a9", "statement_id": "018fbd34-3b22-720c-a2a9-ae42d0231993"}
🔥


Errors:

  * /home/runner/work/matrixone/matrixone/pkg/frontend/util_test.go 
  Line 664: - internal error: no statement info in context 
  goroutine 836 [running]:
  	/home/runner/go/pkg/mod/github.com/smartystreets/[email protected]/convey/reporting/reports.go:150 +0x47
  	/home/runner/go/pkg/mod/github.com/smartystreets/[email protected]/convey/reporting/reports.go:123 +0xbc
  	/home/runner/go/pkg/mod/github.com/smartystreets/[email protected]/convey/context.go:253 +0xfa
  panic({0x5e52660?, 0xc003806500?})
  	/opt/hostedtoolcache/go/1.21.5/x64/src/runtime/panic.go:920 +0x270
  github.com/golang/mock/gomock.(*Controller).finish(0xc00c71c600, 0x0, {0x5e52660, 0xc003806500})
  	/home/runner/go/pkg/mod/github.com/golang/[email protected]/gomock/controller.go:288 +0x73c
  github.com/golang/mock/gomock.(*Controller).Finish(0x6f?)
  	/home/runner/go/pkg/mod/github.com/golang/[email protected]/gomock/controller.go:269 +0x39
  panic({0x5e52660?, 0xc003806500?})
  	/opt/hostedtoolcache/go/1.21.5/x64/src/runtime/panic.go:920 +0x270
  github.com/matrixorigin/matrixone/pkg/util/trace/impl/motrace.EndStatement({0x8588a48, 0xc002d01ec0}, {0x0?, 0x0}, 0x0, 0x0, 0x0)
  	/home/runner/work/matrixone/matrixone/pkg/util/trace/impl/motrace/report_statement.go:586 +0x9bf
  github.com/matrixorigin/matrixone/pkg/frontend.logStatementStringStatus({0x8588a48, 0xc002d01ec0}, {0x8631338, 0xc003741c00}, {0xc0002b0120, 0x12}, 0x0, {0x0?, 0x0?})
  	/home/runner/work/matrixone/matrixone/pkg/frontend/util.go:513 +0xa3a
  github.com/matrixorigin/matrixone/pkg/frontend.logStatementStatus({0x8588a48, 0xc002d01ec0}, {0x8631338, 0xc003741c00}, {0x85a4d48, 0xc004a79ec0}, 0x0?, {0x0, 0x0})
  	/home/runner/work/matrixone/matrixone/pkg/frontend/util.go:496 +0x185
  github.com/matrixorigin/matrixone/pkg/frontend.respClientWhenSuccess(0xc003741c00, 0xc0048c2600)
  	/home/runner/work/matrixone/matrixone/pkg/frontend/resp_client.go:43 +0x136
  github.com/matrixorigin/matrixone/pkg/frontend.executeStmtWithResponse(0xc003741c00, 0xc0048c2600)
  	/home/runner/work/matrixone/matrixone/pkg/frontend/mysql_cmd_executor.go:2388 +0x973
  github.com/matrixorigin/matrixone/pkg/frontend.doComQuery(0xc003741c00, 0xc0048c2600, 0xc0043b5ea0)
  	/home/runner/work/matrixone/matrixone/pkg/frontend/mysql_cmd_executor.go:2912 +0x2f6e
  github.com/matrixorigin/matrixone/pkg/frontend.executeStmtInSameSession({0x8588a48, 0xc00c71c030}, 0xc003741c00, 0xc0048c2600, {0x85a4d48?, 0xc004a79ec0})
  	/home/runner/work/matrixone/matrixone/pkg/frontend/back_exec.go:548 +0x6cc
  github.com/matrixorigin/matrixone/pkg/frontend.getExprValue({0x85757b8?, 0xc0043b5d60}, 0xc003741c00, 0xc0048c2400)
  	/home/runner/work/matrixone/matrixone/pkg/frontend/util.go:315 +0x775
  github.com/matrixorigin/matrixone/pkg/frontend.TestGetExprValue.func1()
  	/home/runner/work/matrixone/matrixone/pkg/frontend/util_test.go:664 +0x426a
  	/home/runner/go/pkg/mod/github.com/smartystreets/[email protected]/convey/discovery.go:89 +0x2f
  	/home/runner/go/pkg/mod/github.com/smartystreets/[email protected]/convey/context.go:279 +0x2d3
  	/home/runner/go/pkg/mod/github.com/smartystreets/[email protected]/convey/context.go:112 +0x1cd
  github.com/jtolds/gls.(*ContextManager).SetValues.func1(0x0)
  	/home/runner/go/pkg/mod/github.com/jtolds/[email protected]+incompatible/context.go:97 +0x5fd
  github.com/jtolds/gls.EnsureGoroutineId.func1()
  	/home/runner/go/pkg/mod/github.com/jtolds/[email protected]+incompatible/gid.go:24 +0x39
  github.com/jtolds/gls._m(0x0, 0xc0029b6150)
  	/home/runner/go/pkg/mod/github.com/jtolds/[email protected]+incompatible/stack_tags.go:108 +0x39
  github.com/jtolds/gls.github_com_jtolds_gls_markS(0xabd57e0?, 0xc00c71c3f0?)
  	/home/runner/go/pkg/mod/github.com/jtolds/[email protected]+incompatible/stack_tags.go:56 +0x34
  github.com/jtolds/gls.addStackTag(...)
  	/home/runner/go/pkg/mod/github.com/jtolds/[email protected]+incompatible/stack_tags.go:49
  github.com/jtolds/gls.EnsureGoroutineId(0xc00c71c3f0)
  	/home/runner/go/pkg/mod/github.com/jtolds/[email protected]+incompatible/gid.go:24 +0x176
  github.com/jtolds/gls.(*ContextManager).SetValues(0xc000221a50, 0xc00c71c210, 0xc004700040)
  	/home/runner/go/pkg/mod/github.com/jtolds/[email protected]+incompatible/context.go:63 +0x285
  	/home/runner/go/pkg/mod/github.com/smartystreets/[email protected]/convey/context.go:107 +0x54f
  	/home/runner/go/pkg/mod/github.com/smartystreets/[email protected]/convey/doc.go:76 +0x9b
  github.com/matrixorigin/matrixone/pkg/frontend.TestGetExprValue(0xc002af21a0)
  	/home/runner/work/matrixone/matrixone/pkg/frontend/util_test.go:502 +0x19b
  testing.tRunner(0xc002af21a0, 0x6305e08)
  	/opt/hostedtoolcache/go/1.21.5/x64/src/testing/testing.go:1595 +0x262
  created by testing.(*T).Run in goroutine 1
  	/opt/hostedtoolcache/go/1.21.5/x64/src/testing/testing.go:1648 +0x846

直接原因: in 1.2-dev的分支下,并发执行Case,如果遇到 motrace.GetTracerProvider().IsEnable() == true 的情况,就会有问题。
root cause: 跟进中
image

Expected Behavior

No response

Steps to Reproduce

mo1.2 CI

Additional information

No response

@xzxiong xzxiong added kind/bug Something isn't working needs-triage severity/s0 Extreme impact: Cause the application to break down and seriously affect the use labels May 28, 2024
@xzxiong xzxiong self-assigned this May 28, 2024
@matrix-meow matrix-meow added this to the 1.2.0 milestone May 28, 2024
@xzxiong xzxiong changed the title [Bug]: ut / [Bug]: ut / TestGetExprValue failed in 1.2-dev May 28, 2024
@xzxiong
Copy link
Contributor Author

xzxiong commented May 28, 2024

注:执行 set xxxx = ? 会触发一个 internal 的 select 1 from dual 的query ,但是 context 中会有真是的 statement_info 信息
基于此,报错的case 的 ctx 确实没有 statement_info 的。这个case 不明出处
image

@xzxiong
Copy link
Contributor Author

xzxiong commented May 28, 2024

备注,pr #16411 合并后,这个场景就不存在了。
新代码通过 Session.tStmt 进行访问,不再使用 context.Context 判断。

@xzxiong
Copy link
Contributor Author

xzxiong commented May 28, 2024

root case:
该 ut 的ctx 就是没有 StatementInfo 的,在 RecordStatement 时 motrace.GetTracerProvider().IsEnable() ==false.
当执行 EndStatmenet 时,遇到 motrace.GetTracerProvider().IsEnable() == true 的情况

解决方式:
pr #16411 合并即可。

@xzxiong xzxiong closed this as completed May 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Something isn't working needs-triage severity/s0 Extreme impact: Cause the application to break down and seriously affect the use
Projects
None yet
Development

No branches or pull requests

2 participants