Re: Stats getting corrupted

From: Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>
To: Devendra Yadav <devendraydba(at)gmail(dot)com>
Cc: pgsql-admin(at)lists(dot)postgresql(dot)org
Subject: Re: Stats getting corrupted
Date: 2018-12-20 15:37:43
Message-ID: 20181220153743.slaxsk4vjcvwwe6h@alvherre.pgsql
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

On 2018-Dec-20, Devendra Yadav wrote:

> Dear All,
>
> The stats file in *pg_stat_tmp *are getting corrupted. Even earlier the
> files in *pg_stat* got corrupted. They show ?? ?? when you list the files
> in folder. Also we can see them in the error log.
> it says " *could not open statistics file 'pg_stat_tml/db_0.tmp': to
> 'pg_stat_tmp/db_0.stat': Input/output error".*

You have problems related to the disk or operating system. This is not
PostgreSQL's fault. See `dmesg` or whatever OS diagnostics you have.

I suggest never to transcribe error messages manually. Copy & paste instead.
When transcribing you're likely to make mistakes that obscure important
details.

> After doing e2fsck (file system scan ) it is fixed but that needs downtime
> and also it removes the file. What is the impact if the file is being
> removed ?

Deleting those files will lose some statistical counters, but it's not
critical data; you're advised to run ANALYZE on all databases after
making the disk work properly again.

--
Álvaro Herrera https://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

In response to

Browse pgsql-admin by date

  From Date Subject
Next Message Pepe TD Vo 2018-12-20 17:53:03 Re: install Postgres on RHED 7
Previous Message Jehan-Guillaume (ioguix) de Rorthais 2018-12-20 15:35:14 Re: Shared data dir for multiple postgresql nodes