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

Re: Fix overflow of bgwriter's request queue

From: ITAGAKI Takahiro <itagaki(dot)takahiro(at)lab(dot)ntt(dot)co(dot)jp>
To: "Qingqing Zhou" <zhouqq(at)cs(dot)toronto(dot)edu>
Cc: pgsql-patches(at)postgresql(dot)org
Subject: Re: Fix overflow of bgwriter's request queue
Date: 2006-01-13 07:04:00
Message-ID: 20060113155017.4E2E.ITAGAKI.TAKAHIRO@lab.ntt.co.jp (view raw or flat)
Thread:
Lists: pgsql-patches
"Qingqing Zhou" <zhouqq(at)cs(dot)toronto(dot)edu> wrote:

>    while ((entry = (PendingOperationEntry *) hash_seq_search(&hstat)) != NULL)
>    {
> +   if (i >= count)
> +    elog(ERROR, "pendingOpsTable corrupted");
> +
> +   memcpy(&entries[i++], entry, sizeof(PendingOperationEntry));
> +
> +   if (hash_search(pendingOpsTable, entry,
> +       HASH_REMOVE, NULL) == NULL)
> +    elog(ERROR, "pendingOpsTable corrupted");
> +  }
> 
> What's the rationale of this change?

AbsorbFsyncRequests will be called during the fsync loop in my patch,
so new files might be added to pendingOpsTable and they will be removed
from the table *before* writing the pages belonging to them.
So I changed it to copy the contents of pendingOpsTable to a local
variables and iterate on the vars later.

---
ITAGAKI Takahiro
NTT Cyber Space Laboratories



In response to

Responses

pgsql-patches by date

Next:From: Qingqing ZhouDate: 2006-01-13 07:52:07
Subject: Re: Fix overflow of bgwriter's request queue
Previous:From: Qingqing ZhouDate: 2006-01-13 06:48:24
Subject: Re: Fix overflow of bgwriter's request queue

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