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): log tx opening location #5973

Merged
merged 4 commits into from
Jan 8, 2024
Merged

Conversation

shekhirin
Copy link
Collaborator

@shekhirin shekhirin commented Jan 8, 2024

To be able to catch the leaked transactions, we need to know their origin. Having a caller tracked up to the provider and the transaction ID should be enough.

2024-01-08T17:03:06.811863Z DEBUG storage::db::mdbx: Transaction opened caller=/Users/shekhirin/Projects/reth/crates/storage/provider/src/providers/database/mod.rs:250:14 id=305 mode=read-only
2024-01-08T17:03:06.817450Z  INFO reth::commands::node::events: Executing stage pipeline_stages=3/13 stage=Bodies checkpoint=222000 target=695895 stage_progress=31.90%
2024-01-08T17:03:06.817483Z DEBUG storage::db::mdbx: Transaction opened caller=/Users/shekhirin/Projects/reth/crates/stages/src/pipeline/mod.rs:351:53 id=306 mode=read-write
2024-01-08T17:03:07.006589Z  INFO reth::commands::node::events: pipeline_stages=3/13 stage=Bodies checkpoint=223000 target=695895 stage_progress=32.05% Stage committed progress
2024-01-08T17:03:07.020313Z DEBUG storage::db::mdbx: Transaction opened caller=/Users/shekhirin/Projects/reth/crates/storage/provider/src/providers/database/mod.rs:432:14 id=306 mode=read-only

The runtime cost of #[track_caller] should be negligible. No stack walk happens during the caller retrieval, and instead the caller is passed as an additional argument to the function. See https://rustc-dev-guide.rust-lang.org/backend/implicit-caller-location.html#generating-code-for-track_caller-callees for more information.

@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 Jan 8, 2024
@shekhirin shekhirin force-pushed the alexey/mdbx-tx-callers branch 2 times, most recently from 332069b to 904f330 Compare January 8, 2024 17:10
@shekhirin shekhirin force-pushed the alexey/mdbx-tx-callers branch from 904f330 to 6244331 Compare January 8, 2024 17:11
@shekhirin shekhirin marked this pull request as ready for review January 8, 2024 18:01
@shekhirin shekhirin requested review from mattsse and rkrasiuk January 8, 2024 18:01
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.

lgtm

Copy link
Member

@gakonst gakonst left a comment

Choose a reason for hiding this comment

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

send

@gakonst gakonst added this pull request to the merge queue Jan 8, 2024
@shekhirin shekhirin removed this pull request from the merge queue due to a manual request Jan 8, 2024
@shekhirin
Copy link
Collaborator Author

concerned about slowdown during Execution stage, I see a lot of logs about opening new read-only transactions. Investigating.

@shekhirin
Copy link
Collaborator Author

okay, false alarm, they originated in RPC requests coming from Teku

@shekhirin shekhirin added this pull request to the merge queue Jan 8, 2024
Merged via the queue into main with commit 189cf49 Jan 8, 2024
27 checks passed
@shekhirin shekhirin deleted the alexey/mdbx-tx-callers branch January 8, 2024 19:10
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.

3 participants