Skip site navigation (1) Skip section navigation (2)

Re: unsafe use of hash_search(... HASH_ENTER ...)

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Qingqing Zhou" <zhouqq(at)cs(dot)toronto(dot)edu>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: unsafe use of hash_search(... HASH_ENTER ...)
Date: 2005-05-28 16:46:29
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-hackers
"Qingqing Zhou" <zhouqq(at)cs(dot)toronto(dot)edu> writes:
> Consider the senario like this:

> Backends register some dirty segments in BgWriterShmem->requests; bgwrite
> will AbsorbFsyncRequests() asynchornously but failed to record some one in
> pendingOpsTable due to an "out of memory" error. All dirty segments
> remembered in "requests" after this one will not have chance be absorbed by
> bgwriter.

So really we have to PANIC if we fail to record a dirty segment.  That's
a bit nasty, but since the hashtable is so small (only 16 bytes per
gigabyte-sized dirty segment) it seems unlikely that the situation will
ever occur in practice.

I'll put a critical section around it --- seems the easiest way to
ensure a panic ...

			regards, tom lane

In response to

pgsql-hackers by date

Next:From: Bruce MomjianDate: 2005-05-28 17:03:52
Subject: Re: [HACKERS] patches for items from TODO list
Previous:From: Jaime CasanovaDate: 2005-05-28 16:38:43
Subject: Re: thw rewriter and default values, again

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group