-
Notifications
You must be signed in to change notification settings - Fork 163
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
Fix statesman index detection #354
Fix statesman index detection #354
Conversation
Looks like the mongo tests are failing due to rails/rails#35153 (unrelated), and have been failing consistently for the past few builds. |
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.
Can we add a quick test that catches this? I can see that .sort going missing in a refactor later.
Might also be worth a small comment on the comparison that says we don't care about the index columns ordering as we only care about the uniqueness property? At first this looked wrong to me as I'm so used to index column ordering being integral to the index behaviour, but of course this doesn't matter when we just care about uniqueness.
Nice catch though!
Adding a test is a little tricky as the column name comes from the test model we use everywhere ( Good shout on the comment - added! |
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.
If it's not easy to add in a sensible way then let's get this merged. It's not like we're unclear on the nature of the issue or uncertain that this will fix it.
If you can rebase then I can merge and cut a new release?
The previous logic worked fine with parent tables that began with the letters A-S, but with tables that started with the letters T-Z, the comparison would fail, which ultimately resulted in the RecordNotUnique exception not being converted to a TransitionConflictError. Among other things, this prevents `retry_conflicts` from working.
4e0bf27
to
5a6a9b4
Compare
Thanks 🙌 Just rebased and pushed. |
This should now be released in v4.1.1 |
Thanks Lawrence! |
The previous logic worked fine with parent tables that (approximately) began with the letters A-S, but with tables that (approximately) started with the letters T-Z, the comparison would fail, which ultimately resulted in the
RecordNotUnique
exception not being converted to aTransitionConflictError
. Among other things, this preventsretry_conflicts
from working.