summaryrefslogtreecommitdiffstats
path: root/sbin/hastd/secondary.c
diff options
context:
space:
mode:
authorpjd <pjd@FreeBSD.org>2011-03-25 20:19:15 +0000
committerpjd <pjd@FreeBSD.org>2011-03-25 20:19:15 +0000
commit4f523688131f9f3d0dce754dff71971a700d2dd2 (patch)
tree8cd48e5eb853c7391e9746626b8494cfce6db8fb /sbin/hastd/secondary.c
parent7c9a800121ed23c0ea0ea4d33b2370355d4fccba (diff)
downloadFreeBSD-src-4f523688131f9f3d0dce754dff71971a700d2dd2.zip
FreeBSD-src-4f523688131f9f3d0dce754dff71971a700d2dd2.tar.gz
Add mapsize to the header just before sending the packet.
Before it could change later and we were sending invalid mapsize. Some time ago I added optimization where when nodes are connected for the first time and there were no writes to them yet, there is no initial full synchronization. This bug prevented it from working. MFC after: 1 week
Diffstat (limited to 'sbin/hastd/secondary.c')
-rw-r--r--sbin/hastd/secondary.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/sbin/hastd/secondary.c b/sbin/hastd/secondary.c
index 10c3cab..f2e58bd 100644
--- a/sbin/hastd/secondary.c
+++ b/sbin/hastd/secondary.c
@@ -201,7 +201,6 @@ init_remote(struct hast_resource *res, struct nv *nvin)
"Unable to allocate memory (%zu bytes) for activemap.",
mapsize);
}
- nv_add_uint32(nvout, (uint32_t)mapsize, "mapsize");
/*
* When we work as primary and secondary is missing we will increase
* localcnt in our metadata. When secondary is connected and synced
@@ -339,6 +338,7 @@ init_remote(struct hast_resource *res, struct nv *nvin)
(uintmax_t)res->hr_secondary_localcnt,
(uintmax_t)res->hr_secondary_remotecnt);
}
+ nv_add_uint32(nvout, (uint32_t)mapsize, "mapsize");
if (hast_proto_send(res, res->hr_remotein, nvout, map, mapsize) < 0) {
pjdlog_exit(EX_TEMPFAIL, "Unable to send activemap to %s",
res->hr_remoteaddr);
OpenPOWER on IntegriCloud