[GENERAL] i'm really desperate: invalid memory alloc request size 0

2004-10-01 Thread Janning Vygen
Hi,

tonight my database got corruppted. before it worked fine.

since two days i do the following tasks every night

psql -c 'CLUSTER;' $DBNAME
psql -c 'VACUUM FULL ANALYZE;' $DBNAME

before these opertaions i stop all web access. The last months i only did a 
VACUUM ANALYZE each night and didn't get any failures.

in the morning some sql queries failed. it seems only one table was affected.

i stopped all web access and tried to backup the current database:


pg_dump: ERROR:  invalid memory alloc request size 0
pg_dump: SQL command to dump the contents of table fragentipps failed: 
PQendcopy() failed.
pg_dump: Error message from server: ERROR:  invalid memory alloc request size 
0
pg_dump: The command was: COPY public.fragentipps (tr_kurzname, mg_name, 
fr_id, aw_antworttext) TO stdout;

so i did:
/etc/init.d/postgresql stop
cp -rp /home/postgres/data /home/postgres/datafailure

and i tried to recover from backup which was made just before clustering but i 
got
ERROR:  index row requires 77768 bytes, maximum size is 8191

is there any chance to get my database keep going again?

pg version is 7.4.2


kind regards
janning

---(end of broadcast)---
TIP 3: if posting/reading through Usenet, please send an appropriate
  subscribe-nomail command to [EMAIL PROTECTED] so that your
  message can get through to the mailing list cleanly


Re: [GENERAL] i'm really desperate: invalid memory alloc request size 0

2004-10-01 Thread Janning Vygen
Am Freitag, 1. Oktober 2004 09:49 schrieben Sie:
 Hi,

 tonight my database got corruppted. before it worked fine.

 since two days i do the following tasks every night

 psql -c 'CLUSTER;' $DBNAME
 psql -c 'VACUUM FULL ANALYZE;' $DBNAME

 before these opertaions i stop all web access. The last months i only did a
 VACUUM ANALYZE each night and didn't get any failures.

 in the morning some sql queries failed. it seems only one table was
 affected.

 i stopped all web access and tried to backup the current database:


 pg_dump: ERROR:  invalid memory alloc request size 0
 pg_dump: SQL command to dump the contents of table fragentipps failed:
 PQendcopy() failed.
 pg_dump: Error message from server: ERROR:  invalid memory alloc request
 size 0
 pg_dump: The command was: COPY public.fragentipps (tr_kurzname, mg_name,
 fr_id, aw_antworttext) TO stdout;

 so i did:
 /etc/init.d/postgresql stop
 cp -rp /home/postgres/data /home/postgres/datafailure

 and i tried to recover from backup which was made just before clustering
 but i got
 ERROR:  index row requires 77768 bytes, maximum size is 8191

 is there any chance to get my database keep going again?

 pg version is 7.4.2


 kind regards
 janning


some additional information from my log files: 

LOG:  server process (PID 24227) was terminated by signal 11
LOG:  terminating any other active server processes
WARNING:  terminating connection because of crash of another server process
DETAIL:  The postmaster has commanded this server process to roll back the 
current transaction and exit, because another ser
ver process exited abnormally and possibly corrupted shared memory.
HINT:  In a moment you should be able to reconnect to the database and repeat 
your command.


[...]


LOG:  all server processes terminated; reinitializing
LOG:  database system was interrupted at 2004-10-01 04:59:46 CEST
LOG:  checkpoint record is at 6A/A9142BB4
LOG:  redo record is at 6A/A9016D68; undo record is at 0/0; shutdown FALSE
LOG:  next transaction ID: 202721693; next OID: 352799
LOG:  database system was not properly shut down; automatic recovery in 
progress
LOG:  redo starts at 6A/A9016D68
LOG:  record with zero length at 6A/A931CEE0
LOG:  redo done at 6A/A931CEBC
LOG:  recycled transaction log file 006A00A6
LOG:  recycled transaction log file 006A00A7
LOG:  removing transaction log file 006A00A8
LOG:  database system is ready
LOG:  server process (PID 24235) was terminated by signal 11
LOG:  terminating any other active server processes
WARNING:  terminating connection because of crash of another server process
DETAIL:  The postmaster has commanded this server process to roll back the 
current transaction and exit, because another ser
ver process exited abnormally and possibly corrupted shared memory.
HINT:  In a moment you should be able to reconnect to the database and repeat 
your command.
WARNING:  terminating connection because of crash of another server process
DETAIL:  The postmaster has commanded this server process to roll back the 
current transaction and exit, because another ser
ver process exited abnormally and possibly corrupted shared memory.


please help me... 

janning

---(end of broadcast)---
TIP 4: Don't 'kill -9' the postmaster


Re: [GENERAL] i'm really desperate: invalid memory alloc request size 0

2004-10-01 Thread Janning Vygen
Hi Richard,

i feared all db gurus are asleep at the moment. 

Am Freitag, 1. Oktober 2004 10:56 schrieb Richard Huxton:
 PS - your next mail mentions sig11 which usually implies hardware
 problems, so don't forget to test the machine thoroughly once this is over.

You saved my life!! Nothing less!

This was a great help cause i never thought that it could be a hardware 
problem. I took a dump from last night and tried to recover on the original 
machine. it didnt work as i wrote. but when i tried to install it on another 
machine it just worked fine.

So everything is up and running. 

I still have all the corrupt files in place and now  i try to determine what 
went wrong. 

As it is obviously a hardware problem, my question is now: how can i check my 
hardware (disk)?

How can i get informed next time when things are going wrong?

Ok i will come up with a lot of questions as soon as i had another coffee 
because i never want to feel so helpless again. 

There really should be a section in the manual like desaster recovery which 
shows some tricks and methods. 

  pg version is 7.4.2

 Download 7.4.5 - that's got the latest bugfixes in it.

i will as soon as my nerves are cooling down again :-)

kind regard,
janning

 --
Richard Huxton
Archonet Ltd

---(end of broadcast)---
TIP 5: Have you checked our extensive FAQ?

   http://www.postgresql.org/docs/faqs/FAQ.html