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

More trace logs for TX locking #1253

Merged
merged 3 commits into from
Jun 3, 2024
Merged

More trace logs for TX locking #1253

merged 3 commits into from
Jun 3, 2024

Conversation

bfops
Copy link
Contributor

@bfops bfops commented May 18, 2024

Description of Changes

Some small changes to make the trace logs more consistent for tx locks.

API and ABI breaking changes

Nope

Expected complexity level and risk

1

Testing

This is a holdover from a debugging session. It was tested-by-fire.

let res = f(&mut tx);
self.inner.release_tx(ctx, tx);
self.release_tx(ctx, tx);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

these are so we get the log messages consistently

@@ -125,7 +125,7 @@ impl SubscriptionManager {
let tables = &event.status.database_update().unwrap().tables;
let slow = db.read_config().slow_query;
let tx = scopeguard::guard(db.begin_tx(), |tx| {
tx.release(&ExecutionContext::incremental_update(db.address(), slow));
db.release_tx(&ExecutionContext::incremental_update(db.address(), slow), tx);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

so we get the log messages consistently

@@ -300,7 +304,7 @@ impl RelationalDB {

#[tracing::instrument(skip_all)]
pub fn release_tx(&self, ctx: &ExecutionContext, tx: Tx) {
log::trace!("ROLLBACK TX");
log::trace!("RELEASE TX");
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think this was a typo?

}

#[tracing::instrument(skip_all)]
pub fn begin_tx(&self) -> Tx {
log::trace!("BEGIN TX");
self.inner.begin_tx()
let r = self.inner.begin_tx();
log::trace!("ACQUIRED TX");
Copy link
Contributor Author

Choose a reason for hiding this comment

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

when we were debugging lock issues, we appreciated not only having a "trying to acquire lock" message but also a "I am now holding the lock" message.

@bfops bfops changed the title Bfops/logtrace More trace logs for TX locking Jun 3, 2024
@bfops bfops marked this pull request as ready for review June 3, 2024 16:06
@bfops bfops requested a review from cloutiertyler June 3, 2024 16:09
Copy link
Contributor

@mamcx mamcx left a comment

Choose a reason for hiding this comment

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

LGTM

@bfops bfops added this pull request to the merge queue Jun 3, 2024
Copy link
Contributor

@cloutiertyler cloutiertyler left a comment

Choose a reason for hiding this comment

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

LGTM

Merged via the queue into master with commit 2b66851 Jun 3, 2024
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants