On 11/27/20 1:02 AM, Tomas Vondra wrote:
> 
> Unfortunately, that patch seems to fail for me :-(
> 
> The patches seem to be for PG12, so I applied them on REL_12_STABLE (all
> the parts 0001-0005) and then I did this:
> 
> LIBS="-lpmem" ./configure --prefix=/home/tomas/pg-12-pmem --enable-debug
> make -s install
> 
> initdb -X /opt/pmemdax/benchmarks/wal -D /opt/nvme/benchmarks/data
> 
> pg_ctl -D /opt/nvme/benchmarks/data/ -l pg.log start
> 
> createdb test
> pgbench -i -s 500 test
> 
> 
> which however fails after just about 70k rows generated (PQputline
> failed), and the pg.log says this:
> 
>     PANIC:  could not open or mmap file
> "pg_wal/000000010000000000000006": No such file or directory
>     CONTEXT:  COPY pgbench_accounts, line 721000
>     STATEMENT:  copy pgbench_accounts from stdin
> 
> Takashi-san, can you check and provide a fixed version? Ideally, I'll
> take a look too, but I'm not familiar with this patch so it may take
> more time.
> 

I did try to get this working today, unsuccessfully. I did manage to
apply the 0002 part separately on REL_12_0 (there's one trivial rejected
chunk), but I still get the same failure. In fact, when built with
assertions, I can't even get initdb to pass :-(

I do get this:

TRAP: FailedAssertion("!(page->xlp_pageaddr == ptr - (ptr % 8192))",
File: "xlog.c", Line: 1813)

The values involved here are

    xlp_pageaddr = 16777216
    ptr = 20971520

so the page seems to be at the very beginning of the second WAL segment,
but the pointer is somewhere later. A full backtrace is attached.

I'll continue investigating this, but the xlog code is not particularly
easy to understand in general, so it may take time.


regards

-- 
Tomas Vondra
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company
Core was generated by `/home/user/pg-12/bin/postgres --single -F -O -j -c 
search_path=pg_catalog -c ex'.
Program terminated with signal SIGABRT, Aborted.
#0  0x00007b2909ca09e5 in raise () from /lib64/libc.so.6
Missing separate debuginfos, use: dnf debuginfo-install 
glibc-2.31-4.fc32.x86_64 libpmem-1.8-2.fc32.x86_64
(gdb) bt
#0  0x00007b2909ca09e5 in raise () from /lib64/libc.so.6
#1  0x00007b2909c89895 in abort () from /lib64/libc.so.6
#2  0x0000000000a57de2 in ExceptionalCondition (conditionName=0xb232b8 
"!(page->xlp_pageaddr == ptr - (ptr % 8192))", errorType=0xb22c41 
"FailedAssertion", fileName=0xb22c3a "xlog.c", lineNumber=1813) at assert.c:54
#3  0x000000000055f0c4 in GetXLogBuffer (ptr=20971520) at xlog.c:1813
#4  0x000000000055e9c1 in CopyXLogRecordToWAL (write_len=2063, 
isLogSwitch=false, rdata=0x1265268, StartPos=20970544, EndPos=20972632) at 
xlog.c:1515
#5  0x000000000055df88 in XLogInsertRecord (rdata=0xdd4970 <hdr_rdt>, 
fpw_lsn=20970480, flags=1 '\001') at xlog.c:1088
#6  0x000000000057477d in XLogInsert (rmid=10 '\n', info=0 '\000') at 
xloginsert.c:462
#7  0x00000000004df1dc in heap_insert (relation=0x7b2900a63e28, tup=0x1361300, 
cid=1, options=0, bistate=0x0) at heapam.c:2009
#8  0x00000000004febec in toast_save_datum (rel=0x7b2900a6fc78, 
value=135416003461200, oldexternal=0x0, options=0) at tuptoaster.c:1658
#9  0x00000000004fd67d in toast_insert_or_update (rel=0x7b2900a6fc78, 
newtup=0x7b2900a0b050, oldtup=0x0, options=0) at tuptoaster.c:816
#10 0x00000000004df4de in heap_prepare_insert (relation=0x7b2900a6fc78, 
tup=0x7b2900a0b050, xid=325, cid=1, options=0) at heapam.c:2088
#11 0x00000000004deba6 in heap_insert (relation=0x7b2900a6fc78, 
tup=0x7b2900a0b050, cid=1, options=0, bistate=0x0) at heapam.c:1883
#12 0x00000000004dff75 in simple_heap_insert (relation=0x7b2900a6fc78, 
tup=0x7b2900a0b050) at heapam.c:2386
#13 0x00000000005902c3 in CatalogTupleInsert (heapRel=0x7b2900a6fc78, 
tup=0x7b2900a0b050) at indexing.c:189
#14 0x0000000000886527 in InsertRule (rulname=0x13e0e30 "_RETURN", evtype=1, 
eventrel_oid=12499, evinstead=true, event_qual=0x0, action=0x13e0df8, 
replace=false) at rewriteDefine.c:143
#15 0x0000000000887467 in DefineQueryRewrite (rulename=0x13e0e30 "_RETURN", 
event_relid=12499, event_qual=0x0, event_type=CMD_SELECT, is_instead=true, 
replace=false, action=0x13e0df8) at rewriteDefine.c:533
#16 0x00000000006d536d in DefineViewRules (viewOid=12499, viewParse=0x1350a30, 
replace=false) at view.c:327
#17 0x00000000006d5aba in StoreViewQuery (viewOid=12499, viewParse=0x1350a30, 
replace=false) at view.c:586
#18 0x00000000006d504e in DefineVirtualRelation (relation=0x1345578, 
tlist=0x1334b80, replace=false, options=0x0, viewParse=0x131dbf8) at view.c:260
#19 0x00000000006d5a49 in DefineView (stmt=0x1377f00, 
    queryString=0x1385d70 "\n/*\n * 5.21\n * COLUMNS view\n */\n\nCREATE VIEW 
columns AS\n    SELECT CAST(current_database() AS sql_identifier) AS 
table_catalog,\n", ' ' <repeats 11 times>, "CAST(nc.nspname AS sql_identifier) 
AS table_schema,\n         "..., stmt_location=0, stmt_len=6191) at view.c:565
#20 0x00000000008e9f5a in ProcessUtilitySlow (pstate=0x1303a88, 
pstmt=0x1299388, 
    queryString=0x1385d70 "\n/*\n * 5.21\n * COLUMNS view\n */\n\nCREATE VIEW 
columns AS\n    SELECT CAST(current_database() AS sql_identifier) AS 
table_catalog,\n", ' ' <repeats 11 times>, "CAST(nc.nspname AS sql_identifier) 
AS table_schema,\n         "..., context=PROCESS_UTILITY_TOPLEVEL, params=0x0, 
queryEnv=0x0, dest=0xc83d80 <debugtupDR>, completionTag=0x7ffc82d99db0 "") at 
utility.c:1468
#21 0x00000000008e8dc8 in standard_ProcessUtility (pstmt=0x1299388, 
    queryString=0x1385d70 "\n/*\n * 5.21\n * COLUMNS view\n */\n\nCREATE VIEW 
columns AS\n    SELECT CAST(current_database() AS sql_identifier) AS 
table_catalog,\n", ' ' <repeats 11 times>, "CAST(nc.nspname AS sql_identifier) 
AS table_schema,\n         "..., context=PROCESS_UTILITY_TOPLEVEL, params=0x0, 
queryEnv=0x0, dest=0xc83d80 <debugtupDR>, completionTag=0x7ffc82d99db0 "") at 
utility.c:927
#22 0x00000000008e7efd in ProcessUtility (pstmt=0x1299388, 
    queryString=0x1385d70 "\n/*\n * 5.21\n * COLUMNS view\n */\n\nCREATE VIEW 
columns AS\n    SELECT CAST(current_database() AS sql_identifier) AS 
table_catalog,\n", ' ' <repeats 11 times>, "CAST(nc.nspname AS sql_identifier) 
AS table_schema,\n         "..., context=PROCESS_UTILITY_TOPLEVEL, params=0x0, 
queryEnv=0x0, dest=0xc83d80 <debugtupDR>, completionTag=0x7ffc82d99db0 "") at 
utility.c:360
#23 0x00000000008e6ec8 in PortalRunUtility (portal=0x12894e8, pstmt=0x1299388, 
isTopLevel=true, setHoldSnapshot=false, dest=0xc83d80 <debugtupDR>, 
completionTag=0x7ffc82d99db0 "") at pquery.c:1175
#24 0x00000000008e70e5 in PortalRunMulti (portal=0x12894e8, isTopLevel=true, 
setHoldSnapshot=false, dest=0xc83d80 <debugtupDR>, altdest=0xc83d80 
<debugtupDR>, completionTag=0x7ffc82d99db0 "") at pquery.c:1321
#25 0x00000000008e661a in PortalRun (portal=0x12894e8, 
count=9223372036854775807, isTopLevel=true, run_once=true, dest=0xc83d80 
<debugtupDR>, altdest=0xc83d80 <debugtupDR>, completionTag=0x7ffc82d99db0 "") 
at pquery.c:796
#26 0x00000000008e053d in exec_simple_query (
    query_string=0x1385d70 "\n/*\n * 5.21\n * COLUMNS view\n */\n\nCREATE VIEW 
columns AS\n    SELECT CAST(current_database() AS sql_identifier) AS 
table_catalog,\n", ' ' <repeats 11 times>, "CAST(nc.nspname AS sql_identifier) 
AS table_schema,\n         "...) at postgres.c:1215
#27 0x00000000008e4826 in PostgresMain (argc=10, argv=0x12187c0, 
dbname=0x123ace0 "template1", username=0x121f740 "user") at postgres.c:4236
#28 0x0000000000757c61 in main (argc=10, argv=0x12187c0) at main.c:224

Reply via email to