pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Justin Pryzby <pryzby@telsasoft.com>
To: Takashi Menjo <takashi.menjo@gmail.com>
Cc: Thomas Munro <thomas.munro@gmail.com>
Cc: pgsql-hackers@postgresql.org, Tomas Vondra <tomas.vondra@enterprisedb.com>
Cc: Masahiko Sawada <sawada.mshk@gmail.com>
Cc: Heikki Linnakangas <hlinnaka@iki.fi>
Cc: Tsunakawa, Takayuki <tsunakawa.takay@fujitsu.com>
Cc: Deng, Gang <gang.deng@intel.com>
Cc: Takashi Menjo <takashi.menjou.vg@hco.ntt.co.jp>
Cc: Matthias van de Meent <boekewurm+postgres@gmail.com>
Cc: Daniel Gustafsson <daniel@yesql.se>
Subject: Re: Map WAL segment files on PMEM as WAL buffers
Date: Mon, 17 Jan 2022 01:34:44 -0600
Message-ID: <20220117073444.GZ14051@telsasoft.com> (raw)
In-Reply-To: <20220107044337.GB14051@telsasoft.com>
References: <CAOwnP3OaRYEgj0xCpXEJ2Pa7-52euL+gOTM8eMa+fOwpUPU4ZA@mail.gmail.com>
	<CEEFC453-353D-40B8-859F-6DF9ADF6F4BE@yesql.se>
	<CAOwnP3O6SWP6GO-o2RfkrDcF+5g3Y+K+L9Hp_6m3KSKebdm6Hg@mail.gmail.com>
	<CAOwnP3PS4fRNCOkGvSf1USv_bHSgQzMzn6CrbpbV1HM8nse1eQ@mail.gmail.com>
	<CAOwnP3N6Zi2nQ0WzuXA69w2mhZ5R5uvVJUDNH92CTA09MErh9g@mail.gmail.com>
	<20220106040000.GU14051@telsasoft.com>
	<CA+hUKGL4CjH5+ZJGwgZapj0ZSPbptCz=kHPDEu-N+JJMRANZtA@mail.gmail.com>
	<20220106051908.GV14051@telsasoft.com>
	<CAOwnP3PSDxKhBUGS=97_b44s65DxaGexJB2-Nbmf7SGiLUJ2pg@mail.gmail.com>
	<20220107044337.GB14051@telsasoft.com>

On Thu, Jan 06, 2022 at 10:43:37PM -0600, Justin Pryzby wrote:
> On Fri, Jan 07, 2022 at 12:50:01PM +0900, Takashi Menjo wrote:
> > > But in this case it really doesn't work :(
> > >
> > > running bootstrap script ... 2022-01-05 23:17:30.244 CST [12088] FATAL:  file not on PMEM: path "pg_wal/000000010000000000000001"
> > 
> > Do you have a real PMEM device such as NVDIMM-N or Intel Optane PMem?
> 
> No - the point is that we'd like to have a way to exercise this patch on the
> cfbot.  Particularly the new code introduced by this patch, not just the
> --without-pmem case...
..
> I think you should add a patch which does what Thomas suggested: 1) add to
> ./.cirrus.yaml installation of the libpmem package for debian/bsd/mac/windows;
> 2) add setenv to main(), as above; 3) change configure.ac and guc.c to default
> to --with-libpmem and wal_pmem_map=on.  This should be the last patch, for
> cfbot only, not meant to be merged.

I was able to get the cirrus CI to compile on linux and bsd with the below
changes.  I don't know if there's an easy package installation for mac OSX.  I
think it's okay if mac CI doesn't use --enable-pmem for now.

> You can test that the package installation part works before mailing patches to
> the list with the instructions here:
> 
> src/tools/ci/README:
> Enabling cirrus-ci in a github repository..

I ran the CI under my own github account.
Linux crashes in the recovery check.
And freebsd has been stuck for 45min.

I'm not sure, but maybe those are legimate consequence of using
PMEM_IS_PMEM_FORCE (?)  If so, maybe the recovery check would need to be
disabled for this patch to run on CI...  Or maybe my suggestion to enable it by
default for CI doesn't work for this patch.  It would need to be specially
tested with real hardware.

https://cirrus-ci.com/task/6245151591890944

https://cirrus-ci.com/task/6162551485497344?logs=test_world#L3941
#2  0x000055ff43c6edad in ExceptionalCondition (conditionName=0x55ff43d18108 "!XLogRecPtrIsInvalid(missingContrecPtr)", errorType=0x55ff43d151c4 "FailedAssertion", fileName=0x55ff43d151bd "xlog.c", lineNumber=8297) at assert.c:69

commit 15533794e465a381eb23634d67700afa809a0210
Author: Justin Pryzby <pryzbyj@telsasoft.com>
Date:   Thu Jan 6 22:53:28 2022 -0600

    tmp: enable pmem by default, for CI

inline patch 1: .cirrus.yml, src/backend/main/main.c, src/backend/utils/misc/guc.c (+10/-1 lines) download inline-1.patchdiff --git a/.cirrus.yml b/.cirrus.yml index 677bdf0e65e..0cb961c8103 100644 --- a/.cirrus.yml +++ b/.cirrus.yml @@ -81,6 +81,7 @@ task: mkdir -m 770 /tmp/cores chown root:postgres /tmp/cores sysctl kern.corefile='/tmp/cores/%N.%P.core' + pkg install -y devel/pmdk # NB: Intentionally build without --with-llvm. The freebsd image size is # already large enough to make VM startup slow, and even without llvm @@ -99,6 +100,7 @@ task: --with-lz4 \ --with-pam \ --with-perl \ + --with-libpmem \ --with-python \ --with-ssl=openssl \ --with-tcl --with-tclconfig=/usr/local/lib/tcl8.6/ \ @@ -138,6 +140,7 @@ LINUX_CONFIGURE_FEATURES: &LINUX_CONFIGURE_FEATURES >- --with-lz4 --with-pam --with-perl + --with-libpmem --with-python --with-selinux --with-ssl=openssl @@ -188,6 +191,9 @@ task: mkdir -m 770 /tmp/cores chown root:postgres /tmp/cores sysctl kernel.core_pattern='/tmp/cores/%e-%s-%p.core' + echo 'deb http://deb.debian.org/debian bullseye universe' >>/etc/apt/sources.list + apt-get update + apt-get -y install libpmem-dev configure_script: | su postgres <<-EOF @@ -267,6 +273,7 @@ task: make \ openldap \ openssl \ + pmem \ python \ tcl-tk @@ -301,6 +308,7 @@ task: --with-libxslt \ --with-lz4 \ --with-perl \ + --with-libpmem \ --with-python \ --with-ssl=openssl \ --with-tcl --with-tclconfig=${brewpath}/opt/tcl-tk/lib/ \ diff --git a/src/backend/main/main.c b/src/backend/main/main.c index 9124060bde7..b814269675d 100644 --- a/src/backend/main/main.c +++ b/src/backend/main/main.c @@ -69,6 +69,7 @@ main(int argc, char *argv[]) #endif progname = get_progname(argv[0]); + setenv("PMEM_IS_PMEM_FORCE", "1", 0); /* * Platform-specific startup hacks diff --git a/src/backend/utils/misc/guc.c b/src/backend/utils/misc/guc.c index ffc55f33e86..32d650cb9b2 100644 --- a/src/backend/utils/misc/guc.c +++ b/src/backend/utils/misc/guc.c @@ -1354,7 +1354,7 @@ static struct config_bool ConfigureNamesBool[] = "traditional volatile ones."), }, &wal_pmem_map, - false, + true, NULL, NULL, NULL }, #endif

view thread (22+ messages)  latest in thread

Message-ID: <20220117073444.GZ14051@telsasoft.com>
Permalink:  ../20220117073444.GZ14051@telsasoft.com/
Also on:    postgresql.org/message-id/20220117073444.GZ14051@telsasoft.com

 ·  · 

reply

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: pryzby@telsasoft.com, takashi.menjo@gmail.com, thomas.munro@gmail.com, tomas.vondra@enterprisedb.com, sawada.mshk@gmail.com, hlinnaka@iki.fi, tsunakawa.takay@fujitsu.com, gang.deng@intel.com, takashi.menjou.vg@hco.ntt.co.jp, boekewurm+postgres@gmail.com, daniel@yesql.se
  Subject: Re: Map WAL segment files on PMEM as WAL buffers
  In-Reply-To: <20220117073444.GZ14051@telsasoft.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