From: Jeff Garzik Subject: chunkd on-disk and network protocol format change Date: Wed, 07 Jul 2010 01:01:14 -0400 Message-ID: <4C340A1A.5020200@garzik.org> Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Return-path: DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:sender:message-id:date:from :user-agent:mime-version:to:subject:content-type :content-transfer-encoding; bh=laMW5ch0VahTu482IrTvFSS5pEY+3EJ4Or8ubaDvhio=; b=RSC7dkkRqWkp3UkxRGxrTRTQ50Lh+MGuh7x6Xn8S/EDEuzZzuk2jgO1QHBEvy1wXLf xEGDyOuPOwEXLPDK/jMNG8FR5h0IwpJ8hZKIAHfGjvgXnFrxca6brCBCGg07K4xJnrbY 1vUfeQ2FcZO/WDXyyzUtFU34LhmCczADYQzX4= Sender: hail-devel-owner@vger.kernel.org List-ID: Content-Type: text/plain; charset="us-ascii"; format="flowed" To: Project Hail The following commit introduces an incompatible chunkd change, which breaks compatibility with (a) existing on-disk chunkd databases, and (b) existing chunkd network protocol entities. Prior to commit ea5d20bc22aeed077312c9c1824e84651af17a16, chunkd stored SHA1 checksums as ASCII, and sent them across the wire in each message in ASCII. Converting these to directly store and use SHA1 binary checksums on-disk saves several memory allocations, and more importantly, shaves 44 bytes off each chunkd message. ASCII is only needed in the XML-based list-objects output, so we only perform the conversion at list-objects time. Jeff commit ea5d20bc22aeed077312c9c1824e84651af17a16 Author: Jeff Garzik Date: Wed Jul 7 00:51:48 2010 -0400 [chunk] protocol, disk fmt: Replace ASCII checksum representation with binary Rather than converting SHA1 checksums back and forth between ASCII and binary, always store and compare binary checksums. Only convert to ASCII when performing a list-objects request, which requires XML output. Among other savings, this decreases the size of the per-message fixed-length header by 44 bytes. Signed-off-by: Jeff Garzik chunkd/be-fs.c | 47 +++++++++++++++-------------------------------- chunkd/chunkd.h | 9 +++++---- chunkd/object.c | 14 ++++---------- chunkd/selfcheck.c | 19 +++++++++++-------- include/chunk_msg.h| 4 ++-- 5 files changed, 37 insertions(+), 56 deletions(-)