-
Notifications
You must be signed in to change notification settings - Fork 2
Support fast unique insertion path #28
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
Conversation
bgentry
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice! While you're working on this, would you mind taking a look at bumping rexml to clear up all these dependabot & security scan alerts? https://github.com/riverqueue/riverqueue-ruby/security/dependabot
CHANGELOG.md
Outdated
|
|
||
| ### Changed | ||
|
|
||
| - Now compatible with "fast path" unique job insertion that uses a unique index instead of advisory lock and fetch [as introduced in River #451](https://github.com/riverqueue/river/pull/451). [PR #XXX](https://github.com/riverqueue/riverqueue-ruby/pull/XXX). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| - Now compatible with "fast path" unique job insertion that uses a unique index instead of advisory lock and fetch [as introduced in River #451](https://github.com/riverqueue/river/pull/451). [PR #XXX](https://github.com/riverqueue/riverqueue-ruby/pull/XXX). | |
| - Now compatible with "fast path" unique job insertion that uses a unique index instead of advisory lock and fetch [as introduced in River #451](https://github.com/riverqueue/river/pull/451). [PR #28](https://github.com/riverqueue/riverqueue-ruby/pull/28). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thx! Fixed.
| # It'd be nice to specify this as `(kind, unique_key) WHERE unique_key | ||
| # IS NOT NULL` like we do elsewhere, but in its pure ingenuity, fucking | ||
| # ActiveRecord tries to look up a unique index instead of letting | ||
| # Postgres handle that, and of course it doesn't support a `WHERE` | ||
| # clause. | ||
| unique_by: "river_job_kind_unique_key_idx" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
😂 🤦♂️
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Haha, felt a little hard done by the time I finally found something that worked.
5e0e9a2 to
eda0e4e
Compare
Yep! It's been a while since I bumped the gems in this project. Let me tackle that right after. |
eda0e4e to
6e75e81
Compare
Updates the Ruby client to be compatible with the fast unique insertion added to the main River in [1] which uses a unique index instead of advisory lock + fetch as long as uniqueness is constrained to the default set of unique job states. We also reorganize the driver tests such that the majority of the tests are put in a single set of shared examples, largely so that ActiveRecord and Sequel aren't so duplicative of each other, and so we can easily add new tests for all drivers in one place. Lastly, I killed the mock driver in use at the top level. Adding anything new required all kinds of engineering around it, and I found lots of test bugs that were the result of imperfect mocking that wasn't fully checking the client end to end. [1] riverqueue/river#451
6e75e81 to
cab6dd4
Compare
Prepare v0.7.0, containing largely the changes in #28 that add support for past path unique job insertion.
Prepare v0.7.0, containing largely the changes in #28 that add support for past path unique job insertion.
Remove a few straggler references saying that advisory locks provide uniqueness. As of #28, this is no longer true and a unique index is used instead.
Remove a few straggler references saying that advisory locks provide uniqueness. As of #28, this is no longer true and a unique index is used instead.
Updates the Ruby client to be compatible with the fast unique insertion
added to the main River in [1] which uses a unique index instead of
advisory lock + fetch as long as uniqueness is constrained to the
default set of unique job states.
We also reorganize the driver tests such that the majority of the tests
are put in a single set of shared examples, largely so that ActiveRecord
and Sequel aren't so duplicative of each other, and so we can easily add
new tests for all drivers in one place.
Lastly, I killed the mock driver in use at the top level. Adding
anything new required all kinds of engineering around it, and I found
lots of test bugs that were the result of imperfect mocking that wasn't
fully checking the client end to end.
[1] riverqueue/river#451