django-balancer icon indicating copy to clipboard operation
django-balancer copied to clipboard

Slave connection not present

Open sebzur opened this issue 13 years ago • 0 comments

I've found a small issue in the balancer.

I've got the following configuration:

  • Two DB servers (postgres replicated with streaming) -- let's call them master and slave
  • Three seperated instances of the same projects running on three diferent machines

And the DB connections are defined as:

  • First instance of my app is balanced over 2 DB servers
  • Second instance is connected to master DB server
  • Third instance is connected to master DB server

When ussing pinning routers it looks like the Second and Third instances are trying to use slave connection, while thre's no info about it in the settings.py I gues that this is stored somewhere with the session (I've been using PinningSessionMiddleware)... Anyway, I'm having the ConnectionDoesNotExist: The connection slave doesn't exist error.

I've switched to .WeightedMasterSlaveRouter and we'll see if the problem still occurs.

sebzur avatar Sep 30 '12 00:09 sebzur