pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
Temporary table has become problematically persistent
5+ messages / 3 participants
[nested] [flat]

* Temporary table has become problematically persistent
@ 2020-05-04 23:24  Ricky Ramirez <ricky@reddit.com>
  0 siblings, 2 replies; 5+ messages in thread

From: Ricky Ramirez @ 2020-05-04 23:24 UTC (permalink / raw)
  To: pgsql-general@lists.postgresql.org

Hello,

We have run into a strange situation with our database. A temporary table
was created some time ago and that session has since died. However, the
temporary table stuck around. It's been around long enough that postgres
stopped accepting writes to prevent transaction ID wraparound. Problem is,
it's a temporary table and the session that it's associated with is gone,
so we cannot vacuum it nor even drop the table. We even restarted postgres
and the temporary table was still there!

The table shows up in pg_class as a temporary table with zero tuples. The
table replicated over to other hosts. We were able to promote a replica and
then single user mode the replica and drop the offending table. I still
have the original broken database available for debugging. Can I provide
any additional debugging information?

Thanks,

Ricky

^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* Re: Temporary table has become problematically persistent
@ 2020-05-04 23:54  Tom Lane <tgl@sss.pgh.pa.us>
  parent: Ricky Ramirez <ricky@reddit.com>
  1 sibling, 1 reply; 5+ messages in thread

From: Tom Lane @ 2020-05-04 23:54 UTC (permalink / raw)
  To: Ricky Ramirez <ricky@reddit.com>; +Cc: pgsql-general@lists.postgresql.org

Ricky Ramirez <ricky@reddit.com> writes:
> We have run into a strange situation with our database. A temporary table
> was created some time ago and that session has since died. However, the
> temporary table stuck around. It's been around long enough that postgres
> stopped accepting writes to prevent transaction ID wraparound. Problem is,
> it's a temporary table and the session that it's associated with is gone,
> so we cannot vacuum it nor even drop the table. We even restarted postgres
> and the temporary table was still there!

Hm, what PG version is this?  I thought we'd fixed that hazard quite some
while back.

			regards, tom lane





^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* Re: Temporary table has become problematically persistent
@ 2020-05-05 00:21  Ricky Ramirez <ricky@reddit.com>
  parent: Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 5+ messages in thread

From: Ricky Ramirez @ 2020-05-05 00:21 UTC (permalink / raw)
  To: Tom Lane <tgl@sss.pgh.pa.us>; +Cc: pgsql-general@lists.postgresql.org

Forgive me for forgetting the basics PG 11.2 on Ubuntu Bionic, amd64. No
extensions enabled.

On Mon, May 4, 2020 at 4:54 PM Tom Lane <tgl@sss.pgh.pa.us> wrote:

> Ricky Ramirez <ricky@reddit.com> writes:
> > We have run into a strange situation with our database. A temporary table
> > was created some time ago and that session has since died. However, the
> > temporary table stuck around. It's been around long enough that postgres
> > stopped accepting writes to prevent transaction ID wraparound. Problem
> is,
> > it's a temporary table and the session that it's associated with is gone,
> > so we cannot vacuum it nor even drop the table. We even restarted
> postgres
> > and the temporary table was still there!
>
> Hm, what PG version is this?  I thought we'd fixed that hazard quite some
> while back.
>
>                         regards, tom lane
>

^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* Re: Temporary table has become problematically persistent
@ 2020-05-05 01:17  Jerry Sievers <gsievers19@comcast.net>
  parent: Ricky Ramirez <ricky@reddit.com>
  1 sibling, 1 reply; 5+ messages in thread

From: Jerry Sievers @ 2020-05-05 01:17 UTC (permalink / raw)
  To: Ricky Ramirez <ricky@reddit.com>; +Cc: pgsql-general@lists.postgresql.org

Ricky Ramirez <ricky@reddit.com> writes:

> Hello,
>
> We have run into a strange situation with our database. A temporary
> table was created some time ago and that session has since died.
> However, the temporary table stuck around. It's been around long
> enough that postgres stopped accepting writes to prevent
> transaction ID wraparound. Problem is, it's a temporary table and the
> session that it's associated with is gone, so we cannot vacuum it nor
> even drop the table. We even restarted postgres and the temporary
> table was still there!

What happened when you tried to drop the temp table?

>
> The table shows up in pg_class as a temporary table with zero tuples.
> The table replicated over to other hosts. We were able to promote a
> replica and then single user mode the replica and drop the offending
> table. I still have the original broken database available for
> debugging. Can I provide any additional debugging information?
>
> Thanks,
>
> Ricky
>
>

-- 
Jerry Sievers
Postgres DBA/Development Consulting
e: postgres.consulting@comcast.net





^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* Re: Temporary table has become problematically persistent
@ 2020-05-06 01:27  Ricky Ramirez <ricky@reddit.com>
  parent: Jerry Sievers <gsievers19@comcast.net>
  0 siblings, 0 replies; 5+ messages in thread

From: Ricky Ramirez @ 2020-05-06 01:27 UTC (permalink / raw)
  To: Jerry Sievers <gsievers19@comcast.net>; +Cc: pgsql-general@lists.postgresql.org

We couldn't drop the table in the normal setup because of the wraparound
protection measures. Specifically: "ERROR:  database is not accepting
commands to avoid wraparound data loss in database"

We also tried vacuuming the table. The vacuum didn't generate an error (the
wraparound warning was printed), but nothing appeared to change from that.
Vacuuming the full database would have taken prohibitively long so we never
completed that operation.

On Mon, May 4, 2020 at 6:17 PM Jerry Sievers <gsievers19@comcast.net> wrote:

> Ricky Ramirez <ricky@reddit.com> writes:
>
> > Hello,
> >
> > We have run into a strange situation with our database. A temporary
> > table was created some time ago and that session has since died.
> > However, the temporary table stuck around. It's been around long
> > enough that postgres stopped accepting writes to prevent
> > transaction ID wraparound. Problem is, it's a temporary table and the
> > session that it's associated with is gone, so we cannot vacuum it nor
> > even drop the table. We even restarted postgres and the temporary
> > table was still there!
>
> What happened when you tried to drop the temp table?
>
> >
> > The table shows up in pg_class as a temporary table with zero tuples.
> > The table replicated over to other hosts. We were able to promote a
> > replica and then single user mode the replica and drop the offending
> > table. I still have the original broken database available for
> > debugging. Can I provide any additional debugging information?
> >
> > Thanks,
> >
> > Ricky
> >
> >
>
> --
> Jerry Sievers
> Postgres DBA/Development Consulting
> e: postgres.consulting@comcast.net
>

^ permalink  raw  reply  [nested|flat] 5+ messages in thread


end of thread, other threads:[~2020-05-06 01:27 UTC | newest]

Thread overview: 5+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2020-05-04 23:24 Temporary table has become problematically persistent Ricky Ramirez <ricky@reddit.com>
2020-05-04 23:54 ` Tom Lane <tgl@sss.pgh.pa.us>
2020-05-05 00:21   ` Ricky Ramirez <ricky@reddit.com>
2020-05-05 01:17 ` Jerry Sievers <gsievers19@comcast.net>
2020-05-06 01:27   ` Ricky Ramirez <ricky@reddit.com>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox