Comments (5)
That error occurs when all connections had a failure related to connectivity within the blacklist duration. If you weren't using makara, it would be equivalent to seeing a connection error in newrelic. Are you able to provide the full trace and a summary of your database.yml?
from makara.
Our database.yml looks like this :
adapter: 'makara_mysql2'
encoding: utf8
database: <%= ENV['RDS_DB_NAME'] %>
username: <%= ENV['RDS_USERNAME'] %>
password: <%= ENV['RDS_PASSWORD'] %>
host: <%= ENV['RDS_HOSTNAME'] %>
port: <%= ENV['RDS_PORT'] %>
pool: <%= ENV['DB_POOL'] %>
reaping_frequency: <%= ENV['REAPING_FREQUENCY'] %>
timeout: 5000
makara:
blacklist_duration: 5
master_ttl: 5
sticky: true
rescue_connection_failures: false
connections:
- role: master
host: <%= ENV['RDS_HOSTNAME'] %>
name: master-database
- role: slave
host: <%= ENV['DB_SLAVE1'] %>
name: read-slave1
weight: 5
- role: slave
host: <%= ENV['DB_SLAVE2'] %>
name: read-slave2
weight: 5
from makara.
I get the same error when I only have one connection defined in the connection list, even when the connection is valid...
eg
connections:
- role: master
host: <%= ENV['DATABASE_HOST'] %>
adapter: mysql2
<% unless ENV['DATABASE_SLAVE_HOST'].blank? %>
- role: slave
host: <%= ENV['DATABASE_SLAVE_HOST'] %>
adapter: mysql2
database: <%= ENV['DATABASE_SLAVE_DATABASE'] %>
username: <%= ENV['DATABASE_SLAVE_USERNAME'] %>
password: <%= ENV['DATABASE_SLAVE_PASSWORD'] %>
<% end %>
I wanted the slave to be optional, but it seems to fail with Makara::Errors::AllConnectionsBlacklisted unless > 1 connection is defined, is this a known issue?
from makara.
Same problem as @joelr. It would be great if Makara could behave as a "standard" adapter when there is only a master defined.
One practical example is to set up a staging environment with the same adapter as production (i.e. Makara), but with only a single DB for saving cost. This allows to test easily (except, yes, this settings does not allow to test fail-overs!).
@joelr: One dangerous workaround is to set a single machine as both master and slave. I did not check the source code yet, so please be aware this should be temporary (or confirmed as an OK workaround). A brief look at pool.rb
tells me that it should be ok, but pretty costly (e.g. each send_to_all
is executed twice by the DB, etc).
from makara.
I'm going to combine this with this one (#101) -- I think they are both saying that master is special and especially if there is only one, there is something interesting that should happen where it works like "normal" - more investigating on that that means but "merging" them.
from makara.
Related Issues (20)
- 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
- Determine programmatically what replica a request is using
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.