diff options
-rw-r--r-- | ldap/servers/plugins/replication/repl5_ruv.c | 21 | ||||
-rw-r--r-- | ldap/servers/plugins/replication/repl5_ruv.h | 1 | ||||
-rw-r--r-- | ldap/servers/plugins/replication/windows_inc_protocol.c | 9 |
3 files changed, 30 insertions, 1 deletions
diff --git a/ldap/servers/plugins/replication/repl5_ruv.c b/ldap/servers/plugins/replication/repl5_ruv.c index effc4af2..6ece3676 100644 --- a/ldap/servers/plugins/replication/repl5_ruv.c +++ b/ldap/servers/plugins/replication/repl5_ruv.c @@ -1857,6 +1857,27 @@ PRBool ruv_has_csns(const RUV *ruv) return retval; } +PRBool ruv_has_both_csns(const RUV *ruv) +{ + PRBool retval = PR_TRUE; + CSN *mincsn = NULL; + CSN *maxcsn = NULL; + + ruv_get_min_csn(ruv, &mincsn); + ruv_get_max_csn(ruv, &maxcsn); + if (mincsn) { + csn_free(&mincsn); + csn_free(&maxcsn); + } else if (maxcsn) { + csn_free(&maxcsn); + retval = PR_FALSE; /* it has a maxcsn but no mincsn */ + } else { + retval = PR_FALSE; /* both min and max are false */ + } + + return retval; +} + /* Check if the first ruv is newer than the second one */ PRBool ruv_is_newer (Object *sruvobj, Object *cruvobj) diff --git a/ldap/servers/plugins/replication/repl5_ruv.h b/ldap/servers/plugins/replication/repl5_ruv.h index a85318b4..aa4b04db 100644 --- a/ldap/servers/plugins/replication/repl5_ruv.h +++ b/ldap/servers/plugins/replication/repl5_ruv.h @@ -112,6 +112,7 @@ int ruv_local_contains_supplier(RUV *ruv, ReplicaId rid); /* returns true if the ruv has any csns, false otherwise - used for testing whether or not an RUV is empty */ PRBool ruv_has_csns(const RUV *ruv); +PRBool ruv_has_both_csns(const RUV *ruv); PRBool ruv_is_newer (Object *sruv, Object *cruv); void ruv_force_csn_update (RUV *ruv, CSN *csn); #ifdef __cplusplus diff --git a/ldap/servers/plugins/replication/windows_inc_protocol.c b/ldap/servers/plugins/replication/windows_inc_protocol.c index b5325b92..c3a642ef 100644 --- a/ldap/servers/plugins/replication/windows_inc_protocol.c +++ b/ldap/servers/plugins/replication/windows_inc_protocol.c @@ -1632,7 +1632,14 @@ windows_examine_update_vector(Private_Repl_Protocol *prp, RUV *remote_ruv) } else { - return_value = EXAMINE_RUV_OK; + /* Check for the case where part of the RUV remote is missing */ + if (ruv_has_both_csns(remote_ruv)) + { + return_value = EXAMINE_RUV_OK; + } else + { + return_value = EXAMINE_RUV_PRISTINE_REPLICA; + } } slapi_ch_free((void**)&remote_gen); slapi_ch_free((void**)&local_gen); |