Masato Taruishi
taru****@users*****
2004年 11月 2日 (火) 12:31:41 JST
=================================================================== RCS file: plugin/slapd/upstream/syncbackup-2.2.18.patch,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- plugin/slapd/upstream/syncbackup-2.2.18.patch 2004/11/01 13:41:00 1.3 +++ plugin/slapd/upstream/syncbackup-2.2.18.patch 2004/11/02 03:31:41 1.4 @@ -1398,7 +1398,7 @@ RCS file: openldap-2.2.18/servers/slapd/startsync.c diff -N openldap-2.2.18/servers/slapd/startsync.c --- /dev/null 1 Jan 1970 00:00:00 -0000 -+++ openldap-2.2.18/servers/slapd/startsync.c 30 Oct 2004 19:20:19 -0000 1.2 ++++ openldap-2.2.18/servers/slapd/startsync.c 2 Nov 2004 01:26:44 -0000 1.3 @@ -0,0 +1,345 @@ +/* $OpenLDAP:$ */ +/* @@ -1651,7 +1651,7 @@ + */ + rc = SLAPD_ABANDON; + -+ break; ++ goto done; + + case SLAPD_ATTACH_NOCOOKIE: +#ifdef NEW_LOGGING @@ -1750,8 +1750,8 @@ RCS file: openldap-2.2.18/servers/slapd/syncbackup.c diff -N openldap-2.2.18/servers/slapd/syncbackup.c --- /dev/null 1 Jan 1970 00:00:00 -0000 -+++ openldap-2.2.18/servers/slapd/syncbackup.c 1 Nov 2004 13:24:02 -0000 1.2 -@@ -0,0 +1,2789 @@ ++++ openldap-2.2.18/servers/slapd/syncbackup.c 2 Nov 2004 01:26:44 -0000 1.3 +@@ -0,0 +1,2791 @@ +/* $OpenLDAP:$ */ +/* + * Synchronized Backup Engine @@ -2327,10 +2327,12 @@ + Debug ( LDAP_DEBUG_TRACE, "attach %s success\n", info->sb_backups[id]->syncid, 0, 0); +#endif + ++#ifndef NO_THREADS + ldap_pvt_thread_mutex_lock( &info->follow_mutex ); + if ( ldap_pvt_thread_pool_backload( &info->follow_pool ) == 0 ) + ldap_pvt_thread_pool_submit( &info->follow_pool, follow, be ); + ldap_pvt_thread_mutex_unlock( &info->follow_mutex ); ++#endif + + return LDAP_SUCCESS; + @@ -4545,11 +4547,35 @@ =================================================================== RCS file: /cvsroot/openldap-ha/build-tree/openldap-2.2.18/servers/slapd/syncrepl.c,v retrieving revision 1.1.1.1 -retrieving revision 1.2 -diff -u -r1.1.1.1 -r1.2 +retrieving revision 1.3 +diff -u -r1.1.1.1 -r1.3 --- openldap-2.2.18/servers/slapd/syncrepl.c 26 Oct 2004 10:15:10 -0000 1.1.1.1 -+++ openldap-2.2.18/servers/slapd/syncrepl.c 26 Oct 2004 10:26:09 -0000 1.2 -@@ -303,7 +303,10 @@ ++++ openldap-2.2.18/servers/slapd/syncrepl.c 2 Nov 2004 01:26:44 -0000 1.3 +@@ -241,6 +241,11 @@ + si->si_tls == SYNCINFO_TLS_CRITICAL ? "Error" : "Warning", + rc, 0 ); + #endif ++#ifdef LDAP_SYNCBACKUP ++ if ( si->si_replType == SYNC_BOOTSYNC ) ++ goto get_cookie; ++#endif ++ + if( si->si_tls == SYNCINFO_TLS_CRITICAL ) goto done; + } + } +@@ -263,6 +268,11 @@ + "(%s,SECPROPS,\"%s\") failed!\n", + si->si_provideruri, si->si_secprops, 0 ); + #endif ++#ifdef LDAP_SYNCBACKUP ++ if ( si->si_replType == SYNC_BOOTSYNC ) ++ goto get_cookie; ++#endif ++ + goto done; + } + } +@@ -303,7 +313,10 @@ { rc = LDAP_SERVER_DOWN; } @@ -4561,7 +4587,7 @@ goto done; } #else /* HAVE_CYRUS_SASL */ -@@ -323,6 +326,10 @@ +@@ -323,6 +336,10 @@ Debug( LDAP_DEBUG_ANY, "do_syncrep1: " "ldap_bind_s failed (%d)\n", rc, 0, 0 ); #endif @@ -4572,7 +4598,7 @@ goto done; } } -@@ -343,7 +350,9 @@ +@@ -343,7 +360,9 @@ ? op->o_sasl_ssf : op->o_tls_ssf; /* get syncrepl cookie of shadow replica from subentry */ @@ -4583,7 +4609,7 @@ assert( si->si_rid < 1000 ); syncrepl_cn_bv.bv_val = syncrepl_cbuf; syncrepl_cn_bv.bv_len = snprintf(syncrepl_cbuf, sizeof(syncrepl_cbuf), -@@ -431,6 +440,88 @@ +@@ -431,6 +450,88 @@ } } @@ -4672,7 +4698,7 @@ rc = ldap_sync_search( si, op->o_tmpmemctx ); if( rc != LDAP_SUCCESS ) { -@@ -642,6 +733,12 @@ +@@ -642,6 +743,12 @@ si->si_presentlist = NULL; } } @@ -4685,7 +4711,7 @@ rc = -2; goto done; break; -@@ -852,7 +949,7 @@ +@@ -852,7 +959,7 @@ default: return NULL; } @@ -4694,7 +4720,7 @@ if ( slapd_shutdown && si->si_ld ) { ldap_get_option( si->si_ld, LDAP_OPT_DESC, &s ); connection_client_stop( s ); -@@ -860,7 +957,7 @@ +@@ -860,7 +967,7 @@ si->si_ld = NULL; return NULL; } @@ -4703,7 +4729,7 @@ connection_fake_init( &conn, &op, ctx ); /* use global malloc for now */ -@@ -891,7 +988,20 @@ +@@ -891,7 +998,20 @@ if ( rc == LDAP_SUCCESS ) { ldap_get_option( si->si_ld, LDAP_OPT_DESC, &s ); @@ -4724,7 +4750,7 @@ if ( abs(si->si_type) == LDAP_SYNC_REFRESH_AND_PERSIST ) { /* If we succeeded, enable the connection for further listening. -@@ -906,11 +1016,43 @@ +@@ -906,11 +1026,43 @@ } else if ( !first ) { dostop = 1; } @@ -4759,16 +4785,16 @@ + "init_cookie: %s\n", be->syncbackupinfo->init_cookie->bv_val, 0, 0); +#endif + } - -+ slap_sync_cookie_free( &si->si_syncCookie, 0 ); + ++ slap_sync_cookie_free( &si->si_syncCookie, 0 ); + + return NULL; + } +#endif /* At this point, we have 4 cases: * 1) for any hard failure, give up and remove this task * 2) for ServerDown, reschedule this task to run -@@ -1779,6 +1921,13 @@ +@@ -1779,6 +1931,13 @@ mlnext = mod; op->o_tag = LDAP_REQ_ADD; @@ -4782,7 +4808,7 @@ rc = slap_mods_opattrs( op, modlist, modtail, &text, txtbuf, textlen, 0 ); -@@ -1905,6 +2054,15 @@ +@@ -1905,6 +2064,15 @@ mlnext->sml_next = NULL; }