-
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
Remove serialization of non-existing classes/objects #390
Remove serialization of non-existing classes/objects #390
Conversation
db/migrate/20190708192323_fix_unserializable_notification_options.rb
Outdated
Show resolved
Hide resolved
47e4e0f
to
5093aa6
Compare
db/migrate/20190708192323_fix_unserializable_notification_options.rb
Outdated
Show resolved
Hide resolved
db/migrate/20190708192323_fix_unserializable_notification_options.rb
Outdated
Show resolved
Hide resolved
Is this solving two distinct issues or is there some relation between the serialization issue and the subject not existing? |
Yes, there are two distinct issues. In the database I had...
|
5093aa6
to
06ff77d
Compare
Ok, @bdunne @carbonin and I discussed this:
It seems best to just clear these bad options columns instead of trying to instantiate and possibly fix them. So, now we just mark them as "Unreadable" or Removed". |
06ff77d
to
115c90a
Compare
db/migrate/20190708192323_fix_unserializable_notification_options.rb
Outdated
Show resolved
Hide resolved
115c90a
to
8c6041b
Compare
db/migrate/20190708192323_fix_unserializable_notification_options.rb
Outdated
Show resolved
Hide resolved
Rails 5.0.0 - 5.0.6 serialized internal classes that don't exist in rails 5.1+. For example, ActiveModel::Type::Text was moved to ActiveRecord so anything that serialized the raw_attributes, which contain lots of bloated information, and this class was in the raw_attributes, we would be unable to deserialize it using rails 5.1+. Additionally, if the notificiation has a subject in the options column that no longer exists, therefore we have to also remove these. See also: rails/rails#25145
8c6041b
to
217f5c9
Compare
Checked commit jrafanie@217f5c9 with ruby 2.4.6, rubocop 0.69.0, haml-lint 0.20.0, and yamllint 1.10.0 db/migrate/20190708192323_fix_unserializable_notification_options.rb
spec/migrations/20190708192323_fix_unserializable_notification_options_spec.rb
|
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.
Looks good to me
@jrafanie were you able to track down where we were creating a notification with an AR object in the |
@carbonin first one is from here (serialized classes that no longer exist): https://github.com/ManageIQ/manageiq-providers-openstack/blob/ac0b2d4283eb1e0ee98a03949416574674f16d6b/app/models/manageiq/providers/openstack/cloud_manager/vm/operations.rb#L13 second one is here (options[:subject] was removed): It's still a problem. It looks like it was added here and has never been changed. Note, the first notification (vm_destroy_success) has a subject (vm). the second one (cloud_volume_delete_success), doesn't. Note, I don't see them setting the subject association in most places. Does anyone work on openstack to fix this? I'm not sure if they're using
|
@agrare do you know who we can ping about ☝️ ? |
@agrare to summarize: We have a |
ping @aufi ^^ |
Rails 5.0.0 - 5.0.6 serialized internal classes that don't exist in rails
5.1+.
For example, ActiveModel::Type::Text was moved to ActiveRecord so
anything that serialized the raw_attributes, which contain lots of
bloated information, and this class was in the raw_attributes, we would
be unable to deserialize it using rails 5.1+.
Additionally, if the notificiation has a subject in the options column
that no longer exists, therefore we have to also remove these.
See also:
rails/rails#25145