wraparound data loss in database "postgres"

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
QS1
Posts: 195
Joined: Tue Sep 21, 2010 3:30 pm

Re: wraparound data loss in database "postgres"

Post by QS1 »

The following command was run on Friday 14March at 8am and ran all weekend with 4 billion files still remaining.
are there any other options for postgresql (uninstall/re-install?). If so what data would I be losing?

DETAIL: You may have already suffered transaction-wraparound data loss.
WARNING: database "postgres" must be vacuumed within 4288941414 transactions




[root@nagiosxi ~]# service postgresql stop
Stopping postgresql service: [ OK ]
[root@nagiosxi ~]# su postgres
bash-3.2$ postgres -D /var/lib/pgsql/data/ nagiosxi
WARNING: database "postgres" must be vacuumed within 4288941485 transactions
HINT: To avoid a database shutdown, execute a full-database VACUUM in "postgres".
WARNING: database "postgres" must be vacuumed within 4288941485 transactions
HINT: To avoid a database shutdown, execute a full-database VACUUM in "postgres".
backend> vacuum full;
WARNING: database "postgres" must be vacuumed within 4288941483 transactions
HINT: To avoid a database shutdown, execute a full-database VACUUM in "postgres".
WARNING: database "postgres" must be vacuumed within 4288941482 transactions
HINT: To avoid a database shutdown, execute a full-database VACUUM in "postgres".
WARNING: database "postgres" must be vacuumed within 4288941481 transactions
HINT: To avoid a database shutdown, execute a full-database VACUUM in "postgres".
WARNING: database "postgres" must be vacuumed within 4288941480 transactions
HINT: To avoid a database shutdown, execute a full-database VACUUM in "postgres".
WARNING: database "postgres" must be vacuumed within 4288941479 transactions
HINT: To avoid a database shutdown, execute a full-database VACUUM in "postgres".
WARNING: database "postgres" must be vacuumed within 4288941478 transactions
HINT: To avoid a database shutdown, execute a full-database VACUUM in "postgres".
WARNING: database "postgres" must be vacuumed within 4288941477 transactions
HINT: To avoid a database shutdown, execute a full-database VACUUM in "postgres".
WARNING: database "postgres" must be vacuumed within 4288941476 transactions
DETAIL: You may have already suffered transaction-wraparound data loss.
WARNING: database "postgres" must be vacuumed within 4288941414 transactions
HINT: To avoid a database shutdown, execute a full-database VACUUM in "postgres".
backend>
User avatar
lmiltchev
Former Nagios Staff
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: wraparound data loss in database "postgres"

Post by lmiltchev »

Let's try this one more time - run the following commands (one at a time), and show the output after each command.

Code: Select all

service postgresql stop
su postgres
postgres -D /var/lib/pgsql/data/
vacuum;
vacuum analyse;
vacuum full;

CTRL+D
Be sure to check out our Knowledgebase for helpful articles and solutions!
QS1
Posts: 195
Joined: Tue Sep 21, 2010 3:30 pm

Re: wraparound data loss in database "postgres"

Post by QS1 »

[root@nagiosxi ~]# service postgresql stop
Stopping postgresql service: [ OK ]
[root@nagiosxi ~]# su postgres
bash-3.2$ postgres -D /var/lib/pgsql/data/

WARNING: database "postgres" must be vacuumed within 4288941414 transactions
HINT: To avoid a database shutdown, execute a full-database VACUUM in "postgres".
WARNING: database "postgres" must be vacuumed within 4288941414 transactions
HINT: To avoid a database shutdown, execute a full-database VACUUM in "postgres".

PostgreSQL stand-alone backend 8.1.22
backend> vacuum;

WARNING: database "postgres" must be vacuumed within 4288941413 transactions
HINT: To avoid a database shutdown, execute a full-database VACUUM in "postgres".
backend> vacuum analyse;

WARNING: database "postgres" must be vacuumed within 4288941411 transactions
HINT: To avoid a database shutdown, execute a full-database VACUUM in "postgres".
WARNING: database "postgres" must be vacuumed within 4288941410 transactions
HINT: To avoid a database shutdown, execute a full-database VACUUM in "postgres".
WARNING: database "postgres" must be vacuumed within 4288941409 transactions
HINT: To avoid a database shutdown, execute a full-database VACUUM in "postgres".
WARNING: database "postgres" must be vacuumed within 4288941408 transactions
HINT: To avoid a database shutdown, execute a full-database VACUUM in "postgres".
WARNING: database "postgres" must be vacuumed within 4288941407 transactions
HINT: To avoid a database shutdown, execute a full-database VACUUM in "postgres".
WARNING: database "postgres" must be vacuumed within 4288941406 transactions
HINT: To avoid a database shutdown, execute a full-database VACUUM in "postgres".
WARNING: database "postgres" must be vacuumed within 4288941405 transactions
HINT: To avoid a database shutdown, execute a full-database VACUUM in "postgres".
WARNING: database "postgres" must be vacuumed within 4288941404 transactions
HINT: To avoid a database shutdown, execute a full-database VACUUM in "postgres".
WARNING: database "postgres" must be vacuumed within 4288941403 transactions
HINT: To avoid a database shutdown, execute a full-database VACUUM in "postgres".
WARNING: database "postgres" must be vacuumed within 4288941402 transactions
HINT: To avoid a database shutdown, execute a full-database VACUUM in "postgres".
WARNING: database "postgres" must be vacuumed within 4288941401 transactions
HINT: To avoid a database shutdown, execute a full-database VACUUM in "postgres".
WARNING: database "postgres" must be vacuumed within 4288941400 transactions
HINT: To avoid a database shutdown, execute a full-database VACUUM in "pos
HINT: To avoid a database shutdown, execute a full-database VACUUM in "postgres".
WARNING: some databases have not been vacuumed in over 2 billion transactions
DETAIL: You may have already suffered transaction-wraparound data loss.
WARNING: database "template1" must be vacuumed within 4288941319 transactions
HINT: To avoid a database shutdown, execute a full-database VACUUM in "template1".
backend>vacuum full;

WARNING: database "template1" must be vacuumed within 4288941319 transactions
HINT: To avoid a database shutdown, execute a full-database VACUUM in "template1".
ERROR: canceling statement due to user request
backend> CTRL+D

backend> You have new mail in /var/spool/mail/root
bash-3.2$
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: wraparound data loss in database "postgres"

Post by scottwilkerson »

Lets run the following

Code: Select all

echo "vacuum;vacuum analyse;vacuum full;"|psql nagiosxi postgres
echo "vacuum;vacuum analyse;vacuum full;"|psql postgres postgres
echo "vacuum;vacuum analyse;vacuum full;"|psql template1 postgres
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
QS1
Posts: 195
Joined: Tue Sep 21, 2010 3:30 pm

Re: wraparound data loss in database "postgres"

Post by QS1 »

bash-3.2$ echo "vacuum;vacuum analyse;vacuum full;"|psql nagiosxi postgres
could not change directory to "/root"
psql: could not connect to server: No such file or directory
Is the server running locally and accepting
connections on Unix domain socket "/tmp/.s.PGSQL.5432"?
You have new mail in /var/spool/mail/root
bash-3.2$

bash-3.2$ echo "vacuum;vacuum analyse;vacuum full;"|psql postgres postgres
could not change directory to "/root"
psql: could not connect to server: No such file or directory
Is the server running locally and accepting
connections on Unix domain socket "/tmp/.s.PGSQL.5432"?
bash: echo: write error: Broken pipe

bash-3.2$ echo "vacuum;vacuum analyse;vacuum full;"|psql template1 postgres
could not change directory to "/root"
psql: could not connect to server: No such file or directory
Is the server running locally and accepting
connections on Unix domain socket "/tmp/.s.PGSQL.5432"?
You have new mail in /var/spool/mail/root
bash-3.2$
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: wraparound data loss in database "postgres"

Post by abrist »

Try starting the postgres service, and then rerunning Scotts commands:

Code: Select all

service postgresql start
echo "vacuum;vacuum analyse;vacuum full;"|psql nagiosxi postgres
echo "vacuum;vacuum analyse;vacuum full;"|psql postgres postgres
echo "vacuum;vacuum analyse;vacuum full;"|psql template1 postgres
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
QS1
Posts: 195
Joined: Tue Sep 21, 2010 3:30 pm

Re: wraparound data loss in database "postgres"

Post by QS1 »

Starting postgresql service: [ OK ]
[root@nagiosxi ~]# echo "vacuum;vacuum analyse;vacuum full;"|psql nagiosxi postgres
psql: FATAL: database is not accepting commands to avoid wraparound data loss in database "template1"
HINT: Stop the postmaster and use a standalone backend to vacuum database "template1".

[root@nagiosxi ~]# echo "vacuum;vacuum analyse;vacuum full;"|psql postgres postgres
psql: FATAL: database is not accepting commands to avoid wraparound data loss in database "template1"
HINT: Stop the postmaster and use a standalone backend to vacuum database "template1".

[root@nagiosxi ~]# echo "vacuum;vacuum analyse;vacuum full;"|psql template1 postgres
psql: FATAL: database is not accepting commands to avoid wraparound data loss in database "template1"
HINT: Stop the postmaster and use a standalone backend to vacuum database "template1".
[root@nagiosxi ~]#
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: wraparound data loss in database "postgres"

Post by abrist »

Alright, lets try one more time with a slightly altered command:

Code: Select all

service postgreql stop
su postgres
postgres --single -D /var/lib/pgsql/data/ -O nagiosxi
vacuum;vacuum analyse;vacuum full;
ctrl-d
exit
service postgresql start
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
QS1
Posts: 195
Joined: Tue Sep 21, 2010 3:30 pm

Re: wraparound data loss in database "postgres"

Post by QS1 »

[root@nagiosxi ~]# service postgresql stop
Stopping postgresql service: [ OK ]
You have new mail in /var/spool/mail/root
[root@nagiosxi ~]# su postgres
bash-3.2$ postgres --single -D /var/lib/pgsql/data/ -O nagiosxi
FATAL: --single requires a value

(tried also with a lower case switch -o)
bash-3.2$ postgres --single -D /var/lib/pgsql/data/ -o nagiosxi
FATAL: --single requires a value

bash-3.2$ vacuum;vacuum analyse;vacuum full;
bash: vacuum: command not found
bash: vacuum: command not found
bash: vacuum: command not found
bash-3.2$
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: wraparound data loss in database "postgres"

Post by abrist »

Well, I have run out of syntax options - we really should try this in a remote. As you are a client, I would suggest opening a ticket by emailing [email protected] from an eligible email address and we will setup a remote session to resolve this. Make sure to reference the url to this thread in your email so that I get assigned on it.
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
Locked