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

log_innodb_status is not safe #5

Merged
merged 4 commits into from
May 13, 2011
Merged

log_innodb_status is not safe #5

merged 4 commits into from
May 13, 2011

Conversation

osheroff
Copy link

Hi,
(btw, this is the issue Simon Winstow was talking about)
I don't know if you'd want to use this code or work out another fix, but deadlock_retry can actually quite dangerous in a limited set of circumstances, due to the attempt to execute "SHOW INNODB STATUS". Here's what happens:

  • transaction deadlocks
  • call to log_innodb_status is made
  • SHOW INNODB STATUS command fails, for a variety of reasons -- including that the user doesn't have permission to execute this command.
  • the "rescue Exception" block kicks in, but mysql has already silently rolled-back our transaction because of the error in SHOW INNODB STATUS.
  • the transaction continues, but is fundamentally broken and we've silently lost data.

Ben Osheroff and Simon Wistow added 3 commits May 12, 2011 11:10
@mperham
Copy link
Owner

mperham commented May 13, 2011

I suggest you try to run the command at startup and en/disable based on whether it works. This way the user need do nothing to get the logging if permissions are ok. don't clutter up the code with configuration; just print out a warning if perms are wrong.

@osheroff
Copy link
Author

Ok, try that on for size -- before we run the first transaction we're asked to run we'll check and see if "show innodb status" crashes.

@osheroff osheroff closed this May 13, 2011
@osheroff osheroff reopened this May 13, 2011
mperham added a commit that referenced this pull request May 13, 2011
log_innodb_status is not safe
@mperham mperham merged commit ddb62b5 into mperham:master May 13, 2011
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

2 participants