[Date Prev][Date Next] [Chronological] [Thread] [Top]

RE: overlay and failover



> The current approach means, of course, that you should not call a
> function that will wind up re-invoking the current overlay function,
> otherwise it will loop until the stack overflows.

The problem is much simpler and trickier: if I try to send
a result, the over_back_response() casts a BackendInfo *, which
is really pointing to a slap_overinst *, into a slap_overinfo *
and dies because what it pretends to be a list of slap_overinst *
is actually bogus.  I see a few approaches:

1) return a specific error code (e.g. SLAP_CB_FAILOVER) which
instructs over_op_func() to issue the error
2) rearrange slap_overinfo so that it actually is a slap_overinst
plus the BackendInfo data structure so that either cast succeeds
3) as you said, when calling a result function from inside
an overlay, restore the correct op->o_bd->bd_info field, relying
on the fact that if I'm inside an overlay function I can do it
safely :)

With option 3 my rwm overlay works like a charm
also when an error occurs :)

I'll commit something very soon.

Ando.

-- 
Pierangelo Masarati
mailto:pierangelo.masarati@sys-net.it


-- 
Pierangelo Masarati
mailto:pierangelo.masarati@sys-net.it