Re: Mysterious table that exists but doesn't exist

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: dale(dot)fukami(at)gmail(dot)com
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Mysterious table that exists but doesn't exist
Date: 2013-04-16 21:04:19
Message-ID: 8832.1366146259@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Dale Fukami <dale(dot)fukami(at)gmail(dot)com> writes:
> I'm having a problem on a standby server (streaming replication) where a
> table seems to exist but is not queryable. Essentially a select statement
> (and drop/insert/etc) fails but \d and pg_tables show it exists. The table
> exists on the master (and is queryable) and replication is still working in
> that changes to the master table don't cause errors on the standby and
> changes to other tables are replicated and verified to be on the standby.

That's peculiar. The most likely theories seem to be
(1) corruption in the standby's pg_class indexes, such that an index
search for relname = 'tracked_deductibles' fails to find the row,
although it is found by seqscans; or
(2) some type of visibility issue causing SnapshotNow operations to
think the row is invalid, though it is valid to MVCC queries.

Either way, if it's working on the master, then you've had a replication
failure since the standby's files evidently don't match the master's.

What PG version is this (and which versions have been installed since
the replication was set up)? Have you had any system-level crashes on
the standby?

> 2) If there were corruption or something in the data for that particular
> table on the standby only, would replication report a failure (i.e., be
> unable to apply the binary changes) or would the binary changes still just
> sort of happen overtop the bad data?

Depends. It's not impossible that the corruption could magically
disappear, if there's a full-page update sent from the master that
overwrites whatever the problem is. Incremental updates on the same
page would not make things better, of course, and could easily make them
worse. It's unlikely that an incremental WAL replay operation would
notice a problem that evidently isn't being noticed by regular queries.

regards, tom lane

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2013-04-16 21:09:19 Re: [GENERAL] currval and DISCARD ALL
Previous Message John R Pierce 2013-04-16 21:01:37 Re: Mysterious table that exists but doesn't exist