-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
mxq_job: Select job to run without locking
When the server chose a job to assign to itself by UPDATE mxq_job SET ... WHERE (unassigned) ORDER BY LIMIT 1 we had a performance problem when a group contained very many pending jobs, because the UPDATE temporarily locked all records considered (issue #51). Now we SELECT without any lock and then UPDATE the single job by its primary index. In case there is a collision with another server, the second UPDATE will have no effect, because it still contains the original contraints. The second server will returns to its main loop where it will sleep for some seconds.
- Loading branch information
Showing
1 changed file
with
55 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters