Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hBv7s-0007XG-O4 for pgsql-hackers@arkaria.postgresql.org; Thu, 04 Apr 2019 05:41:24 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1hBv7q-0003AT-5E for pgsql-hackers@arkaria.postgresql.org; Thu, 04 Apr 2019 05:41:22 +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_SHA1:256) (Exim 4.89) (envelope-from ) id 1hBv7p-0003AM-RR for pgsql-hackers@lists.postgresql.org; Thu, 04 Apr 2019 05:41:21 +0000 Received: from smtp-fw-9102.amazon.com ([207.171.184.29]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hBv7m-0007Uv-NV for pgsql-hackers@postgresql.org; Thu, 04 Apr 2019 05:41:21 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amazon.com; i=@amazon.com; q=dns/txt; s=amazon201209; t=1554356478; x=1585892478; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=stvvdjJBq3PYxz5SmKKeawzZb0zuKMWyqJ/kaV8Sitg=; b=qDSdm4CO96TRdNEiSKh0RQNcawt4PkTxGJR2+cHhINZVA1H+VRHQXuc1 xv2KIYxyqM/KNyFGIbzoLRdAPjLNCqym1bTmah5UmBiwNnVcmjlcwrhNx WdzOdzRlQt7oHJad+qHCmgPO2Q9wErkMVaPMVYfar1dHWDBRlWeI6rft9 A=; X-IronPort-AV: E=Sophos;i="5.60,306,1549929600"; d="scan'208";a="669382472" Received: from sea3-co-svc-lb6-vlan3.sea.amazon.com (HELO email-inbound-relay-1a-7d76a15f.us-east-1.amazon.com) ([10.47.22.38]) by smtp-border-fw-out-9102.sea19.amazon.com with ESMTP/TLS/DHE-RSA-AES256-SHA; 04 Apr 2019 05:41:12 +0000 Received: from EX13MTAUWC001.ant.amazon.com (iad55-ws-svc-p15-lb9-vlan3.iad.amazon.com [10.40.159.166]) by email-inbound-relay-1a-7d76a15f.us-east-1.amazon.com (8.14.7/8.14.7) with ESMTP id x345f5Cf074378 (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=FAIL); Thu, 4 Apr 2019 05:41:10 GMT Received: from EX13D05UWC002.ant.amazon.com (10.43.162.92) by EX13MTAUWC001.ant.amazon.com (10.43.162.135) with Microsoft SMTP Server (TLS) id 15.0.1367.3; Thu, 4 Apr 2019 05:41:09 +0000 Received: from f01898859afd.ant.amazon.com (10.43.161.197) by EX13D05UWC002.ant.amazon.com (10.43.162.92) with Microsoft SMTP Server (TLS) id 15.0.1367.3; Thu, 4 Apr 2019 05:41:09 +0000 Date: Wed, 3 Apr 2019 22:41:07 -0700 From: Shawn Debnath To: Thomas Munro CC: Andres Freund , Robert Haas , Tom Lane , Dmitry Dolgov <9erthalion6@gmail.com>, PostgreSQL-development Subject: Re: Refactoring the checkpointer's fsync request queue Message-ID: <20190404054107.GA22298@f01898859afd.ant.amazon.com> References: <20190326164758.GA78630@f01898859afd.ant.amazon.com> <20190403214423.GA45392@f01898859afd.ant.amazon.com> <20190404041945.GA16205@f01898859afd.ant.amazon.com> <20190404043559.syfy3v57ygma2bs4@alap3.anarazel.de> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.11.4 (2019-03-13) X-Originating-IP: [10.43.161.197] X-ClientProxiedBy: EX13D19UWA002.ant.amazon.com (10.43.160.204) To EX13D05UWC002.ant.amazon.com (10.43.162.92) Precedence: Bulk List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On Thu, Apr 04, 2019 at 05:39:14PM +1300, Thomas Munro wrote: > On Thu, Apr 4, 2019 at 5:36 PM Andres Freund wrote: > > On 2019-04-03 21:19:45 -0700, Shawn Debnath wrote: > > > +typedef struct FileTag > > > +{ > > > + int16 handler; /* SyncRequstHandler value, saving space */ > > > + int16 forknum; /* ForkNumber, saving space */ > > > + RelFileNode rnode; > > > + BlockNumber segno; > > > +} FileTag; > > > > Seems odd to me to use BlockNumber for segno. > > That is a tradition in md.c code. I had a new typedef SegmentNumber > in all sync.{c,h} stuff in an earlier version, but had trouble > figuring out where to define it... Thomas, this is why I had defined segment.h with the contents below :-) +++ b/src/include/storage/segment.h [...] +/* + * Segment Number: + * + * Each relation and its forks are divided into segments. This + * definition formalizes the definition of the segment number. + */ +typedef uint32 SegmentNumber; + +#define InvalidSegmentNumber ((SegmentNumber) 0xFFFFFFFF) My last iteration, v12, patch had it. See [1] for comments on removal of segment.h. [1] https://www.postgresql.org/message-id/20190403214423.GA45392%40f01898859afd.ant.amazon.com -- Shawn Debnath Amazon Web Services (AWS)