You're missing something obvious: it is the frontend that returns a
referral when a client writes to the slave, so you need to place the
slapo-chain __before__ any database instantiation, thus making it
global, which means stacked on top of the frontend.