Re: Issue on restore / recover - Mailing list pgsql-admin

From Alvaro Herrera
Subject Re: Issue on restore / recover
Date
Msg-id 20180102153854.nldw2ouxnehtp63k@alvherre.pgsql
Whole thread Raw
In response to Issue on restore / recover  (flumbador@virgilio.it)
Responses Re: Issue on restore / recover
List pgsql-admin
flumbador@virgilio.it wrote:

> During the restore 3 files were missing; these three files belong to a table with high transaction workload, and for
sureduring the backup many transactions had modified this table and those missing files. What is surprising to me is
thateven if the files were missing the recover phase ended successfully. I expect an error (for example file not found)
raisedwhen postgresql try to apply the wal entries related to this table and those files. After the recover I find that
thesethree file has been created during recover but when I try to query the table I get the error:
 
> 
> db4=# select count(*) from pgbench_accounts ;
> 
> ERROR: could not read block 1999996 in file "pg_tblspc/16471/PG_9.4_201409291/16474/16593.15": read only 0 of 8192
bytes

Can you please get a backtrace from this error?  I suspect that the
problem here is that the planner is trying to estimate cardinality by
descending a btree index, and failing because the index points to a part
of the table that has been truncated.  But if the table has been
truncated because it's unlogged, then the index should have been
truncated too; and if it's a permanent table, then it has been truncated
improperly (because no index pointer to the truncated part should
remain).

What files do exist for pg_tblspc/16471/PG_9.4_201409291/16474/16593* ?
(In particular I'm curious about whether 16593.14 exists and what size
it is)

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


pgsql-admin by date:

Previous
From: Stephen Frost
Date:
Subject: Re: Issue on restore / recover
Next
From: Jorge Daniel
Date:
Subject: pt_toast table seems to be