slony

Ruby On Rails Master-Slave Postrgres Databases

I am currently setting up a master-slave app using Ruby on Rails that needs to have a Master-Slave backend. I'm currently looking at using Slony for the replication component, and Masochism for handling the read/write connections to the different DBs. This is my first time setting up master-slave DBs with Ruby on Rails, and these are t...

ActiveRecord counter_cache giving stale count with multi_db gem

I'm using the multi-db gem with Slony-I replication on PostgreSQL in a Rails app. This mostly works perfectly, but there is a bit of a replication lag in certain cases. One of the cases involves an ActiveRecord counter_cache. For clarity, assume the following two models: class Post < ActiveRecord::Base has_many :comments ... end c...

Postgres Slony-I question

Sample slonik command on the 1st node: slonik <<_EOF_ #-- # define the namespace the replication system uses in our example it is # slony_example #-- cluster name = $CLUSTERNAME; #-- # admin conninfo's are used by slonik to connect to the nodes one for each # node on each side of the cluster, the syntax is that of PQconnectdb in # the ...

PostgreSQL - Slony > FATAL ERROR: duplicate key value violates unique constraint "sl_nodelock-pkey"

Just posting this here and might help the others: I got this error when we had an outage a while ago, and tried to restart the slon replication service as the replication is NOT really replicating the data from MASTER to SLAVE: FATAL localListenThread: "select "_MY_DATABASE_copy".cleanupNodelock(); insert into "_MY_DATABASE_copy".sl_n...