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

Remove get lock 2 - rebased and extended a bit. #7

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

demerphq
Copy link
Owner

@demerphq demerphq commented Nov 1, 2017

A rebased version of #5

demerphq and others added 4 commits November 1, 2017 21:37
get_lock() changes behaviour in MySQL 5.7, which causes in turn causes
workers to lock more rows than necessary.

This patch changes the behavior of Data::Consumer::MySQL2 to claim rows
by doing SELECT followed by UPDATE, instead of two SELECTs (second
select was necessary to validate result of GET_LOCK() since it wasn't
atomic, and was a major change from Data::Consumer::MySQL).

SELECT followed by UPDATE allows two claim strategies to be implemented,
both relying on implicit database locks: atomic CAS (used by default)
and SELECT FOR UPDATE.
Avoids stepping into a perl bug where fatal warning in a destructor causes infinite recursion somewhere in perl guts (seems to be fixed in modern versions).
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.

2 participants