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

Non-deterministic updates causing problems for DB replication #219

Closed
andrewjpage opened this issue Mar 10, 2011 · 2 comments
Closed

Non-deterministic updates causing problems for DB replication #219

andrewjpage opened this issue Mar 10, 2011 · 2 comments

Comments

@andrewjpage
Copy link

We run delayed job on a MySQL server with replication.

110309 9:46:23 [Warning] Statement may not be safe to log in statement format. Statement: UPDATE delayed_jobs SET locked_at = '20
11-03-09 09:46:23', locked_by = 'delayed_job.0 host:xxxxx pid:24192' WHERE ((run_at <= '2011-03-09 09:46:23' AND (locked_at IS NULL
OR locked_at < '2011-03-09 05:46:23') OR locked_by = 'delayed_job.0 host:xxxxx pid:24192') AND failed_at IS NULL) LIMIT 1

There appears to be non-deterministic updates, and when the SQL statement above is sent to the replication slave, the slave may update a different row to that which was updated on the master. The indeterminacy is caused by the "LIMIT 1" clause, which effectively returns a random row which satisfies the WHERE clause.

@betamatt
Copy link
Collaborator

You should update to the latest version of delayed_job which removes this update.

@andrewjpage
Copy link
Author

Thanks
Andrew

On 10 March 2011 13:40, betamatt
reply@reply.github.com
wrote:

You should update to the latest version of delayed_job which removes this update.

#219 (comment)

This issue was closed.
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

No branches or pull requests

2 participants