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

txn: record long running transaction and session information for diagnosis #41471

Closed
cfzjywxk opened this issue Feb 16, 2023 · 0 comments · Fixed by #44248
Closed

txn: record long running transaction and session information for diagnosis #41471

cfzjywxk opened this issue Feb 16, 2023 · 0 comments · Fixed by #44248
Assignees
Labels
sig/transaction SIG:Transaction type/enhancement The issue or PR belongs to an enhancement.

Comments

@cfzjywxk
Copy link
Contributor

cfzjywxk commented Feb 16, 2023

Enhancement

The safepoint calculation is the first step for garbage collection in TiDB, data older than the safepoint could be safely reclaimed. The safepoint must be less than the global minimal start_ts among all the tidb sessions, so a session with long-running transactions may block the advancement of safepoint. For example, if the user starts a transaction but never commits, the safepoint could not be pushed and data reclamation is blocked. To make the diagnosis of such issues easier, consider the following improvements in TiDB:

  1. Record the long-running transaction and session information in the expensive logs. If the safepoint is blocked by some ongoing sessions, the start_ts could be used to locate the blocking session.
  2. Record ongoing transaction duration in the metrics with a certain flushing interval, so the long-running transitions could be viewed directly on the grafana panels.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
sig/transaction SIG:Transaction type/enhancement The issue or PR belongs to an enhancement.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants