"Qingqing Zhou" <[EMAIL PROTECTED]> writes:
> Yeah, you are right. I scratched elog/ereport(FATAL/PANIC), only found this
> one might be a suspect:
> In _hash_expandtable():
> if (!_hash_try_getlock(rel, start_nblkno, HASH_EXCLUSIVE))
> elog(PANIC, "could not get lock on supposedly new bucket
"Tom Lane" <[EMAIL PROTECTED]> writes
>
> This is not an issue except if the system might actually try to recover;
> which is not the case in the postmaster snippet you mention.
>
Yeah, you are right. I scratched elog/ereport(FATAL/PANIC), only found this
one might be a suspect:
In _hash_expand
"Qingqing Zhou" <[EMAIL PROTECTED]> writes:
> I am afraid the problem are not limited to hash_search(). Any code snippet
> are not proteced by critical section like this:
This is not an issue except if the system might actually try to recover;
which is not the case in the postmaster snippet you me
"Tom Lane" <[EMAIL PROTECTED]> writes
> "Qingqing Zhou" <[EMAIL PROTECTED]> writes:
> > In general, code snippet like this:
>
> > if (hash_search(..., HASH_ENTER, ...) == NULL)
> > action_except_elog__ERROR__;
>
> > are considered unsafe if: (1) the allocation method of the target hash
table
>
"Qingqing Zhou" <[EMAIL PROTECTED]> writes:
> In general, code snippet like this:
> if (hash_search(..., HASH_ENTER, ...) == NULL)
> action_except_elog__ERROR__;
> are considered unsafe if: (1) the allocation method of the target hash table
> could elog(ERROR) themselves and (2) the reaction
"Qingqing Zhou" <[EMAIL PROTECTED]> 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 segmen
"Tom Lane" <[EMAIL PROTECTED]> writes
> "Qingqing Zhou" <[EMAIL PROTECTED]> writes:
>
> "Unsafe" is a bit of an overstatement, when you evidently haven't
> analyzed the consequences of either choice of error level. That is,
> why is this a bug?
>
Consider the senario like this:
Backends registe
"Qingqing Zhou" <[EMAIL PROTECTED]> writes:
> In md.c/RememberFsyncRequest():
> if (hash_search(pendingOpsTable, &entry, HASH_ENTER, NULL) == NULL)
> ereport(FATAL,
> (errcode(ERRCODE_OUT_OF_MEMORY),
> errmsg("out of memory")));
> pendingOpsTable uses "MdCxt" to allocate memory. So if
-- First part ---
In md.c/RememberFsyncRequest():
if (hash_search(pendingOpsTable, &entry, HASH_ENTER, NULL) == NULL)
ereport(FATAL,
(errcode(ERRCODE_OUT_OF_MEMORY),
errmsg("out of memory")));
pendingOpsTable uses "MdCxt" to allocate memory. So if "out of memory", we
actually have no