You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We've just rolled out Makara on Rails 7.1, unfortunately it appears broken with all requests going to the primary server.
Raising in case any one else plans on rolling out. If anyone else has experienced the same and has a fix please do let me know 👍
Updates
If acting on the base connection everything seems to work ok:
irb(main):001> ActiveRecord::Base.connection.execute('select 1').to_a[replica/1](24.7ms)select1=>[[1]]irb(main):002> ActiveRecord::Base.connection.execute('update users set first_name= upper(first_name) where id = 1').to_a[primary/1](7.3ms)updateuserssetfirst_name=upper(first_name)whereid=1=>[]irb(main):003> ActiveRecord::Base.connection.execute('select 1').to_a[primary/1](1.6ms)select1=>[[1]]irb(main):004> Makara::Context.release_all=>{}irb(main):005> ActiveRecord::Base.connection.execute('select 1').to_a[replica/1](2.3ms)select1=>[[1]]
It only when working with models that issues occur...
irb(main):009> User.first[primary/1]UserLoad(3.1ms)SELECT`users`.`id`, `users`.`first_name` FROM `users` WHERE `users`.`deleted_at` IS NULL ORDER BY `users`.`id` ASC LIMIT 1=> #<User id: 1, first_name: "TOM">irb(main):010> User.first.update(first_name: 'Test') [primary/1] User Load (1.6ms) SELECT `users`.`id`, `users`.`first_name` FROM `users` WHERE `users`.`deleted_at` IS NULL ORDER BY `users`.`id` ASC LIMIT 1 [primary/1] TRANSACTION (0.7ms) BEGIN [primary/1] User Update (0.9ms) UPDATE `users` SET `users`.`first_name` = 'Test', `users`.`updated_at` = '2024-03-20 17:43:24' WHERE `users`.`id` = 1 [primary/1] TRANSACTION (2.7ms) COMMIT=> trueirb(main):011> User.first [primary/1] User Load (2.8ms) SELECT `users`.`id`, `users`.`first_name` FROM `users` WHERE `users`.`deleted_at` IS NULL ORDER BY `users`.`id` ASC LIMIT 1=> #<User id: 1, first_name: "Test">irb(main):012> Makara::Context.release_all=> {}irb(main):013> User.first [primary/1] User Load (3.0ms) SELECT `users`.`id`, `users`.`first_name` FROM `users` WHERE `users`.`deleted_at` IS NULL ORDER BY `users`.`id` ASCLIMIT1=>#<User id: 1, first_name: "Test">
The text was updated successfully, but these errors were encountered:
We've just rolled out Makara on Rails 7.1, unfortunately it appears broken with all requests going to the primary server.
Raising in case any one else plans on rolling out. If anyone else has experienced the same and has a fix please do let me know 👍
Updates
If acting on the base connection everything seems to work ok:
It only when working with models that issues occur...
The text was updated successfully, but these errors were encountered: