Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nbyFl-00022l-It for pgsql-hackers@arkaria.postgresql.org; Wed, 06 Apr 2022 05:30:49 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1nbyFj-00036k-Cv for pgsql-hackers@arkaria.postgresql.org; Wed, 06 Apr 2022 05:30:47 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nbyFj-00036b-1W for pgsql-hackers@lists.postgresql.org; Wed, 06 Apr 2022 05:30:47 +0000 Received: from mail-pj1-x102d.google.com ([2607:f8b0:4864:20::102d]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1nbyFe-0001fU-Rq for pgsql-hackers@postgresql.org; Wed, 06 Apr 2022 05:30:46 +0000 Received: by mail-pj1-x102d.google.com with SMTP id c15-20020a17090a8d0f00b001c9c81d9648so1656566pjo.2 for ; Tue, 05 Apr 2022 22:30:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=date:message-id:to:cc:subject:from:in-reply-to:references :user-agent:mime-version:content-transfer-encoding; bh=5AY5/drA4DPC6Dqs6Uss7xndrC/Sj2YZn5E0TwlX8Zo=; b=iPavSU9xnA0p1AC7iX1P+Zl9QuqYE1hivZxJpUGN+J/6DjvPLGK9jajTC7UUaW0BN6 pkuh145I2HoARkGffwrUTjaF1oFcofVvAB/2ljHldtrcmsX1BVzMZCHG9kz65T/onH3e oxJlDtbow59tBn3QXWhjTwhvS+m+JbLDhvnX0pjbo1gAgbZPvF2mkc6j6Tdbhurd280D hAuxzZfcqirnGjBM+A2UE2JnzhReTIj+qoV93Y786pKUZnFu8hoge9X7SgdMjotKEOp+ kLPKS4oMgi84fTb91wh3oFBuvvFFqr6nN9VxlZTwx37LnkuR7kV9+RBRGupraLtztD+R oDzg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:message-id:to:cc:subject:from:in-reply-to :references:user-agent:mime-version:content-transfer-encoding; bh=5AY5/drA4DPC6Dqs6Uss7xndrC/Sj2YZn5E0TwlX8Zo=; b=qoqhBhb84s0MXloMrPuqpGMq2eRay+1Kax51ikWv9NNUUu8pl/0JRn6nAcUfQtbAl9 CidofoxxIvho/8IlDsDMbrn+0KQQpES/uChIael48Z/ezhn/43kRX2l2SDCGjlL3mcMH d5e5Z1Z55rktfMOuY8SGTO25y3s2mqItZb1/klCPZVs9HKIJp9eEDR+R9Zij7QC0cMrk eWSlm5+LpDFecpgDvCQ1xTYKZOeG32hAXpO7XMuXcBU90fHzXkL6IipF9MZHUsuzDeVG pIW/xSNOHJx5HCbaZGu4CdfllyYIXILJmVKA/8O1uTQQm/06lpCGrrPGHolirjo0mmVs UJKA== X-Gm-Message-State: AOAM531x3I80tYTSNo0LwitLSrSa0NaHPqrq6tfWTNfRc/hOVea1dOUO S2HONBfhv5NsHNPemyQix4Q= X-Google-Smtp-Source: ABdhPJz/UPW4vqiyTqyz/SlwtxAPb6zOJqE0Bf2ME5T16YJ58nt31dwUnX6iBMS1Qkw7pKJG6guDrg== X-Received: by 2002:a17:90b:124c:b0:1bc:369b:7db5 with SMTP id gx12-20020a17090b124c00b001bc369b7db5mr7976728pjb.179.1649223040656; Tue, 05 Apr 2022 22:30:40 -0700 (PDT) Received: from localhost (KD036014041111.ppp-bb.dion.ne.jp. [36.14.41.111]) by smtp.gmail.com with ESMTPSA id v24-20020a634818000000b0036407db4728sm14745154pga.26.2022.04.05.22.30.38 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 05 Apr 2022 22:30:39 -0700 (PDT) Date: Wed, 06 Apr 2022 14:30:37 +0900 (JST) Message-Id: <20220406.143037.1305948883608926192.horikyota.ntt@gmail.com> To: robertmhaas@gmail.com Cc: markus.wanner@enterprisedb.com, pgsql-hackers@postgresql.org Subject: Re: API stability From: Kyotaro Horiguchi In-Reply-To: <20220406.103630.334298501828781936.horikyota.ntt@gmail.com> References: <20220406.103630.334298501828781936.horikyota.ntt@gmail.com> User-Agent: Mew version 6.8 on Emacs 26.1 Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk me> I'd like to do that. Let me see. At Tue, 5 Apr 2022 10:29:03 -0400, Robert Haas wrote in > On Tue, Apr 5, 2022 at 10:17 AM Tom Lane wrote: > > What I think you need to do is: > > > > 1. In the back branches, revert delayChkpt to its previous type and > > semantics. Squeeze a separate delayChkptEnd bool in somewhere > > (you can't change the struct size either ...). > > > > 2. In HEAD, rename the field to something like delayChkptFlags, > > to ensure that any code touching it has to be inspected and updated. > > Well, we can do it that way, I suppose. The change is easy on head, but is it better use uint8 instead of int for delayChkptFlags? In the back branches, we have, on gcc/Linux/x86-64, 14's PGPROC is 880 bytes and has gaps: - 6 bytes after statusFlag - 4 bytes after syncRepState - 2 bytes after subxidStatus - 3 bytes after procArrayGroupMember - 3 bytes after clogGroupMember - 3 bytes after fpVXIDLock It seems that we can place the new variable in the first place above, since the two are not bonded together, or at least in less tightly bonded than other candidates. 13's PGPROC is 856 bytes and has a 7 bytes gap after delayChkpt. Versions Ealier than 13 have delayChkpt in PGXACT (12 bytes). It is tightly packed and dones't have a room for a new member. Can we add the new flag to PGPROC instead of PGXACT? 12 and 11's PGPROC is 848 bytes and has gaps: - 4 bytes after syncRepState - 3 bytes after procArrayGroupMember - 3 bytes after clogGroupMember - 4 bytes after clogGroupMemberPage - 3 bytes after fpVXIDLock 10's PGPROC is 816 bytes and has gaps: - 4 bytes after cvWaitLink - 4 bytes after syncRepState - 3 bytes after procArrayGroupMember - 3 bytes after fpVXIDLock So if we don't want to move any member in PGPROC, we do: 14: after statusFlags. 13: after delayChkpt. 12-10: after syncRepState (and before syncRepLinks). If we allow to shift some members, the new flag can be placed more saner place. 14: after delayChkpt ((uint8)statusFlags moves forward by 1 byte) 13: after delayChkpt (no member moves) 12-10: after subxids ((bool)procArrayGroupMember moves forward by 1 byte) I continue working on the last direction above. regards. -- Kyotaro Horiguchi NTT Open Source Software Center