-
Notifications
You must be signed in to change notification settings - Fork 125
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
Migrate EmsRefresh.refresh queue args to data #107
Migrate EmsRefresh.refresh queue args to data #107
Conversation
ad9ca52
to
5255386
Compare
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.
Awesome! 👍
As discussed, since Marshal.dump/load is not guaranteed to work across Ruby versions, we should bracket this around upgrades and just delete rows that can't be Marshaled (which if one fails they all will likely fail). We may want to be resilient on the MiqQueue side as well...not sure we ever caught that error there. |
a20e837
to
cdede24
Compare
@Fryguy added tests with msg_data containing an empty array with marshal format version |
cdede24
to
2dfc78f
Compare
end | ||
|
||
it "Handle invalid marshal format errors" do | ||
# "\x03\x00\x00" is an empty array in Marshal version 3.0 |
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.
Is there a version of this for the up migration?
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.
I wasn't sure how to test Marshal.dump
failing due to a version issue, ideas?
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.
Let me try putting an anonymous class in the args, that should do it.
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.
Scratch that, that won't even serializing the value to args
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.
Oh I see...it's only the load part that fails. 👍
Checked commit agrare@2dfc78f with ruby 2.3.3, rubocop 0.47.1, and haml-lint 0.20.0 db/migrate/20171025122732_move_ems_refresh_args_to_data.rb
spec/migrations/20171025122732_move_ems_refresh_args_to_data_spec.rb
|
Move existing EmsRefresh.refresh queue args to data for performance.
Related to: ManageIQ/manageiq#16271