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

perf(mdbx): do not always collect the backtrace of a locked transaction #14123

Merged
merged 1 commit into from
Jan 31, 2025

Conversation

shekhirin
Copy link
Collaborator

This can greatly affect the performance, so instead we should only collect the backtrace if RUST_BACKTRACE=1 env variable is set.

@shekhirin shekhirin added C-perf A change motivated by improving speed, memory usage or disk footprint A-db Related to the database labels Jan 31, 2025
@shekhirin shekhirin marked this pull request as ready for review January 31, 2025 10:40
@shekhirin shekhirin requested a review from rakita as a code owner January 31, 2025 10:40
@@ -586,8 +586,9 @@ impl TransactionPtr {
tracing::debug!(
target: "libmdbx",
txn = %self.txn as usize,
backtrace = %std::backtrace::Backtrace::force_capture(),
"Transaction lock is already acquired, blocking..."
backtrace = %std::backtrace::Backtrace::capture(),
Copy link
Collaborator

Choose a reason for hiding this comment

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

this should now just be an atomic load so this is better since this path is now reachable more often

@shekhirin shekhirin added this pull request to the merge queue Jan 31, 2025
Merged via the queue into main with commit 62edaf1 Jan 31, 2025
45 checks passed
@shekhirin shekhirin deleted the alexey/mdbx-transaction-backtrace branch January 31, 2025 15:24
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 C-perf A change motivated by improving speed, memory usage or disk footprint
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants