pg_stat_all_tables.vacuum_count corrupted after pg_stat_reset()

From: Itagaki Takahiro <itagaki(dot)takahiro(at)gmail(dot)com>
To: pgsql-bugs <pgsql-bugs(at)postgresql(dot)org>
Subject: pg_stat_all_tables.vacuum_count corrupted after pg_stat_reset()
Date: 2011-03-07 11:44:45
Message-ID: AANLkTikheK4VsBXFw+6Y+t_ZH6GPBTm53uBrpLAnPe5D@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Some of pg_stat_all_tables.vacuum_count, autovacuum_count, analyze_count
and autoanalyze_count will be filled with garbages after pg_stat_reset().
Not all of the tables, but some of tables had corrupted counters.
It looks we access freed memory. 9187201950435737471 is 7F7F7F7F7F7F7F7F
filled by CLOBBER_FREED_MEMORY.

with PG 9.1dev (dfe18f18d262df731378cbf38a4136f08ca119a5) on 64bit Linux
build with --enable-cassert and --enable-debug.

postgres=# SELECT * FROM pg_stat_all_tables WHERE vacuum_count > 10000;
relid | schemaname | relname | seq_scan | seq_tup_read | idx_scan |
idx_tup_fetch | n_tup_ins | n_tup_upd | n_tup_del | n_tup_hot_upd |
n_live_tup | n_dead_tup | last_vacuum | last_autovac
uum | last_analyze | last_autoanalyze | vacuum_count |
autovacuum_count | analyze_count | autoanalyze_count
-------+------------+---------+----------+--------------+----------+---------------+-----------+-----------+-----------+---------------+------------+------------+-------------+-------------
----+--------------+------------------+--------------+------------------+---------------+-------------------
(0 rows)

postgres=# SELECT pg_stat_reset();
pg_stat_reset
---------------

(1 row)

postgres=# SELECT * FROM pg_stat_all_tables WHERE vacuum_count > 10000;
relid | schemaname | relname | seq_scan | seq_tup_read | idx_scan |
idx_tup_fetch | n_tup_ins | n_tup_upd | n_tup_del | n_tup_hot_upd |
n_live_tup | n_dead_tup | last_vacuum | last_autovac
uum | last_analyze | last_autoanalyze | vacuum_count |
autovacuum_count | analyze_count | autoanalyze_count
-------+------------+---------+----------+--------------+----------+---------------+-----------+-----------+-----------+---------------+------------+------------+-------------+-------------
----+--------------+------------------+---------------------+---------------------+---------------------+---------------------
1255 | pg_catalog | pg_proc | 0 | 0 | 2 |
2 | 0 | 0 | 0 | 0 |
0 | 0 | |
| | | 9187201950435737471 |
9187201950435737471 | 9187201950435737471 | 9187201950435737471
1247 | pg_catalog | pg_type | 0 | 0 | 1 |
1 | 0 | 0 | 0 | 0 |
0 | 0 | |
| | | 9187201950435737471 |
9187201950435737471 | 9187201950435737471 | 9187201950435737471
(2 rows)

--
Itagaki Takahiro

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Jakub Ouhrabka 2011-03-07 14:15:43 Re: Corrupted index on 9.0.3 streaming hot standby
Previous Message Kevin Grittner 2011-03-06 18:32:27 Re: BUG #5915: OldSerXidAdd inflates pg_serial too much