Subject: Re: synchronous writes WARNING: do NOT (!!) use the -o-S flag

From: "V.Grabner" <[email-masked]>
Date: Tue, 07 Mar 1995 12:35:55 +0100

The previous discussion was at the the linux-postgres list, but there are mail
troubles at the moment, it's a general problem anyway...

Hi,

I found the error I was traceing for weeks, no race conditions, not array 
ranges .....  >>>> the -o-S flag !!!!!

WARNING:
 
Do NOT use the -S flag for the postgres backend (not to be confused with the 
postmaster -S flag) unless you want to destroy your database right after 
creation.

The minus -S flag does not only fsync, but does a FlushBufferPool() upon
the exit of the backend. 
This does not seem to be a problem, but it crashes postgres (not just a
single database) once in a while. The symptoms are deadlocks, most of the time.

The problem is, the programmers of postgres seemed to have relied on 
the sync and invalidation of a buffer after each successfully commited 
transaction. The -S Flag does not sync back, it only syncs upon exit.

If some minor error occures (during the !sync and exit), the whole system gets 
out of order, and about ten statements after the bad one, the database goes 
defunct .... (deadlock, xid table corrupted, cache corrupted, shm error ....)
I have learned 'NOTICE:' == the beginning of the end ...)

createdb dummy
echo "" | monitor dummy 

is enough to crash anything (I don't know exactly how, but this one works for
sure).

My advice : disable the -S flag in postgres.c

> the original question was, what happens when i turn off the sync writes.
> the answer is, with the current storage system, you lose any ability to 
> recover the database.

and you lose your database right away ...., there is no need to recover -:).

- --zen

 -----------------------------------------------------------------------------
 Vinzenz Grabner				Voice	: + 43 1 817 62 30-11  
 GKL&W GmbH.					Fax	: + 43 1 817 62 30-17
 Schoenbrunnerstr. 179/II/4.St. 
 A-1120 Vienna/Austria/Europe			e-mail	: [email-masked]      
 -----------------------------------------------------------------------------
			--->>>> We moved <<<<---
 -----------------------------------------------------------------------------
 Be aware: The rat will always win, because it's a rat and what else has he 
           got to do but thinking about you ..
 -----------------------------------------------------------------------------

------- End of Forwarded Message

==============================================================================
   To add/remove yourself to/from the POSTGRES mailing list: send mail with 
   the subject line ADD or DEL to "[email-masked]".
   If this fails, send mail to "[email-masked]" and
   a human will deal with it.  DO NOT post to the "postgres" mailing list.
==============================================================================
              URL: http://s2k-ftp.CS.Berkeley.EDU:8000/postgres/