Skip to content
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

Deprecation warning with Rails 7.1 #382

Open
jwoodrow opened this issue Nov 5, 2023 · 1 comment
Open

Deprecation warning with Rails 7.1 #382

jwoodrow opened this issue Nov 5, 2023 · 1 comment

Comments

@jwoodrow
Copy link

jwoodrow commented Nov 5, 2023

I managed to get makara working (at least it seems to be working so far) but I've got a pesky warning

DEPRECATION WARNING: new is deprecated and will be removed from Rails 7.2 (use ActiveRecord::ConnectionAdapters::SchemaReflection instead)

caused by this line lib/active_record/connection_adapters/makara_abstract_adapter.rb:193

I have no real idea how the makara magic works but I noticed there wasn't an issue opened with this problem, thanks for the hard work 🙏

Also out of curiosity, I can't seem to get automatic failover to master working in a specific case, I want to failover on ActiveRecord::RecordNotFound exception to take into account replication lag in jobs (I configured my jobs to not stick to primary so I could prioritize using the replica database as much as possible until they do a write but some jobs are enqueued right after a create to the database and for those I would like to be able to fallback to the primary database)

@jwoodrow
Copy link
Author

Did some blind digging and testing to try and remove the warning, this seems to work in place of the deprecated call

schema_reflection = ActiveRecord::ConnectionAdapters::SchemaReflection.new(nil).load!(@proxy)
@schema_cache = ActiveRecord::ConnectionAdapters::BoundSchemaReflection.new(schema_reflection, @proxy)

Wouldn't mind if someone more knowledgable could confirm if this is sufficient or not 🤔

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant