Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1f5ne6-00039n-Nr for pgsql-hackers@arkaria.postgresql.org; Tue, 10 Apr 2018 07:24:51 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1f5ne5-0007UN-M8 for pgsql-hackers@arkaria.postgresql.org; Tue, 10 Apr 2018 07:24:49 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1f5ne3-0007U7-UT for pgsql-hackers@lists.postgresql.org; Tue, 10 Apr 2018 07:24:49 +0000 Received: from out5-smtp.messagingengine.com ([66.111.4.29]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1f5ndy-000679-9I for pgsql-hackers@postgresql.org; Tue, 10 Apr 2018 07:24:47 +0000 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id 71DE420DED; Tue, 10 Apr 2018 03:24:40 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Tue, 10 Apr 2018 03:24:40 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=paquier.xyz; h= cc:content-type:date:from:in-reply-to:message-id:mime-version :references:subject:to:x-me-sender:x-me-sender:x-sasl-enc; s= fm1; bh=B/d+c/lw4dRfJ6/kAb1YT+4oqzz5AoMlkJ50ge7/QAo=; b=CnNrrTgf pG3+Ga/MtcvfBSWjacFb5hG/3M+GWd/UIElEI1MlzU5sO50PqSo5hxjrr0v6c8rW zzcDf45DneswR/n8G4udtvEFxcYhAYYAVQCE/84GkMgeYOnlnX7SehKXRe2k/jn+ 5DsPQTO04GJNcEl2fFx4uGwbbQjTn4RzERUlHQ1NP5xXI4RPXuYVmhcAOK1QJuMI jcfua1uU0+sS8kH5uZPBFsjR/i2I4knvM1jXDwSLKAoZN2+G9HLx12aVBKNcfKuC o5DyIDxYtubrK2Q1Gm1k05fT82pb3L2A4C/w2qverQv+Q1Hjb8xJFYmw4enwfwfc QTfQGx3vN1rrrg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-sender :x-me-sender:x-sasl-enc; s=fm2; bh=B/d+c/lw4dRfJ6/kAb1YT+4oqzz5A oMlkJ50ge7/QAo=; b=lAox7GNOWj3sxShPAOOOKbTWdgsQ4RXMuFG4JT8FRt1St E15bojegFFFxRC2Y9AdNxogPUFlUZgNUzd2xzKYqetYIaoUlitDxpHWwKXygQ641 QxmU9oHRs5eFXETVp877gWvN8rNqQZNo4Jud3erEUjv78KZ3cvCE2vYpyw1Fvsyh 9koCJhdq1frys2ohL64MtG84aOdkGbrO8a3bS1FP7AiLOd6VXm7Ze3R72Sw6nedb Nd19ApITg6aN5yutYPnrl7xwLZ4k9AEj3BnYNPsinw0KLn+o9UQ/8ct3rkuiRBgS GQnAdQy0AFc03y+ItKemFqOJMX9IrfoczWzoC8YBA== X-ME-Sender: Received: from paquier.xyz (c137162.net61215.cablenet.ne.jp [61.215.137.162]) by mail.messagingengine.com (Postfix) with ESMTPA id 8F376E43E8; Tue, 10 Apr 2018 03:24:38 -0400 (EDT) Date: Tue, 10 Apr 2018 16:24:35 +0900 From: Michael Paquier To: Heikki Linnakangas Cc: Simon Riggs , pgsql-hackers Subject: Re: pgsql: Store 2PC GID in commit/abort WAL recs for logical decoding Message-ID: <20180410072435.GE26769@paquier.xyz> References: <33b787bf-dc20-1161-54e9-3f3b607bf59d@iki.fi> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="7LkOrbQMr4cezO2T" Content-Disposition: inline In-Reply-To: <33b787bf-dc20-1161-54e9-3f3b607bf59d@iki.fi> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk --7LkOrbQMr4cezO2T Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Mon, Apr 09, 2018 at 03:30:39PM +0300, Heikki Linnakangas wrote: > There seems to be some confusion on the padding here. Firstly, what's the > point of zero-padding the GID length to the next MAXALIGN boundary, which > would be 8 bytes on 64-bit systems, if the start is only guaranteed 4-byte > alignment, per the comment at the memcpy() above. Secondly, if we're > memcpying the fields that follow anyway, why bother with any alignment > padding at all? It seems to me that you are right here: those complications are not necessary. if (replorigin) + { /* Move LSNs forward for this replication origin */ replorigin_session_advance(replorigin_session_origin_lsn, gxact->prepare_end_lsn); + } This is better style. + /* twophase_gid follows if XINFO_HAS_GID. As a null-terminated string. */ + /* xl_xact_origin follows if XINFO_HAS_ORIGIN, stored unaligned! */ Worth mentioning that the first one is also unaligned with your patch? And that all the last fields of xl_xact_commit and xl_xact_abort are kept as such on purpose? -- Michael --7LkOrbQMr4cezO2T Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEG72nH6vTowiyblFKnvQgOdbyQH0FAlrMZrMACgkQnvQgOdby QH0lKA//ZrqgAAKazJDlei+BRn4qHnuH69d8n/lMmLItN8NUGywvKQsJ7DR13EaO Ew4xIjk6J+Zt/ozb3M8aFoL0YNq9AhCljswFHi3zDpXhozHLkQnd6k1jKNnLey7S m0vFzWLMJbJQAL2fvjt3Jy3yJH6wPR3T0+9RlLt+rjIIhGmvAnaGFRc4qTM0GeRW yqFsHCmZnOMafSf2rlk46gFmLzBlB3xV2ukTr4k/cTBl1q+qXrZPEVL6NwaxUZTU r7M+llYuephzdcPf+fI6S+aNZQPDg1imtIv1OLmw3UQn1QJv0SR+cmM9QPVHzy2I 9bZKGeJ4b7IoZ0ZgQ0/2qa6fiIquEtOYHi3zWiZCFqDmFLQAN9zLSr0aI3Cu22Xo pjNRGLyD1fvLoBgyelSSpIQrFYjXb1XOLH0N7Jae2P7yG9pG5jgKDhlgku02jwd8 ChBLTmzKyLsQjRv1sB2ma8mb9tSlPJR8B8hiOCR6YcG5KJSIz+aUtW7KQp50a2Xu yJTos8iEUuIPA/EHVNQrtY838wQAQCzwNe/FcO45iFrohL20hWUIRUiZMsV/YPd+ fSYM8FLUOJSyTG0Q9+bOGAEWKL0mCfoh29qXyTjzeMkVc8JVlkzu2RqtmY08l1zY KZp77onYzAdbY1Q+Z8IPJEpRqrpigbuqzx6DovWro76PU7PnPV4= =c4Um -----END PGP SIGNATURE----- --7LkOrbQMr4cezO2T--