dbTalk Databases Forums  

[BUGS] BUG #2239: "vacuumdb -a" remove freeze

mailing.database.pgsql-bugs mailing.database.pgsql-bugs


Discuss [BUGS] BUG #2239: "vacuumdb -a" remove freeze in the mailing.database.pgsql-bugs forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Olleg Samoylov
 
Posts: n/a

Default [BUGS] BUG #2239: "vacuumdb -a" remove freeze - 02-06-2006 , 05:50 AM







The following bug has been logged online:

Bug reference: 2239
Logged by: Olleg Samoylov
Email address: olleg_s (AT) mail (DOT) ru
PostgreSQL version: 8.1
Operating system: Linux (debian-amd64)
Description: "vacuumdb -a" remove freeze
Details:

template1=# select version();
version

----------------------------------------------------------------------------
------------------------------------
PostgreSQL 8.1.0 on x86_64-pc-linux-gnu, compiled by GCC cc (GCC) 4.0.3
20051111 (prerelease) (Debian 4.0.2-4)
(1 row)
template1=# select * from pg_database where datname='template1';
datname | datdba | encoding | datistemplate | datallowconn | datconnlimit
Quote:
datlastsysoid | datvacuumxid | datfrozenxid | dattablespace | datconfig |
datacl
-----------+--------+----------+---------------+--------------+-------------
-+---------------+--------------+--------------+---------------+-----------+
------------------------
template1 | 10 | 6 | t | t | -1
Quote:
10792 | 1112 | 3221226585 | 1663 | |
{postgres=CT/postgres}
(1 row)
template1=# vacuum freeze;
VACUUM
template1=# select * from pg_database where datname='template1';
datname | datdba | encoding | datistemplate | datallowconn | datconnlimit
Quote:
datlastsysoid | datvacuumxid | datfrozenxid | dattablespace | datconfig |
datacl
-----------+--------+----------+---------------+--------------+-------------
-+---------------+--------------+--------------+---------------+-----------+
------------------------
template1 | 10 | 6 | t | t | -1
Quote:
10792 | 1172 | 1172 | 1663 | |
{postgres=CT/postgres}
(1 row)

Okey, freezed, now launch vacuumdb from command line:

# vacuumdb -a -U postgres
vacuumdb: vacuuming database "postgres"
VACUUM
vacuumdb: vacuuming database "template1"
VACUUM

Opps, template1 must not be vacuumed.

select * from pg_database where datname='template1';
datname | datdba | encoding | datistemplate | datallowconn | datconnlimit
Quote:
datlastsysoid | datvacuumxid | datfrozenxid | dattablespace | datconfig |
datacl
-----------+--------+----------+---------------+--------------+-------------
-+---------------+--------------+--------------+---------------+-----------+
------------------------
template1 | 10 | 6 | t | t | -1
Quote:
10792 | 1287 | 3221226760 | 1663 | |
{postgres=CT/postgres}
(1 row)

Unfreezed indeed.

---------------------------(end of broadcast)---------------------------
TIP 1: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to majordomo (AT) postgresql (DOT) org so that your
message can get through to the mailing list cleanly


Reply With Quote
  #2  
Old   
Tom Lane
 
Posts: n/a

Default Re: [BUGS] BUG #2239: "vacuumdb -a" remove freeze - 02-06-2006 , 12:11 PM






"Olleg Samoylov" <olleg_s (AT) mail (DOT) ru> writes:
Quote:
Opps, template1 must not be vacuumed.
Says who?

If we didn't vacuum template1 then it would be subject to XID wraparound
problems, unless it had never been modified, which is something vacuumdb
can't count on.

regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 4: Have you searched our list archives?

http://archives.postgresql.org


Reply With Quote
  #3  
Old   
Olleg Samoylov
 
Posts: n/a

Default Re: [BUGS] BUG #2239: "vacuumdb -a" remove freeze - 02-07-2006 , 01:37 AM



Tom Lane wrote:
Quote:
"Olleg Samoylov" <olleg_s (AT) mail (DOT) ru> writes:

Opps, template1 must not be vacuumed.


Says who?

If we didn't vacuum template1 then it would be subject to XID
wraparound problems, unless it had never been modified, which is
something vacuumdb can't count on.
template1 frozen by "vacuum freeze", thus can't be subject of XID
wraparound problems, isn't it?

man vacuum:
Quote:
If this is done when there are no other open transactions in the same
database, then it is guaranteed that all tuples in the
database are ‘‘frozen’’ and will not be subject to transaction
ID wraparound problems, no matter how long the database is left
unvacuumed.
IMHO "vacuumdb -a" must don't vacuum database with
datvacuumxid=datfrozenxid.

--
Olleg Samoylov

---------------------------(end of broadcast)---------------------------
TIP 5: don't forget to increase your free space map settings


Reply With Quote
  #4  
Old   
Tom Lane
 
Posts: n/a

Default Re: [BUGS] BUG #2239: "vacuumdb -a" remove freeze - 02-07-2006 , 09:10 AM



Olleg Samoylov <olleg (AT) mipt (DOT) ru> writes:
Quote:
IMHO "vacuumdb -a" must don't vacuum database with
datvacuumxid=datfrozenxid.
That's not going to work because it will fail to detect whether the
database has been modified since the VACUUM FREEZE command.

In any case, what's the point? As long as you have a routine vacuuming
process in place, it doesn't really matter whether template1 gets
scanned. The only reason VACUUM FREEZE exists at all is to make it
possible to have a non-connectable, non-vacuumable template0.

regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 5: don't forget to increase your free space map settings


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.