Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1duY3v-0005OP-Nw for pgsql-hackers@arkaria.postgresql.org; Wed, 20 Sep 2017 06:00:43 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1duY3v-0008GB-2j for pgsql-hackers@arkaria.postgresql.org; Wed, 20 Sep 2017 06:00:43 +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.84_2) (envelope-from ) id 1duY2L-0005RV-DQ for pgsql-hackers@postgresql.org; Wed, 20 Sep 2017 05:59:05 +0000 Received: from out1-smtp.messagingengine.com ([66.111.4.25]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1duY2I-0002uK-7c for pgsql-hackers@postgresql.org; Wed, 20 Sep 2017 05:59:04 +0000 Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.nyi.internal (Postfix) with ESMTP id C0E9D20D6B; Wed, 20 Sep 2017 01:59:00 -0400 (EDT) Received: from frontend1 ([10.202.2.160]) by compute5.internal (MEProxy); Wed, 20 Sep 2017 01:59:00 -0400 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:x-sasl-enc; s=fm1; bh=fVMKIujYXojACbvWt/ vqfw/UZwPmoi5KG0OPrnUpXXM=; b=AoaKC92p8vnfYczXzAecJvCUodTzziHe7G fYd6J4XbYXTlWw6Kw7yXCnAGGGXkVWXGsryQmGONRZWElQSEJNNuuqR6jKRtSz7O 4E1u9w+TBYbvdlXvlyBENNp7lxBUCXWZJQxoA179Y5OZ4IbD3zEEJj6rKLXvSh6w 1kbWKDOyIYcBYuJ+CPY6MkJlb45maCKwurqsuaRkYo9L3xWZMWY+0hj6kx4vEcTC ffNK3T018JAxKUxMQxBxtwbwxRQs+dM/xPqKCNYdCRnW4o1vHMNHZ0AOZaGy8yJy Y07s4KFpVHKeoBrSvZxcnGVtnCgOhH/AITO1mcnm8Y+bcPOB3ycQ== X-ME-Sender: X-Sasl-enc: Inrw/GLEUwqDD59uX3JkBdMGUy3E6l5EMJ5ZaTeq1A4X 1505887140 Received: from intern.anarazel.de (unknown [136.24.76.72]) by mail.messagingengine.com (Postfix) with ESMTPA id 773B27E5EE; Wed, 20 Sep 2017 01:59:00 -0400 (EDT) Date: Tue, 19 Sep 2017 22:58:59 -0700 From: Andres Freund To: Michael Paquier Cc: PostgreSQL mailing lists Subject: Re: [COMMITTERS] pgsql: Make WAL segment size configurable at initdb time. Message-ID: <20170920055859.ymb3ls3cwsuzh5x6@alap3.anarazel.de> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-hackers Precedence: bulk Sender: pgsql-hackers-owner@postgresql.org On 2017-09-20 14:51:45 +0900, Michael Paquier wrote: > On Wed, Sep 20, 2017 at 2:04 PM, Andres Freund wrote: > > Make WAL segment size configurable at initdb time. > > > > For performance reasons a larger segment size than the default 16MB > > can be useful. A larger segment size has two main benefits: Firstly, > > in setups using archiving, it makes it easier to write scripts that > > can keep up with higher amounts of WAL, secondly, the WAL has to be > > written and synced to disk less frequently. > > > > But at the same time large segment size are disadvantageous for > > smaller databases. So far the segment size had to be configured at > > compile time, often making it unrealistic to choose one fitting to a > > particularly load. Therefore change it to a initdb time setting. > > > > This includes a breaking changes to the xlogreader.h API, which now > > requires the current segment size to be configured. For that and > > similar reasons a number of binaries had to be taught how to recognize > > the current segment size. > > I have been reading through this commit, and there is one change in > streamutil.c which is really unwelcome: > + /* for previous versions set the default xlog seg size */ > + if (PQserverVersion(conn) < MINIMUM_VERSION_FOR_SHOW_CMD) > + { > + WalSegSz = DEFAULT_XLOG_SEG_SIZE; > + return true; > + } > Because of this pg_receivewal will generate silently incorrect WAL > segment data if connecting with builds of PostgreSQL 10 or older > versions which do not have the default segment size of 16MB set. If > this patch justifies such breakages, I think that this should just > fail instead to tell users that it is better to use an older version > of pg_receivewal compatible with the build of this server. Better safe > than sorry. Hm, what are you proposing to do otherwise? I'm fairly unconvinced this is a serious problem. It'll work in like 99.95% of all clusters, and in the ones it won't work, it'll quickly afterwards, no? Forbidding cross-version stuff for the large majority of installations that have the default size, for the benefit the handfull of installations where that's not the case? Not convinced. > --- a/src/bin/pg_test_fsync/pg_test_fsync.c > +++ b/src/bin/pg_test_fsync/pg_test_fsync.c > @@ -64,7 +64,7 @@ static const char *progname; > > static int secs_per_test = 5; > static int needs_unlink = 0; > -static char full_buf[XLOG_SEG_SIZE], > +static char full_buf[DEFAULT_XLOG_SEG_SIZE], > Did you consider adding an option --wal-segzize to pg_test_fsync? Did, yes. Don't really think it's worthwhile. If somebody wants to come up with a patch and argue for it, please... > + * This is default value for wal_segment_size to be used at intidb when run > Typo here: s/intidb/initdb/. Ah, good catch. Greetings, Andres Freund -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers