← Back to team overview

launchpad-dev team mailing list archive

Re: Connections left open after switching to read only mode

 

On Fri, 2010-05-21 at 16:49 -0400, Gary Poster wrote:
> On May 8, 2010, at 8:34 AM, Stuart Bishop wrote:
> 
> > On Fri, May 7, 2010 at 8:28 PM, Guilherme Salgado <salgado@xxxxxxxxxxxxx> wrote:
> > 
> >> The latter should work as long as the ROMDP returns the romode store
> >> (pointing to the standalone DB) rather than the regular slave one as it
> >> currently does.  The ROMDP is already installed by beforeTraversal() (so
> >> we'll still be able to switch the web app to read-only without
> >> restarting) but as you said we'll need to install that policy on
> >> startup, for things like the librarian.
> >> 
> >> We also need to make sure that all DatabasePolicies can detect a mode
> >> change and close the stores used by the previous mode, so that we don't
> >> leave open connections behind.
> > 
> > Hmm... yeah. All the DatabasePolicies would need to know about RO
> > mode, which sucks. Instead, we could just do this in the
> > IStoreSelector - if read-only mode is detected, ignore any installed
> > DatabasePolicy and return the read-only Stores.
> 
> Salgado, the thread stopped pretty soon after this suggestion.  Does this sound like a reasonable plan of attack to you?  If so, maybe I could have a quick call with you next week to make sure I understand what Foundations needs to do.
> 

It sounds sane, although I don't quite remember how the StoreSelector
works (and more importantly, if everything uses it).  I think we just
need to make sure there's no code used by the app servers that might
bypass the StoreSelector, also teaching the store selector to detect a
mode change and close the stores used in the previous mode.

-- 
Guilherme Salgado <https://launchpad.net/~salgado>

Attachment: signature.asc
Description: This is a digitally signed message part


References