-
-
Notifications
You must be signed in to change notification settings - Fork 6.8k
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
Enable Rails 7.1 Marshalling format #28609
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #28609 +/- ##
==========================================
- Coverage 84.78% 84.75% -0.03%
==========================================
Files 1039 1039
Lines 28259 28175 -84
Branches 4560 4548 -12
==========================================
- Hits 23960 23881 -79
+ Misses 3139 3136 -3
+ Partials 1160 1158 -2 ☔ View full report in Codecov by Sentry. |
This replace the workaround added in mastodon#24142 and also fixes mastodon#27622 so mastodon#28521 can be reverted. That new format isn't backward compatible, so normally you are supposed to deploy Rails 7.1 without that new format enabled first, but this can be sidestepped by invalidating old cache entries, which this PR does by changing the cache prefix.
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 fine to me. One downside is that it'll leave old keys in the cache, but most should only persist for 10 minutes, some persist for up to 1 day, and a handful for up to a week.
I also wonder if we shouldn't take the opportunity to use MessagePack?
I guess it depends how the Redis is configured. By default the |
1d455cc
to
9e6187f
Compare
Referencing `ActiveRecord::Base` as soon as the gem is required cause Active Record being loaded earlier than it should and some Rails configurations not to take effect. Ref: rails/rails#49827 Ref: mastodon/mastodon#28609
Referencing `ActiveRecord::Base` as soon as the gem is required cause Active Record being loaded earlier than it should and some Rails configurations not to take effect. Ref: rails/rails#49827 Ref: mastodon/mastodon#28609
806fd22
to
9e6187f
Compare
As mentioned, I added the workaround back, so this can ship. I'll see about cleaning up the settings gem if I find the time. |
Looks good to me. I think I prefer to have the config set directly in Likewise, I think it would be a good thing to find and fix the places where ActiveRecord is initialized early, but that can be done separately, and you've given us plenty of information about how to find those cases! Thanks again |
9e6187f
to
f1394ed
Compare
I've amended my commit to do that. |
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. Yay for removing ugly hacks.
This will cause empty caches in many places when deploying this commit, but I think we did it before and did not see really bad performance following it.
I also wonder if we shouldn't take the opportunity to use MessagePack?
This is probably a good idea, probably using the paquito
gem? But this should probably be in another PR, as I expect we will have some additional work to do to ensure all our shapes are serialisable.
This replace the workaround added in #24142 and also fixes #27622 so #28521 can be reverted.
That new format isn't backward compatible, so normally you are supposed to deploy Rails 7.1 without that new format enabled first, but this can be sidestepped by invalidating old cache entries, which this PR does by changing the cache prefix.
cc @ClearlyClaire @Gargron