From 4b2c0039073c8de40d7644650ddc92054f17ed33 Mon Sep 17 00:00:00 2001 From: Howard Chu Date: Thu, 29 May 2008 23:31:05 +0000 Subject: [PATCH] More for ITS#5536 --- servers/slapd/syncrepl.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/servers/slapd/syncrepl.c b/servers/slapd/syncrepl.c index f4981f32e6..747435d8b1 100644 --- a/servers/slapd/syncrepl.c +++ b/servers/slapd/syncrepl.c @@ -582,8 +582,8 @@ do_syncrep1( si->si_syncCookie.rid = si->si_rid; /* whenever there are multiple data sources possible, advertise sid */ - si->si_syncCookie.sid = ( SLAP_MULTIMASTER( si->si_be ) || SLAP_GLUE_SUBORDINATE( si->si_be ) || - SLAP_GLUE_INSTANCE( si->si_be )) ? slap_serverID : -1; + si->si_syncCookie.sid = ( SLAP_MULTIMASTER( si->si_be ) || si->si_be != si->si_wbe ) ? + slap_serverID : -1; /* We've just started up, or the remote server hasn't sent us * any meaningful state. @@ -1242,7 +1242,8 @@ do_syncrepl( * * Typically there is a single syncprov mastering the entire * glued tree. In that case, our contextCSN updates should - * go to the master DB. + * go to the master DB. But if there is no syncprov on the + * master DB, then nothing special is needed here. * * Alternatively, there may be individual syncprov overlays * on each glued branch. In that case, each syncprov only @@ -1251,7 +1252,11 @@ do_syncrepl( */ if ( !si->si_wbe ) { if ( SLAP_GLUE_SUBORDINATE( be ) && !overlay_is_inst( be, "syncprov" )) { - si->si_wbe = select_backend( &be->be_nsuffix[0], 1 ); + BackendDB * top_be = select_backend( &be->be_nsuffix[0], 1 ); + if ( overlay_is_inst( top_be, "syncprov" )) + si->si_wbe = select_backend( &be->be_nsuffix[0], 1 ); + else + si->si_wbe = be; } else { si->si_wbe = be; } -- 2.39.5