Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1ga0OW-0007Qr-9k for pgsql-admin@arkaria.postgresql.org; Thu, 20 Dec 2018 15:37:52 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1ga0OU-0002eQ-VM for pgsql-admin@arkaria.postgresql.org; Thu, 20 Dec 2018 15:37:50 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1ga0OU-0002eJ-FU for pgsql-admin@lists.postgresql.org; Thu, 20 Dec 2018 15:37:50 +0000 Received: from mail-qt1-x843.google.com ([2607:f8b0:4864:20::843]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1ga0OR-0005z5-63 for pgsql-admin@lists.postgresql.org; Thu, 20 Dec 2018 15:37:49 +0000 Received: by mail-qt1-x843.google.com with SMTP id l12so2225270qtf.8 for ; Thu, 20 Dec 2018 07:37:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=2ndquadrant-com.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:mime-version:content-disposition :content-transfer-encoding:in-reply-to:user-agent; bh=5gktk7ahEWIWwOOQaRK6NGhxltlmQ/Ohrhhg9i4mlHQ=; b=uBnkKafeKgRaSbVL+mhD3pYhDUDqF+0cpmd1hmDW13AK6zEI/dQFSWTCeRIXHqgKTF 0OPtFSKqSoqFHDSvZ4BqqMzH5JD/eY0L/6JAC284L8bq2wUUhqoIgdE7zdLk0RAduCrs ZsSm7rRDDJ2JjTVRC9Z13Ed4v6cHgjXaFbfp4vhDx0ca65WUYumcnn1uv75dODJdN9vZ qu5HllLVjPyGXzIBQY3fYKQwXMF7BOWF1W5iA65H0vVgHBYe9qAXtVQtWNRBNCbB83uI InPcOuyUS/3d5GXmUot1vgxVu5Hg8GbK15RFTttTt9An5jovMDFaBLt7rF6AhWGMna85 0kwQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:mime-version :content-disposition:content-transfer-encoding:in-reply-to :user-agent; bh=5gktk7ahEWIWwOOQaRK6NGhxltlmQ/Ohrhhg9i4mlHQ=; b=F/ZGILF4aPcZD3sNtpvfjitOBYHgo4RsoR+errDw+8W4XxmL9Gs8+1A/nNN0mBbxOD /MhEOJ05VKKd6JwLY2OTENyRKyWrgrlRYzd1nW5t9PsODvkMXoAmeL1e7gtI7dhEb4uf 0Zp8vhCa7lyd6u9xpC8rhtWSAAEEdDboVSLIaBH7cydzTZChretdYU+B8AisoCKhUhX3 zRunGld2OFEvIYkDP0wJI9Li+D3DU03y0aSsRJYH4N4vZnyLbSA3DFilLDyYfu273k/l 8WMmOFGYkGRF/yRDAr8UZkV4xnK5nJN3BaHWqG78Tq6k3RTujPWr3mLV9gwgRNH8rY/2 /xOA== X-Gm-Message-State: AA+aEWayowF3f/7LbZs4DFILfJVsYUisaofLTiuAlODatcuuDcQAl535 wAeriV/War5SKRRrx2xHF2BeNw== X-Google-Smtp-Source: AFSGD/WwqGUMBTkP+XI2fPIg3OVZLyPomYdRGD4VemeZkvCQs0lkuL6APhPhUkh3hkh/cLZndoqwbA== X-Received: by 2002:aed:3084:: with SMTP id 4mr9791795qtf.30.1545320266048; Thu, 20 Dec 2018 07:37:46 -0800 (PST) Received: from alvin.alvh.no-ip.org ([201.186.80.67]) by smtp.gmail.com with ESMTPSA id a3sm3934814qta.21.2018.12.20.07.37.45 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 20 Dec 2018 07:37:45 -0800 (PST) Received: by alvin.alvh.no-ip.org (Postfix, from userid 1000) id 9848B693; Thu, 20 Dec 2018 12:37:43 -0300 (-03) Date: Thu, 20 Dec 2018 12:37:43 -0300 From: Alvaro Herrera To: Devendra Yadav Cc: pgsql-admin@lists.postgresql.org Subject: Re: Stats getting corrupted Message-ID: <20181220153743.slaxsk4vjcvwwe6h@alvherre.pgsql> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: NeoMutt/20180716 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk 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