Comments (7)
This is probably surprising behavior but intentional, at least in PG. The issue is the PG adapter calls connect upon instantiation. Since the instantiation of this connection takes place when the adapter is filling the master / slave pools the error is raised early. When the error is raised I do not put the connection in the pool. This means in this scenario you're dealing with 1 master and 0 slaves. So all connections are blacklisted anytime you try to do anything.
I'm thinking the right thing to do is go ahead and place the connection in the pool, but then immediately blacklist it. Thoughts?
from makara.
Yes, that is the desired behavior. Put all database.yml
connections in the pool and let makara manage them based on availability.
from makara.
Ah, now I remember going down this road. So the issue is connect() is called from within initialize(). So the object is never returned. You can do Class.allocate but that means the pg makara adapter would have to deal with different configurations and different constructors from different ActiveRecord versions since it would essentially redefine ::ActiveRecord::Base.postgresql_connection().
from makara.
Another possible option is to delay the instantiation by creating an empty wrapper. Then the connection would be instantiated on demand. I'll investigate that as a solution.
from makara.
Ok, here's my first attempt. #35
from makara.
Is there any way to log/see makara activity? eg: add, blacklist, errors
from makara.
Not currently, I'm a bit busy today but will try to add logging tonight.
from makara.
Related Issues (20)
- Blacklist is an exclusionary term
- SSL on mysql2_makara adapter
- Assets precompilation fails when unable to connect with database HOT 1
- Best approach for handling master-slave replication? HOT 1
- In development: makara hides the query logs references HOT 1
- ActiveRecord::Base.connection.select raises TypeError with makara-0.5.1 HOT 1
- No CHANGELOG entry for 0.5.1 HOT 5
- rake db:migrate not running HOT 1
- How to send a read query to master explicitly?
- How to send a read query to master explicitly? HOT 1
- Override master db selection method not working HOT 2
- Deprecation warning for Ruby 3 HOT 3
- Proxied control methods generated do not respect arity HOT 7
- It should be `:replica` instead of `:primary` HOT 2
- Deprecation warning for Ruby3 HOT 2
- Registering Types not working?
- Choosing Primary instead of Replica when using 'with' (because of newlines)
- When blacklist is disabled, gracefully error handling causes infinite retries.
- Deprecation warning with Rails 7.1 HOT 1
- Makara latest + ruby 3: `NoMethodError: undefined method 'provide' for nil:NilClass` HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from makara.