Skip to content

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.

3 participants