]> git.sur5r.net Git - openldap/commitdiff
More for ITS#5536
authorHoward Chu <hyc@openldap.org>
Thu, 29 May 2008 23:31:05 +0000 (23:31 +0000)
committerHoward Chu <hyc@openldap.org>
Thu, 29 May 2008 23:31:05 +0000 (23:31 +0000)
servers/slapd/syncrepl.c

index f4981f32e6ef53f6ae3e7494ce07227c4982b45c..747435d8b1e5609264ca8579fb66c475283c8005 100644 (file)
@@ -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;
                }