secondary.c (225832) | secondary.c (226842) |
---|---|
1/*- 2 * Copyright (c) 2009-2010 The FreeBSD Foundation 3 * Copyright (c) 2010 Pawel Jakub Dawidek <pjd@FreeBSD.org> 4 * All rights reserved. 5 * 6 * This software was developed by Pawel Jakub Dawidek under sponsorship from 7 * the FreeBSD Foundation. 8 * --- 15 unchanged lines hidden (view full) --- 24 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 25 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 26 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 27 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 28 * SUCH DAMAGE. 29 */ 30 31#include <sys/cdefs.h> | 1/*- 2 * Copyright (c) 2009-2010 The FreeBSD Foundation 3 * Copyright (c) 2010 Pawel Jakub Dawidek <pjd@FreeBSD.org> 4 * All rights reserved. 5 * 6 * This software was developed by Pawel Jakub Dawidek under sponsorship from 7 * the FreeBSD Foundation. 8 * --- 15 unchanged lines hidden (view full) --- 24 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 25 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 26 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 27 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 28 * SUCH DAMAGE. 29 */ 30 31#include <sys/cdefs.h> |
32__FBSDID("$FreeBSD: head/sbin/hastd/secondary.c 225832 2011-09-28 13:19:47Z pjd $"); | 32__FBSDID("$FreeBSD: head/sbin/hastd/secondary.c 226842 2011-10-27 16:22:17Z pjd $"); |
33 34#include <sys/param.h> 35#include <sys/time.h> 36#include <sys/bio.h> 37#include <sys/disk.h> 38#include <sys/stat.h> 39 40#include <err.h> --- 234 unchanged lines hidden (view full) --- 275 nv_add_string(nvout, errmsg, "errmsg"); 276 if (hast_proto_send(res, res->hr_remotein, nvout, NULL, 0) < 0) { 277 pjdlog_exit(EX_TEMPFAIL, "Unable to send response to %s", 278 res->hr_remoteaddr); 279 } 280 nv_free(nvout); 281 exit(EX_CONFIG); 282 } else if ( | 33 34#include <sys/param.h> 35#include <sys/time.h> 36#include <sys/bio.h> 37#include <sys/disk.h> 38#include <sys/stat.h> 39 40#include <err.h> --- 234 unchanged lines hidden (view full) --- 275 nv_add_string(nvout, errmsg, "errmsg"); 276 if (hast_proto_send(res, res->hr_remotein, nvout, NULL, 0) < 0) { 277 pjdlog_exit(EX_TEMPFAIL, "Unable to send response to %s", 278 res->hr_remoteaddr); 279 } 280 nv_free(nvout); 281 exit(EX_CONFIG); 282 } else if ( |
283 /* Is primary is out-of-date? */ | 283 /* Is primary out-of-date? */ |
284 (res->hr_secondary_localcnt > res->hr_primary_remotecnt && 285 res->hr_secondary_remotecnt == res->hr_primary_localcnt) || | 284 (res->hr_secondary_localcnt > res->hr_primary_remotecnt && 285 res->hr_secondary_remotecnt == res->hr_primary_localcnt) || |
286 /* Nodes are more or less in sync? */ | 286 /* Are the nodes more or less in sync? */ |
287 (res->hr_secondary_localcnt == res->hr_primary_remotecnt && 288 res->hr_secondary_remotecnt == res->hr_primary_localcnt) || | 287 (res->hr_secondary_localcnt == res->hr_primary_remotecnt && 288 res->hr_secondary_remotecnt == res->hr_primary_localcnt) || |
289 /* Is secondary is out-of-date? */ | 289 /* Is secondary out-of-date? */ |
290 (res->hr_secondary_localcnt == res->hr_primary_remotecnt && 291 res->hr_secondary_remotecnt < res->hr_primary_localcnt)) { 292 /* 293 * Nodes are more or less in sync or one of the nodes is 294 * out-of-date. 295 * It doesn't matter at this point which one, we just have to 296 * send out local bitmap to the remote node. 297 */ --- 526 unchanged lines hidden --- | 290 (res->hr_secondary_localcnt == res->hr_primary_remotecnt && 291 res->hr_secondary_remotecnt < res->hr_primary_localcnt)) { 292 /* 293 * Nodes are more or less in sync or one of the nodes is 294 * out-of-date. 295 * It doesn't matter at this point which one, we just have to 296 * send out local bitmap to the remote node. 297 */ --- 526 unchanged lines hidden --- |