Patch to warn about oid/xid wraparound

Lists: pgsql-hackerspgsql-patches
From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: PostgreSQL-development <pgsql-hackers(at)postgreSQL(dot)org>
Subject: Patch to warn about oid/xid wraparound
Date: 2001-06-12 23:33:15
Message-ID: 200106122333.f5CNXFU11978@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers pgsql-patches

Here is a patch that will warn you during VACUUM when you are within 75%
of oid/xid wraparound.

I will apply it if 7.2 has no solution to the wraparounds.

--
Bruce Momjian | http://candle.pha.pa.us
pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 853-3000
+ If your life is a hard drive, | 830 Blythe Avenue
+ Christ can be your backup. | Drexel Hill, Pennsylvania 19026

Attachment Content-Type Size
unknown_filename text/plain 1.9 KB

From: Lamar Owen <lamar(dot)owen(at)wgcr(dot)org>
To: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Patch to warn about oid/xid wraparound
Date: 2001-06-13 14:54:48
Message-ID: 01061310544800.00942@lowen.wgcr.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: Postg사설 토토 사이트SQL pgsql-patches

On Tuesday 12 June 2001 19:33, Bruce Momjian wrote:
> Here is a patch that will warn you during VACUUM when you are within 75%
> of oid/xid wraparound.

> I will apply it if 7.2 has no solution to the wraparounds.

Is this something a potential 7.1.3 release might need? I consider this a
bug workaround, actually. Or even a feature patch against 7.1.x that people
can download if they think they need it?

As PostgreSQL gets used in bigger and bigger database installations, the
wraparound problems become more and more likely. And it's likely to be at
least six months before 7.2beta, if the track record stays the same as it has
the last three releases.
--
Lamar Owen
WGCR Internet Radio
1 Peter 4:11


From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Lamar Owen <lamar(dot)owen(at)wgcr(dot)org>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Patch to warn about oid/xid wraparound
Date: 2001-06-13 19:56:06
Message-ID: 200106131956.f5DJu7a13924@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers pgsql-patches

> On Tuesday 12 June 2001 19:33, Bruce Momjian wrote:
> > Here is a patch that will warn you during VACUUM when you are within 75%
> > of oid/xid wraparound.
>
> > I will apply it if 7.2 has no solution to the wraparounds.
>
> Is this something a potential 7.1.3 release might need? I consider this a
> bug workaround, actually. Or even a feature patch against 7.1.x that people
> can download if they think they need it?
>
> As PostgreSQL gets used in bigger and bigger database installations, the
> wraparound problems become more and more likely. And it's likely to be at
> least six months before 7.2beta, if the track record stays the same as it has
> the last three releases.

Here is an new patch that updates the percentage display when it is run,
rather than just displaying 75%. I had to do the computation using
floats to prevent overflow.

Again, I will put this in 7.2 if we have no solution for rollover.

--
Bruce Momjian | http://candle.pha.pa.us
pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 853-3000
+ If your life is a hard drive, | 830 Blythe Avenue
+ Christ can be your backup. | Drexel Hill, Pennsylvania 19026

Attachment Content-Type Size
unknown_filename text/plain 2.0 KB

From: Peter Eisentraut <peter_e(at)gmx(dot)net>
To: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
Cc: Lamar Owen <lamar(dot)owen(at)wgcr(dot)org>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Patch to warn about oid/xid wraparound
Date: 2001-06-13 20:35:26
Message-ID: Pine.LNX.4.30.0106132231390.756-100000@peter.localdomain
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers pgsql-patches

Bruce Momjian writes:

> Here is an new patch that updates the percentage display when it is run,
> rather than just displaying 75%. I had to do the computation using
> floats to prevent overflow.

You could use ldiv().

Also, UINT_MAX (for transaction id) and OID_MAX (for Oid) might be
preferred over ~0.

Btw., there is a typo here:

> GetCurrentTransactionId() - (float)(~(TransactionId)0) * 100);

--
Peter Eisentraut peter_e(at)gmx(dot)net http://funkturm.homeip.net/~peter


From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Peter Eisentraut <peter_e(at)gmx(dot)net>
Cc: Lamar Owen <lamar(dot)owen(at)wgcr(dot)org>, PostgreSQL-patches <pgsql-patches(at)postgresql(dot)org>
Subject: Re: [HACKERS] Patch to warn about oid/xid wraparound
Date: 2001-06-13 21:04:32
Message-ID: 200106132104.f5DL4Xt27579@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers pgsql-patches

> Bruce Momjian writes:
>
> > Here is an new patch that updates the percentage display when it is run,
> > rather than just displaying 75%. I had to do the computation using
> > floats to prevent overflow.

Sorry, I should have been doing this on patches list.

> You could use ldiv().

It is overflow that I am worried about: curr/max * 100
I don't see how ldiv helps here.

>
> Also, UINT_MAX (for transaction id) and OID_MAX (for Oid) might be
> preferred over ~0.

Done. Patch attached.

>
> Btw., there is a typo here:
>
> > GetCurrentTransactionId() - (float)(~(TransactionId)0) * 100);

Thanks. Fixed. I hadn't gotten to testing the transaction code yet,
just the oid test.

--
Bruce Momjian | http://candle.pha.pa.us
pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 853-3000
+ If your life is a hard drive, | 830 Blythe Avenue
+ Christ can be your backup. | Drexel Hill, Pennsylvania 19026

Attachment Content-Type Size
unknown_filename text/plain 2.1 KB