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

feat(storage): report backtrace on long-lived transactions #5537

Merged
merged 12 commits into from
Nov 23, 2023

Conversation

shekhirin
Copy link
Collaborator

@shekhirin shekhirin commented Nov 22, 2023

As per the PR title.

It's hard to identify the source of long-lived transactions, and they bother us because they are growing freelist. So let's capture and log the full backtrace once the transaction duration reaches the threshold of 30 seconds.

@shekhirin shekhirin marked this pull request as ready for review November 23, 2023 11:46
@shekhirin shekhirin marked this pull request as draft November 23, 2023 12:00
Comment on lines 28 to 29
/// Duration after which we emit the log about long-lived database transactions.
const LONG_TRANSACTION_DURATION: Duration = Duration::from_secs(30);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we can do this, if the tx has been open for that long, the perf hit of backtrace capture is negligible imo

@shekhirin shekhirin added C-enhancement New feature or request A-db Related to the database A-observability Related to tracing, metrics, logs and other observability tools labels Nov 23, 2023
@shekhirin shekhirin marked this pull request as ready for review November 23, 2023 14:15
Copy link
Collaborator

@mattsse mattsse left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is useful and we want this, at least for now to gain more insight into what's leading to long transactions

as mentioned the perf Hit after the tx has been open for so long is negligible and worth it

@shekhirin shekhirin added this pull request to the merge queue Nov 23, 2023
Merged via the queue into main with commit e2013b8 Nov 23, 2023
27 checks passed
@shekhirin shekhirin deleted the alexey/mdbx-tx-too-long-open-tx-backtrace branch November 23, 2023 15:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-db Related to the database A-observability Related to tracing, metrics, logs and other observability tools C-enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants