agora inbox for postgres@postgres.berkeley.edu  
help / color / mirror / Atom feed
From: V.Grabner <zen@eka.gklw.co.at>
To: postgres@postgres.Berkeley.EDU
Subject: Re: synchronous writes WARNING: do NOT (!!) use the -o-S flag
Date: Tue, 07 Mar 1995 12:35:55 +0100
Message-ID: <m0rlxYU-000I3jC@eka> (raw)


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	: zen@gklw.co.at      
 -----------------------------------------------------------------------------
			--->>>> 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 "postgres-request@postgres.Berkeley.EDU".
   If this fails, send mail to "post_questions@postgres.Berkeley.EDU" and
   a human will deal with it.  DO NOT post to the "postgres" mailing list.
==============================================================================
              URL: http://s2k-ftp.CS.Berkeley.EDU:8000/postgres/



reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: postgres@postgres.berkeley.edu
  Cc: zen@eka.gklw.co.at
  Subject: Re: synchronous writes WARNING: do NOT (!!) use the -o-S flag
  In-Reply-To: <m0rlxYU-000I3jC@eka>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox