From: Shawn Debnath <sdn@amazon.com>
To: Robert Haas <robertmhaas@gmail.com>
Cc: Andres Freund <andres@anarazel.de>
Cc: Thomas Munro <thomas.munro@gmail.com>
Cc: Thomas Munro <thomas.munro@enterprisedb.com>
Cc: Dmitry Dolgov <9erthalion6@gmail.com>
Cc: PostgreSQL-development <pgsql-hackers@postgresql.org>
Subject: Re: Refactoring the checkpointer's fsync request queue
Date: Fri, 1 Mar 2019 11:35:58 -0800
Message-ID: <20190301193558.GA4664@f01898859afd.ant.amazon.com> (raw)
In-Reply-To: <CA+TgmobqzMkSnWBHcTYqxwQhL3MahX-cpWzs2sVJ4219ciAYGA@mail.gmail.com>
References: <20190222224853.ahvm3bf52zqr7k7h@alap3.anarazel.de>
<CA+hUKG+i5+0Grt9O9gtv1YHASP6R3rfb8074or0j=fFoY6YvTw@mail.gmail.com>
<20190222230916.5mfsqn3oesd2nxiz@alap3.anarazel.de>
<20190222234549.GA7397@f01898859afd.ant.amazon.com>
<20190222235742.4oed46wocpjfpoa5@alap3.anarazel.de>
<20190227212653.GA7171@f01898859afd.ant.amazon.com>
<CA+hUKG+2EuoDhVBdieOKnneFX14SeuRp7z0WG2PSOMJt8ks3qw@mail.gmail.com>
<CA+hUKGKF7QvUi2ST4R5vd_PVdcztBTXB23ZJwoj_ASoujrbsmQ@mail.gmail.com>
<20190301174256.3um2t73wycsywrur@alap3.anarazel.de>
<CA+TgmobqzMkSnWBHcTYqxwQhL3MahX-cpWzs2sVJ4219ciAYGA@mail.gmail.com>
On Fri, Mar 01, 2019 at 01:15:21PM -0500, Robert Haas wrote:
> > >
> > > +typedef enum syncrequestowner
> > > +{
> > > + SYNC_MD = 0 /* md smgr */
> > > +} syncrequestowner;
> > >
> > > I have a feeling that Andres wanted to see a single enum combining
> > > both the "operation" and the "owner", like SYNC_REQ_CANCEL_MD,
> > > SYNC_REQ_CANCEL_UNDO, ... but I actually like it better the way you
> > > have it.
> >
> > Obviously it's nicer looking this way, but OTOH, that means we have to
> > send more data over the queue, because we can't easily combine the
> > request + "owner". I don't have too strong feelings about it though.
>
> Yeah, I would lean toward combining those.
I disagree, at least with combining and retaining enums. Encoding all
the possible request types with the current, planned and future SMGRs
would cause a sheer explosion in the number of enum values. Not to
mention that you have multiple enum values for the same behavior - which
just isn't clean. And handling of these enums in the code would be ugly
too.
Do note that these are typedef'ed to uint8 currently. For a default
config with 128 MB shared_buffers, we will use an extra 16kB (one extra
byte to represent the owner). I am hesitant to change this right now
unless folks feel strongly about it.
If so, I would combine the type and owner by splitting it up in 4 bit
chunks, allowing for 16 request types and 16 smgrs. This change would
only apply for the in-memory queue. The code and functions would
continue using the enums.
--
Shawn Debnath
Amazon Web Services (AWS)
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-hackers@postgresql.org
Cc: sdn@amazon.com, robertmhaas@gmail.com, andres@anarazel.de, thomas.munro@gmail.com, thomas.munro@enterprisedb.com, 9erthalion6@gmail.com
Subject: Re: Refactoring the checkpointer's fsync request queue
In-Reply-To: <20190301193558.GA4664@f01898859afd.ant.amazon.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox