Re: Fix overflow of bgwriter's request queue - Mailing list pgsql-patches

From ITAGAKI Takahiro
Subject Re: Fix overflow of bgwriter's request queue
Date
Msg-id 20060113155017.4E2E.ITAGAKI.TAKAHIRO@lab.ntt.co.jp
Whole thread Raw
In response to Re: Fix overflow of bgwriter's request queue  ("Qingqing Zhou" <zhouqq@cs.toronto.edu>)
List pgsql-patches
"Qingqing Zhou" <zhouqq@cs.toronto.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



pgsql-patches by date:

Previous
From: "Qingqing Zhou"
Date:
Subject: Re: Fix overflow of bgwriter's request queue
Next
From: "Qingqing Zhou"
Date:
Subject: Re: Fix overflow of bgwriter's request queue