From owner-svn-src-head@FreeBSD.ORG Fri Mar 25 20:19:15 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id ACA30106566C; Fri, 25 Mar 2011 20:19:15 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9B7068FC1C; Fri, 25 Mar 2011 20:19:15 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p2PKJFno092310; Fri, 25 Mar 2011 20:19:15 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p2PKJF6E092308; Fri, 25 Mar 2011 20:19:15 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201103252019.p2PKJF6E092308@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Fri, 25 Mar 2011 20:19:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r220007 - head/sbin/hastd X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Mar 2011 20:19:15 -0000 Author: pjd Date: Fri Mar 25 20:19:15 2011 New Revision: 220007 URL: http://svn.freebsd.org/changeset/base/220007 Log: 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 Modified: head/sbin/hastd/secondary.c Modified: head/sbin/hastd/secondary.c ============================================================================== --- head/sbin/hastd/secondary.c Fri Mar 25 20:15:16 2011 (r220006) +++ head/sbin/hastd/secondary.c Fri Mar 25 20:19:15 2011 (r220007) @@ -201,7 +201,6 @@ init_remote(struct hast_resource *res, s "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, s (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);