Patch to warn about oid/xid wraparound

Started by Bruce Momjianalmost 25 years ago5 messageshackers
Jump to latest
#1Bruce Momjian
bruce@momjian.us

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@candle.pha.pa.us               |  (610) 853-3000
  +  If your life is a hard drive,     |  830 Blythe Avenue
  +  Christ can be your backup.        |  Drexel Hill, Pennsylvania 19026

Attachments:

/pgpatches/maxoidxidtext/plainDownload+25-1
#2Lamar Owen
lamar.owen@wgcr.org
In reply to: Bruce Momjian (#1)
Re: Patch to warn about oid/xid wraparound

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

#3Bruce Momjian
bruce@momjian.us
In reply to: Lamar Owen (#2)
Re: Patch to warn about oid/xid wraparound

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@candle.pha.pa.us               |  (610) 853-3000
  +  If your life is a hard drive,     |  830 Blythe Avenue
  +  Christ can be your backup.        |  Drexel Hill, Pennsylvania 19026

Attachments:

/pgpatches/maxoidxidtext/plainDownload+27-1
#4Peter Eisentraut
peter_e@gmx.net
In reply to: Bruce Momjian (#3)
Re: Patch to warn about oid/xid wraparound

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@gmx.net http://funkturm.homeip.net/~peter

#5Bruce Momjian
bruce@momjian.us
In reply to: Peter Eisentraut (#4)
Re: [HACKERS] Patch to warn about oid/xid wraparound

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@candle.pha.pa.us               |  (610) 853-3000
  +  If your life is a hard drive,     |  830 Blythe Avenue
  +  Christ can be your backup.        |  Drexel Hill, Pennsylvania 19026

Attachments:

/pgpatches/maxoidxidtext/plainDownload+27-1