Re: [pgsql-hackers-win32] Sync vs. fsync during checkpoint

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Kevin Brown <kevin(at)sysexperts(dot)com>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: [pgsql-hackers-win32] Sync vs. fsync during checkpoint
Date: 2004-02-03 15:05:34
Message-ID: 17806.1075820734@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-hackers-win32

Kevin Brown <kevin(at)sysexperts(dot)com> writes:
> Instead, have each backend maintain its own separate list in shared
> memory. The only readers of a given list would be the backend it belongs
> to and the bgwriter, and the only time bgwriter attempts to read the
> list is at checkpoint time.

> The sum total size of all the lists shouldn't be that much larger than
> it would be if you maintained it as a global list.

I fear that is just wishful thinking. Consider the system catalogs as a
counterexample of files that are likely to be touched/modified by many
different backends.

The bigger problem though with this is that it makes the problem of
list overflow much worse. The hard part about shared memory management
is not so much that the available space is small, as that the available
space is fixed --- we can't easily change it after postmaster start.
The more finely you slice your workspace, the more likely it becomes
that one particular part will run out of space. So the inefficient case
where a backend isn't able to insert something into the appropriate list
will become considerably more of a factor.

> but it seems clear to me that you want to do
> a sync() *first*, then the fsync()s.

Hmm, that's an interesting thought. On a machine that's doing a lot of
stuff besides running the database, a global sync would be
counterproductive --- but we could easily make it configurable as to
whether to issue the sync() or not. It wouldn't affect correctness.

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2004-02-03 15:10:29 Re: COPY from question
Previous Message Marcio Caetano 2004-02-03 14:56:11 Multicolumn Indexing using R-Tree

Browse pgsql-hackers-win32 by date

  From Date Subject
Next Message Merlin Moncure 2004-02-03 20:32:43 interix port running...
Previous Message Merlin Moncure 2004-02-03 13:43:50 Re: pg_config.h on interix