Conversation
Signed-off-by: Zhenchi <zhongzc_arch@outlook.com>
Signed-off-by: Zhenchi <zhongzc_arch@outlook.com>
|
[REVIEW NOTIFICATION] This pull request has not been approved. To complete the pull request process, please ask the reviewers in the list to review by filling The full list of commands accepted by this bot can be found here. DetailsReviewer can indicate their review by submitting an approval review. |
Signed-off-by: Zhenchi <zhongzc_arch@outlook.com>
Signed-off-by: Zhenchi <zhongzc_arch@outlook.com>
|
/cc @crazycs520 @mornyx @breeswish |
|
@zhongzc: GitHub didn't allow me to request PR reviews from the following users: mornyx. Note that only pingcap members and repo collaborators can review this PR, and authors cannot review their own PRs. DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
Signed-off-by: Zhenchi <zhongzc_arch@outlook.com>
Signed-off-by: Zhenchi <zhongzc_arch@outlook.com>
Signed-off-by: Zhenchi <zhongzc_arch@outlook.com>
Signed-off-by: Zhenchi <zhongzc_arch@outlook.com>
|
/run-unit-test |
Signed-off-by: Zhenchi <zhongzc_arch@outlook.com>
Co-authored-by: crazycs <crazycs520@gmail.com>
| goleak.IgnoreTopFunction("gopkg.in/natefinch/lumberjack%2ev2.(*Logger).millRun"), | ||
| goleak.IgnoreTopFunction("time.Sleep"), | ||
| goleak.IgnoreTopFunction("runtime/pprof.readProfile"), | ||
| goleak.IgnoreTopFunction("github.com/pingcap/tidb/util/topsql/tracecpu.(*sqlCPUProfiler).startAnalyzeProfileWorker"), |
There was a problem hiding this comment.
I don't think it may not be accepted to let this function leak.
Signed-off-by: Zhenchi <zhongzc_arch@outlook.com>
| // EnablePProfSQLCPU is true means want to keep the `sql` label. Otherwise, remove the `sql` label. | ||
| EnablePProfSQLCPU = atomic.NewBool(false) | ||
|
|
||
| // PrecisionSeconds indicates profile interval. | ||
| PrecisionSeconds = atomic.NewInt64(DefPrecisionSeconds) |
There was a problem hiding this comment.
They should be a config of sqlCPUProfiler I think, from this module's perspective.
| } | ||
| }, nil) | ||
|
|
||
| <-ctx.Done() |
There was a problem hiding this comment.
If you are waiting goroutine to finish, why not execute it in current goroutine directly?
There was a problem hiding this comment.
That spawned goroutine may block when the deadline is exceeded, in that case, this datasink should be closed.
There was a problem hiding this comment.
Got it. You can add a comment to document the reason.
| func (sp *sqlCPUProfiler) IsEnabled() bool { | ||
| return variable.TopSQLEnabled() || sp.hasExportProfileTask() | ||
| // ShouldProfile return true if it's required to profile. It exports for tests. | ||
| func (sp *sqlCPUProfiler) ShouldProfile() bool { |
There was a problem hiding this comment.
Why it is not checking the enabling state?
There was a problem hiding this comment.
Which enabling state?
|
@zhongzc: PR needs rebase. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
What problem does this PR solve?
Make the diagnostic node dependent on TiDB instead of TiDB dependent on the diagnostic node to reverse the dependency to a normal form.
Depends on: pingcap/tipb#242
Related: tikv/tikv#11087
What is changed and how it works?
Global variable
tidb_enable_top_sqldoesn't affect whether to enable topsql or not on current instance directly.Provide gRPC service
tipb.TopSQLPubSubServerModify interface
ReportClientDataSinkIsPaused,IsDown. Reporter uses them to enable/disable TopSQL.pubSubDataSinkfor connecting the reporter and external subscribersCheck List
Tests
Side effects
Release note