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

add debug tool for remote run #19833

Open
wants to merge 10 commits into
base: main
Choose a base branch
from

Conversation

ouyuanning
Copy link
Contributor

What type of PR is this?

  • API-change
  • BUG
  • Improvement
  • Documentation
  • Feature
  • Test and CI
  • Code Refactoring

Which issue(s) this PR fixes:

issue #19801

What this PR does / why we need it:

add debug tool for remote run

主要解决在查hung问题的时候,有时候是hung在等其他cn的某个go routine执行结果的返回。
而之前从 txn leak里只能跟踪到直接hung的那个go routine,不知道被等待的那个go routine是什么,这里通过一个注入语句,可以在运行时增加对应的log信息,以便通过等待的compile的内存指针,去找被等待的那个go routine id

使用方法:
假设要执行的sql是: update test_table set b = b + 1 where a < 5000000;

select mo_ctl("dn", "addfaultpoint", "enable_fault_injection");
select mo_ctl("dn", "addfaultpoint", "inject_send_pipeline.1:1:1:.echo.1.test_table"); //在使用时只要修改这里的 test_table 为你要执行的sql的关键字就好了。

那么我们将可以在日志上看到类似这样的日志:

2024/11/06 14:47:57.001363 +0800 INFO compile/remoterunServer.go:97 inject_send_pipeline: client2server,compile = 0x1402b9584e0, goRoutineId=14402

这样就可以根据txn leak的go routine堆栈去找出问题的地方了

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/enhancement size/M Denotes a PR that changes [100,499] lines
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants