pg14b2: FailedAssertion("_bt_posting_valid(nposting)", File: "nbtdedup.c", ...

From: Justin Pryzby <pryzby(at)telsasoft(dot)com>
To: Peter Geoghegan <pg(at)bowt(dot)ie>
Cc: pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: pg14b2: FailedAssertion("_bt_posting_valid(nposting)", File: "nbtdedup.c", ...
Date: 2021-06-27 21:57:03
Message-ID: 20210627215703.GA2712@telsasoft.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

This is crashing repeatedly during insert/update immediately after upgrading an
instance to v14, from v13.3. In case it matters, the cluster was originally
initdb at 13.2.

TRAP: FailedAssertion("_bt_posting_valid(nposting)", File: "nbtdedup.c", Line: 1062, PID: 28580)
postgres: telsasoft ts 127.0.0.1(52250) INSERT(ExceptionalCondition+0x8d)[0x967d1d]
postgres: telsasoft ts 127.0.0.1(52250) INSERT(_bt_swap_posting+0x2cd)[0x507cdd]
postgres: telsasoft ts 127.0.0.1(52250) INSERT[0x509a14]
postgres: telsasoft ts 127.0.0.1(52250) INSERT(_bt_doinsert+0xcb7)[0x50d0b7]
postgres: telsasoft ts 127.0.0.1(52250) INSERT(btinsert+0x52)[0x5130f2]
postgres: telsasoft ts 127.0.0.1(52250) INSERT(ExecInsertIndexTuples+0x231)[0x687b81]
postgres: telsasoft ts 127.0.0.1(52250) INSERT[0x6b8718]
postgres: telsasoft ts 127.0.0.1(52250) INSERT[0x6b9297]
postgres: telsasoft ts 127.0.0.1(52250) INSERT(standard_ExecutorRun+0x142)[0x688b32]
postgres: telsasoft ts 127.0.0.1(52250) INSERT[0x82da8a]
postgres: telsasoft ts 127.0.0.1(52250) INSERT[0x82e673]
postgres: telsasoft ts 127.0.0.1(52250) INSERT[0x82e936]
postgres: telsasoft ts 127.0.0.1(52250) INSERT(PortalRun+0x2eb)[0x82ec8b]
postgres: telsasoft ts 127.0.0.1(52250) INSERT(PostgresMain+0x1f97)[0x82c777]
postgres: telsasoft ts 127.0.0.1(52250) INSERT[0x48f71a]
postgres: telsasoft ts 127.0.0.1(52250) INSERT(PostmasterMain+0x1138)[0x794c98]
postgres: telsasoft ts 127.0.0.1(52250) INSERT(main+0x6f2)[0x491292]

< 2021-06-27 23:46:43.257 CAT >DETAIL: Failed process was running: INSERT INTO alarms(...

#3 0x0000000000507cdd in _bt_swap_posting (newitem=newitem(at)entry=0x2011c00, oposting=oposting(at)entry=0x7f6de58e2a78, postingoff=postingoff(at)entry=62) at nbtdedup.c:1062
nhtids = <optimized out>
replacepos = 0x2011dac ""
nposting = 0x2011c28
__func__ = "_bt_swap_posting"
#4 0x0000000000509a14 in _bt_insertonpg (rel=rel(at)entry=0x7f6dfd3cd628, itup_key=itup_key(at)entry=0x2011b40, buf=15, cbuf=cbuf(at)entry=0, stack=stack(at)entry=0x2011bd8, itup=0x2011c00, itup(at)entry=0x200d608, itemsz=16,
newitemoff=2, postingoff=62, split_only_page=split_only_page(at)entry=false) at nbtinsert.c:1174
itemid = 0x7f6de58e0e1c
page = 0x7f6de58e0e00 "\200"
opaque = 0x7f6de58e2df0
isleaf = true
isroot = false
isrightmost = false
isonly = false
oposting = 0x7f6de58e2a78
origitup = <optimized out>
nposting = 0x0
__func__ = "_bt_insertonpg"
#5 0x000000000050d0b7 in _bt_doinsert (rel=rel(at)entry=0x7f6dfd3cd628, itup=itup(at)entry=0x200d608, checkUnique=checkUnique(at)entry=UNIQUE_CHECK_NO, indexUnchanged=indexUnchanged(at)entry=false,
heapRel=heapRel(at)entry=0x7f6dfd48ba80) at nbtinsert.c:257
newitemoff = 0
is_unique = false
insertstate = {itup = 0x200d608, itemsz = 16, itup_key = 0x2011b40, buf = 15, bounds_valid = true, low = 2, stricthigh = 3, postingoff = 62}
itup_key = <optimized out>
checkingunique = <optimized out>
#6 0x00000000005130f2 in btinsert (rel=0x7f6dfd3cd628, values=<optimized out>, isnull=<optimized out>, ht_ctid=0x212e250, heapRel=0x7f6dfd48ba80, checkUnique=UNIQUE_CHECK_NO, indexUnchanged=false,
indexInfo=0x200d2e8) at nbtree.c:199
result = <optimized out>
itup = 0x200d608
#7 0x0000000000687b81 in ExecInsertIndexTuples (resultRelInfo=resultRelInfo(at)entry=0x200cd90, slot=slot(at)entry=0x212e220, estate=estate(at)entry=0x212c6b0, update=update(at)entry=false, noDupErr=noDupErr(at)entry=false,
specConflict=specConflict(at)entry=0x0, arbiterIndexes=arbiterIndexes(at)entry=0x0) at execIndexing.c:415

(gdb) p *newitem
$2 = {t_tid = {ip_blkid = {bi_hi = 0, bi_lo = 22}, ip_posid = 4}, t_info = 32784}
(gdb) p *oposting
$3 = {t_tid = {ip_blkid = {bi_hi = 0, bi_lo = 16}, ip_posid = 8333}, t_info = 41824}

I will save a copy of the data dir and see if reindexing helps.
Let me know if there's anything else I can provide.

--
Justin

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Geoghegan 2021-06-27 22:08:13 Re: pg14b2: FailedAssertion("_bt_posting_valid(nposting)", File: "nbtdedup.c", ...
Previous Message Peter Geoghegan 2021-06-27 20:36:19 What is "wraparound failure", really?