Re: buffer assertion tripping under repeat pgbench load

Greg Smith <greg@2ndquadrant.com>

From: Greg Smith <greg@2ndQuadrant.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Simon Riggs <simon@2ndQuadrant.com>, Andres Freund <andres@2ndQuadrant.com>, PostgreSQL-development <pgsql-hackers@postgresql.org>
Date: 2012-12-26T17:54:46Z
Lists: pgsql-hackers
To try and speed up replicating this problem I switched to a smaller 
database scale, 100, and I was able to get a crash there.  Here's the 
latest:

2012-12-26 00:01:19 EST [2278]: WARNING:  refcount of base/16384/57610 
blockNum=118571, flags=0x106 is 1073741824 should be 0, globally: 0
2012-12-26 00:01:19 EST [2278]: WARNING:  buffers with non-zero refcount 
is 1
TRAP: FailedAssertion("!(RefCountErrors == 0)", File: "bufmgr.c", Line: 
1720)

That's the same weird 1073741824 count as before.  I was planning to 
dump some index info, but then I saw this:

$ psql -d pgbench -c "select relname,relkind,relfilenode from pg_class 
where relfilenode=57610"
      relname      | relkind | relfilenode
------------------+---------+-------------
  pgbench_accounts | r       |       57610

Making me think this isn't isolated to being an index problem.  I tried 
to soldier on with pg_filedump anyway.  It looks like the last version I 
saw there (9.2.0 from November) doesn't compile anymore:

$ make -f Makefile.contrib USE_PGXS=1
gcc -O2 -Wall -Wmissing-prototypes -Wpointer-arith 
-Wdeclaration-after-statement -Wendif-labels -Wmissing-format-attribute 
-Wformat-security -fno-strict-aliasing -fwrapv -g -I. -I. 
-I/var/lib/pgsql/pgwork/inst/baseline/include/server 
-I/var/lib/pgsql/pgwork/inst/baseline/include/internal -D_GNU_SOURCE 
-c -o pg_filedump.o pg_filedump.c -MMD -MP -MF .deps/pg_filedump.Po
pg_filedump.c: In function ‘FormatHeader’:
pg_filedump.c:617: error: request for member ‘xlogid’ in something not a 
structure or union
pg_filedump.c:617: error: request for member ‘xrecoff’ in something not 
a structure or union
pg_filedump.c: In function ‘FormatItem’:
pg_filedump.c:904: error: invalid application of ‘sizeof’ to incomplete 
type ‘HeapTupleHeaderData’
...

Lots more after that.  Does this need an update or is there just a devel 
version I should grab?

-- 
Greg Smith   2ndQuadrant US    greg@2ndQuadrant.com   Baltimore, MD
PostgreSQL Training, Services, and 24x7 Support www.2ndQuadrant.com


Commits

  1. Follow TLI of last replayed record, not recovery target TLI, in walsenders.

  2. Avoid holding vmbuffer pin after VACUUM.