Received: from magus.postgresql.org (magus.postgresql.org [87.238.57.229]) by mail.postgresql.org (Postfix) with ESMTP id C68FE6FED3 for ; Tue, 19 Jun 2012 19:25:20 -0300 (ADT) Received: from exprod7og104.obsmtp.com ([64.18.2.161]) by magus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1Sh6rK-0003jR-Ak for pgsql-hackers@postgresql.org; Tue, 19 Jun 2012 22:25:19 +0000 Received: from mail-lb0-f172.google.com ([209.85.217.172]) (using TLSv1) by exprod7ob104.postini.com ([64.18.6.12]) with SMTP ID DSNKT+D8OxxUkAKoB3HebCMGV9uiumnqHLWa@postini.com; Tue, 19 Jun 2012 15:25:14 PDT Received: by lbbgo11 with SMTP id go11so6391899lbb.3 for ; Tue, 19 Jun 2012 15:24:58 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding :x-gm-message-state; bh=bYNdrDVx1wCR8gyFX2ptQ4uTvhUAUmdqUDcyBKynKlg=; b=ICKnGZqa6g1U7CUeVjKxX7OrGWjLf8hV8jIV64VuJM486cGy/rv/mfQyeQLU1q136J Ir7ooYR4va2brFZx+U2lLrjBb4/FmFot/7JvTf9QrnKgO9P6TKv1Dlq2zJGsXTn4l9hB vIgxB5HTezNpGzRHr8QT4LXQ2fX9s5JRZjiEXcVk0BqHOQ10W0SI1oLCJ2IUdPGka4US 8czYQvEAlHikcYsccggUTLz4SnaTwvJCQGPiAYfcuWjjimw2Xm+Rsrcvo3g4fIh2BkVL UU7dfxlTgcHNQdZYQQTxgEnEEQy7rzQJkPaiuekJm1rcbvH7x+7idHbpkn11+KRP+NEv mX0g== Received: by 10.112.49.227 with SMTP id x3mr8897003lbn.73.1340144698164; Tue, 19 Jun 2012 15:24:58 -0700 (PDT) Received: from [192.168.1.100] (dsl-hkibrasgw2-ff6cc300-200.dhcp.inet.fi. [88.195.108.200]) by mx.google.com with ESMTPS id ta2sm35883608lab.15.2012.06.19.15.24.56 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 19 Jun 2012 15:24:56 -0700 (PDT) Message-ID: <4FE0FC36.9080409@enterprisedb.com> Date: Wed, 20 Jun 2012 01:24:54 +0300 From: Heikki Linnakangas User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:10.0.4) Gecko/20120510 Icedove/10.0.4 MIME-Version: 1.0 To: Andres Freund CC: pgsql-hackers@postgresql.org, Robert Haas Subject: Re: WAL format changes References: <4FDA5136.6080206@enterprisedb.com> <4FDF6E8E.4080900@enterprisedb.com> <4FE034D0.5070900@enterprisedb.com> <201206191746.41027.andres@2ndquadrant.com> In-Reply-To: <201206191746.41027.andres@2ndquadrant.com> Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: 7bit X-Gm-Message-State: ALoCoQkcB1N2J/ZmapcQk+dWbafwl9rJ51bI5TYTXXzgP1VnOZw36CCfZUqImD/BUGMJm4AhE8XB X-Pg-Spam-Score: -4.2 (----) X-Archive-Number: 201206/1071 X-Sequence-Number: 209911 On 19.06.2012 18:46, Andres Freund wrote: > On Tuesday, June 19, 2012 10:14:08 AM Heikki Linnakangas wrote: >> Well, that was easier than I thought. Attached is a patch to make >> XLogRecPtr a uint64, on top of my other WAL format patches. I think we >> should go ahead with this. > Cool. You plan to merge XLogSegNo with XLogRecPtr in that case? I am not sure > if having two representations which just have a constant factor inbetween > really makes sense. I wasn't planning to, it didn't even occur to me that we might be able to get rid of XLogSegNo to be honest. There's places that deal whole segments, rather than with specific byte positions in the WAL, so I think XLogSegNo makes more sense in that context. Take XLogArchiveNotifySeg(), for example. It notifies the archiver that a given segment is ready for archiving, so we pass an XLogSegNo to identify that segment as an argument. I suppose we could pass an XLogRecPtr that points to the beginning of the segment instead, but it doesn't really feel like an improvement to me. >> Should we keep the old representation in the replication protocol >> messages? That would make it simpler to write a client that works with >> different server versions (like pg_receivexlog). Or, while we're at it, >> perhaps we should mandate network-byte order for all the integer and >> XLogRecPtr fields in the replication protocol. > The replication protocol uses pq_sendint for integers which should take care > of converting to big endian already. I don't think anything but the wal itself > is otherwise transported in a binary fashion? So I don't think there is any > such architecture dependency in the protocol currently? We only use pg_sendint() for the few values exchanged in the handshake before we start replicating, but once we begin, we just send structs around. For example, in ProcessStandbyReplyMessage(): > static void > ProcessStandbyReplyMessage(void) > { > StandbyReplyMessage reply; > > pq_copymsgbytes(&reply_message, (char *) &reply, sizeof(StandbyReplyMessage)); > ... After that, we just the fields in the reply struct like in any other struct. -- Heikki Linnakangas EnterpriseDB http://www.enterprisedb.com