Received: from makus.postgresql.org (makus.postgresql.org [98.129.198.125]) by mail.postgresql.org (Postfix) with ESMTP id 66BAC1975914 for ; Wed, 20 Jun 2012 16:42:42 -0300 (ADT) Received: from exprod7og108.obsmtp.com ([64.18.2.169]) by makus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1ShQnY-0002pi-B5 for pgsql-hackers@postgresql.org; Wed, 20 Jun 2012 19:42:41 +0000 Received: from mail-lb0-f175.google.com ([209.85.217.175]) (using TLSv1) by exprod7ob108.postini.com ([64.18.6.12]) with SMTP ID DSNKT+InouhBSFKtrSnzNDoe5JQPVKATnA6/@postini.com; Wed, 20 Jun 2012 12:42:39 PDT Received: by lbol5 with SMTP id l5so1113909lbo.20 for ; Wed, 20 Jun 2012 12:42:24 -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=kczMkSESPexKxKwgG1L6AXwEilJ02yOJXZnvc11pxG0=; b=Z83exHIdoHm19IBAWmoFrMYWIvODIw2IAqXKXHSXpn7adBUSUnsElTg76ZGy+NoMpe agsS5vY3NJB4rxZoGsZh2fdaoh4KYOwjxlx7ecX29+Sn/IaZ0SiOf6bDl7tVsJYFqdlB Hn+OJbAeYS9jHejZlDB8juXluofttsmV+MsOVXKVlmRJnrMTU5H8c7oGq3ebonahpCsl 14bHpT9JYiQlHz8GB9ypatY/xjwuoGzOrc4qc1DEdWHUQJUPDwKxpgu3a0sQ/iVKCugR +OrMA4bd+gkeU5YV+VfC8NMojT9Ei4LToKJOfSeii5oNkr2/t33ihJpEO0VPpMCwUSHN hcYw== Received: by 10.112.85.225 with SMTP id k1mr10460519lbz.38.1340221344088; Wed, 20 Jun 2012 12:42:24 -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 k4sm16836100lbb.12.2012.06.20.12.42.22 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 20 Jun 2012 12:42:23 -0700 (PDT) Message-ID: <4FE2279C.2070506@enterprisedb.com> Date: Wed, 20 Jun 2012 22:42:20 +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: Fujii Masao CC: Magnus Hagander , Robert Haas , Andres Freund , pgsql-hackers@postgresql.org Subject: Re: WAL format changes References: <4FDA5136.6080206@enterprisedb.com> <201206142358.12431.andres@2ndquadrant.com> <4FDF6E8E.4080900@enterprisedb.com> <4FE034D0.5070900@enterprisedb.com> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Gm-Message-State: ALoCoQmEybtGCiH1lU+CQVThAy7lfILcJkor4H+Hy2/L6T7MbMlV9YFowWr58sH/05eVjas28Gby X-Pg-Spam-Score: -4.2 (----) X-Archive-Number: 201206/1226 X-Sequence-Number: 210066 On 20.06.2012 20:43, Fujii Masao wrote: > On Wed, Jun 20, 2012 at 8:19 PM, Magnus Hagander wrote: >> On Tue, Jun 19, 2012 at 5:57 PM, Robert Haas wrote: >>> On Tue, Jun 19, 2012 at 4:14 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. >>> >>> +1. >>> >>>> The LSNs on pages are still stored in the old format, to avoid changing the >>>> on-disk format and breaking pg_upgrade. The XLogRecPtrs stored the control >>>> file and WAL are changed, however, so an initdb (or at least pg_resetxlog) >>>> is required. >>> >>> Seems fine. >>> >>>> 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. That would make it easier to write a client >>>> that works across different architectures, in>= 9.3. The contents of the >>>> WAL would of course be architecture-dependent, but it would be nice if >>>> pg_receivexlog and similar tools could nevertheless be >>>> architecture-independent. >>> >>> I share Andres' question about how we're doing this already. I think >>> if we're going to break this, I'd rather do it in 9.3 than 5 years >>> from now. At this point it's just a minor annoyance, but it'll >>> probably get worse as people write more tools that understand WAL. >> >> If we are looking at breaking it, and we are especially concerned >> about something like pg_receivexlog... Is it something we could/should >> change in the protocl *now* for 9.2, to make it non-broken in any >> released version? As in, can we extract just the protocol change and >> backpatch that to 9.2beta? > > pg_receivexlog in 9.2 cannot handle correctly the WAL location "FF" > (which was skipped in 9.2 or before). For example, pg_receivexlog calls > XLByteAdvance() which always skips "FF". So even if we change the protocol, > ISTM pg_receivexlog in 9.2 cannot work well with the server in 9.3 which > might send "FF". No? Yeah, you can't use pg_receivexlog from 9.2 against a 9.3 server. We can't really promise compatibility when using an older client against a newer server, but we can try to be backwards-compatible in the other direction. I'm thinking of using a 9.3 pg_receivexlog against a 9.2 server. But I guess Robert is right and we shouldn't worry about backwards-compatibility at this point. Instead, let's try to get the protocol right, so that we can more easily provide backwards-compatibility in the future. Like, using a 9.4 pg_receivexlog against a 9.3 server. -- Heikki Linnakangas EnterpriseDB http://www.enterprisedb.com