[Catalog-sig] start on static generation, and caching - apache config.
renesd at gmail.com
Mon Jul 9 19:15:19 CEST 2007
On 7/10/07, Phillip J. Eby <pje at telecommunity.com> wrote:
> At 07:13 PM 7/9/2007 +0400, René Dudfield wrote:
> >The way to do this atomically, so not one can possibly get an old
> >page, the static file will be removed as the change is committed.
> >Then everyone gets the latest change right away - as soon as the
> >change has been committed.
> This sounds pretty good... except that you may need better
> protection against a race condition. What happens if a page is
> removed *while* it is being regenerated? PostgreSQL has MVCC for
> read-only transactions, so the static page will be generated against
> old data, unless you have some other locking mechanism used to
> serialize access to the static file, that is shared by both the
> deletion and generating mechanisms.
move in linux/unix is atomic. So the file is generated and then moved
in. unlink is similar... once you remove it, any processes with that
file open still references the old file.
So no race condition.
def the static generation:
- generate file in temp file
- move temp file to place where static file lives.
def the update code:
- do inserts/updates/deletes.
- remove static files.
- commit change.
- the static generation()
More information about the Catalog-SIG