Re: Map WAL segment files on PMEM as WAL buffers

From: Justin Pryzby <pryzby(at)telsasoft(dot)com>
To: Takashi Menjo <takashi(dot)menjo(at)gmail(dot)com>
Cc: pgsql-hackers(at)postgresql(dot)org, Tomas Vondra <tomas(dot)vondra(at)enterprisedb(dot)com>, Masahiko Sawada <sawada(dot)mshk(at)gmail(dot)com>, Heikki Linnakangas <hlinnaka(at)iki(dot)fi>, tsunakawa(dot)takay(at)fujitsu(dot)com, "Deng, Gang" <gang(dot)deng(at)intel(dot)com>, Takashi Menjo <takashi(dot)menjou(dot)vg(at)hco(dot)ntt(dot)co(dot)jp>, Matthias van de Meent <boekewurm+postgres(at)gmail(dot)com>, Daniel Gustafsson <daniel(at)yesql(dot)se>
Subject: Re: Map WAL segment files on PMEM as WAL buffers
Date: 2022-01-06 04:00:01
Message-ID: 20220106040000.GU14051@telsasoft.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

The cfbot showed issues compiling on linux and windows.
http://cfbot.cputube.org/takashi-menjo.html

https://cirrus-ci.com/task/6125740327436288
[02:30:06.538] In file included from xlog.c:38:
[02:30:06.538] ../../../../src/include/access/xlogpmem.h:32:42: error: unknown type name ‘tli’
[02:30:06.538] 32 | PmemXLogEnsurePrevMapped(XLogRecPtr ptr, tli)
[02:30:06.538] | ^~~
[02:30:06.538] xlog.c: In function ‘GetXLogBuffer’:
[02:30:06.538] xlog.c:1959:19: warning: implicit declaration of function ‘PmemXLogEnsurePrevMapped’ [-Wimplicit-function-declaration]
[02:30:06.538] 1959 | openLogSegNo = PmemXLogEnsurePrevMapped(endptr, tli);

https://cirrus-ci.com/task/6688690280857600?logs=build#L379
[02:33:25.752] c:\cirrus\src\include\access\xlogpmem.h(33,1): error C2081: 'tli': name in formal parameter list illegal (compiling source file src/backend/access/transam/xlog.c) [c:\cirrus\postgres.vcxproj]

I'm attaching a probable fix. Unfortunately, for patches like this, most of
the functionality isn't exercised unless the library is installed and
compilation and runtime are enabled by default.

In 0009: recaluculated => recalculated

0010-Update-document should be squished with 0003-Add-wal_pmem_map-to-GUC (and
maybe 0002 and 0001). I believe the patches after 0005 are more WIP, so it's
fine if they're not squished yet. I'm not sure what the point is of this one:
0008-Let-wal_pmem_map-be-constant-unl

+ ereport(ERROR,
+ (errcode_for_file_access(),
+ errmsg("could not pmem_map_file \"%s\": %m", path)));

=> The outer parenthesis are not needed since e3a87b4.

Attachment Content-Type Size
0001-Add-with-libpmem-option-for-PMEM-support.patch text/x-diff 5.4 KB
0002-Support-build-with-MSVC-on-Windows.patch text/x-diff 2.8 KB
0003-Add-wal_pmem_map-to-GUC.patch text/x-diff 4.7 KB
0004-Export-InstallXLogFileSegment.patch text/x-diff 2.1 KB
0005-Map-WAL-segment-files-on-PMEM-as-WAL-buffers.patch text/x-diff 17.3 KB
0006-compile-fix-without-pmem.patch text/x-diff 729 bytes
0007-Compatible-to-Windows.patch text/x-diff 1.6 KB
0008-WAL-statistics-in-cases-of-wal_pmem_map-true.patch text/x-diff 2.2 KB
0009-Let-wal_pmem_map-be-constant-unless-with-libpmem.patch text/x-diff 1.4 KB
0010-Ensure-WAL-mappings-before-assertion.patch text/x-diff 1.4 KB
0011-Update-document.patch text/x-diff 2.0 KB
0012-Preallocate-and-initialize-more-WAL-if-wal_pmem_map-.patch text/x-diff 3.6 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Dilip Kumar 2022-01-06 04:01:44 Re: Throttling WAL inserts when the standby falls behind more than the configured replica_lag_in_bytes
Previous Message Julien Rouhaud 2022-01-06 03:35:14 Re: ICU for global collation