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

How to deal with lock conflict properly? #10

Open
raywill opened this issue Apr 25, 2016 · 2 comments
Open

How to deal with lock conflict properly? #10

raywill opened this issue Apr 25, 2016 · 2 comments
Assignees

Comments

@raywill
Copy link

raywill commented Apr 25, 2016

For example:

select for update would lock up several rows. This could block other threads writing on these rows.

@raywill raywill changed the title How to deal with lock contention properly? How to deal with lock conflict properly? Apr 25, 2016
@abychko
Copy link
Contributor

abychko commented May 9, 2016

maybe @RoelVdP can answer? I think it's a logic inside mysql library, nothing specific to pquery itself

@RoelVdP
Copy link
Contributor

RoelVdP commented May 9, 2016

@raywill good question. Most of the testing we do is single threaded. My general finding over the years is that 85-95% (leaning towards the higher end) of all issues can be found/reproduced using a single thread. Still, the question is valid for multi-threaded testing where locking happens. One idea, but more from a "workaround" perspective would be to - for example where mysqld locks up - grab a gdb snapshot of what's happening in server at that moment. You may also find https://github.com/yoshinorim/quickstack of interest. As for actually intelligently handling these locking situation, needs more thinking/research. From memory, mysql generally relies on developers retrying failed trx.

@RoelVdP RoelVdP self-assigned this Feb 17, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants