Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1Vlrmo-0001aW-CR for pgsql-bugs@arkaria.postgresql.org; Thu, 28 Nov 2013 02:57:02 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1Vlrmn-0001qI-Mc for pgsql-bugs@arkaria.postgresql.org; Thu, 28 Nov 2013 02:57:01 +0000 Received: from makus.postgresql.org ([2001:4800:7903:4::125]) by malur.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1Vlrmm-0001pz-VP for pgsql-bugs@postgresql.org; Thu, 28 Nov 2013 02:57:01 +0000 Received: from smtprelay0196.b.hostedemail.com ([64.98.42.196] helo=smtprelay.b.hostedemail.com) by makus.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1Vlrmj-0000NW-BI for pgsql-bugs@postgresql.org; Thu, 28 Nov 2013 02:57:00 +0000 Received: from filter.hostedemail.com (b-bigip1 [10.5.19.254]) by smtprelay03.b.hostedemail.com (Postfix) with ESMTP id 8358B1A733F; Thu, 28 Nov 2013 02:56:56 +0000 (UTC) X-Session-Marker: 616C76686572726540616C76682E6E6F2D69702E6F7267 X-Spam-Summary: 50, 0, 0, , d41d8cd98f00b204, alvherre@alvh.no-ip.org, :::, RULES_HIT:41:355:379:599:800:960:967:973:988:989:1260:1277:1311:1312:1313:1314:1345:1359:1437:1515:1516:1518:1519:1534:1542:1593:1594:1595:1596:1711:1730:1747:1777:1792:2393:2525:2560:2563:2682:2685:2828:2859:2899:2901:2933:2937:2939:2942:2945:2947:2951:2954:3022:3138:3139:3140:3141:3142:3353:3865:3866:3867:3868:3870:3871:3872:3934:3936:3938:3941:3944:3947:3950:3953:3956:3959:4321:4605:4659:5007:6261:8957:9025:9121:10004:10400:10848:11026:11256:11257:11473:11658:11914:12043:12296:12438:12517:12519:12555:12740:13870:13891:13894:13895, 0, RBL:none, CacheIP:none, Bayesian:0.5, 0.5, 0.5, Netcheck:none, DomainCache:0, MSF:not bulk, SPF:fn, MSBL:0, DNSBL:none, Custom_rules:0:0:0 X-HE-Tag: loss91_3c86689cf5a40 X-Filterd-Recvd-Size: 3111 Received: from eldon.alvh.no-ip.org (pc-223-216-160-190.cm.vtr.net [190.160.216.223]) (Authenticated sender: alvherre@alvh.no-ip.org) by omf14.b.hostedemail.com (Postfix) with ESMTPA; Thu, 28 Nov 2013 02:56:55 +0000 (UTC) Received: by eldon.alvh.no-ip.org (Postfix, from userid 1000) id 251151FC8; Wed, 27 Nov 2013 23:56:54 -0300 (CLST) Date: Wed, 27 Nov 2013 23:56:54 -0300 From: Alvaro Herrera To: strahinjak@nordeus.com Cc: pgsql-bugs@postgresql.org Subject: Re: BUG #8632: file "pg_subtrans/CEC0" doesn't exist, reading as zeroes Message-ID: <20131128025653.GD5513@eldon.alvh.no-ip.org> References: MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) X-Pg-Spam-Score: -1.9 (-) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-bugs Precedence: bulk Sender: pgsql-bugs-owner@postgresql.org strahinjak@nordeus.com wrote: Uh, this is a bit funny. It failed to find the file for a long time and didn't think to error out, instead choosing to read the requested page as zeroes: > 2013-11-26 12:24:54 CET [6393]: [7-1]LOG: file "pg_subtrans/CEC0" doesn't > exist, reading as zeroes > 2013-11-26 12:24:54 CET [6393]: [8-1]CONTEXT: xlog redo xid assignment xtop > 3468737450: subxacts: 3468738448 3468738450 3468738453 3468738455 3468738457 > 3468738459 3468738461 3468738463 3468738465 3468738467 3468738469 3468738471 > 3468738473 3468738475 3468738477 3468738479 3468738481 3468738483 3468738485 > 3468738487 3468738489 3468738491 3468738493 3468738495 3468738497 3468738499 > 3468738501 3468738503 3468738505 3468738507 3468738530 3468738532 3468738534 > 3468738536 3468738538 3468738540 3468738542 3468738544 3468738546 3468738548 > 3468738550 3468738552 3468738554 3468738556 3468738558 3468738560 3468738562 > 3468738564 3468738566 3468738568 3468738570 3468738572 3468738574 3468738576 > 3468738578 3468738580 3468738582 3468738584 3468738586 3468738588 3468738590 > 3468738592 3468738595 3468738597 But as soon as the pg_subtrans file existed, any other error (seek or read failure) is fatal: > 2013-11-26 12:24:57 CET [6393]: [103-1]FATAL: could not access status of > transaction 3468818432 > 2013-11-26 12:24:57 CET [6393]: [104-1]DETAIL: Could not read from file > "pg_subtrans/CEC1" at offset 253952: Success. Both these things happen in SlruPhysicalReadPage(). I think those hard failures are a mistake. In other words, we should do something like this, which matches what happens if ENOENT: if (lseek(fd, (off_t) offset, SEEK_SET) < 0) { if (InRecovery) { ereport(LOG, (errmsg("file \"%s\" doesn't contain page %u, reading as zeroes", path, page_number))); MemSet(shared->page_buffer[slotno], 0, BLCKSZ); return true; } slru_errcause = SLRU_SEEK_FAILED; slru_errno = errno; close(fd); return false; } And equivalently for the read() failure. -- Álvaro Herrera http://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Training & Services -- Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs