This is a discussion on Re: [PATCHES] Fix mdsync never-ending loop problem within the pgsql Hackers forums, part of the PostgreSQL category; --> Heikki Linnakangas <heikki@enterprisedb.com> wrote: > Itagaki, would you like to take a stab at this? Yes, I'll try to ...
| |||||||
| Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| ||||
| Heikki Linnakangas <heikki@enterprisedb.com> wrote: > Itagaki, would you like to take a stab at this? Yes, I'll try to fix the mdsync problem. I'll separate this fix from LDC patch. If we need to backport the fix to the back branches, a stand-alone patch would be better. In my understanding from the discussion, we'd better to take "cycle ID" approach instead of "making a copy of pendingOpsTable", because duplicated table is hard to debug and requires us to pay attention not to leak memories. I'll adopt the cycle ID approach and build LDC on it as a separate patch. Regards, --- ITAGAKI Takahiro NTT Open Source Software Center ---------------------------(end of broadcast)--------------------------- TIP 4: Have you searched our list archives? http://archives.postgresql.org |
| |||
| ITAGAKI Takahiro <itagaki.takahiro@oss.ntt.co.jp> writes: > In my understanding from the discussion, we'd better to take "cycle ID" > approach instead of "making a copy of pendingOpsTable", because duplicated > table is hard to debug and requires us to pay attention not to leak memories. > I'll adopt the cycle ID approach and build LDC on it as a separate patch. Heikki made some reasonable arguments against the cycle-ID idea. I'm not intending to insist on it ... I do think there are multiple issues here and it'd be better to try to separate the fixes into different patches. regards, tom lane ---------------------------(end of broadcast)--------------------------- TIP 6: explain analyze is your friend |
| ||||
| ITAGAKI Takahiro <itagaki.takahiro@oss.ntt.co.jp> writes: > Here is another patch to fix never-ending loop in mdsync. I introduced > a mdsync counter (cycle id) and cancel flags to fix the problem. > The mdsync counter is incremented at the every beginning of mdsync(). > Each pending entry has a field assigned from the counter when it is > newly inserted to pendingOpsTable. Only entries that have smaller counter > values than the mdsync counter are fsync-ed in mdsync(). > Another change is to add a cancel flag in each pending entry. When a > relation is dropped and bgwriter receives a forget-request, the corresponding > entry is marked as dropped but we don't delete it at that time. Actual > deletion is performed in the next fsync loop. We don't have to retry after > AbsorbFsyncRequests() because entries are not removed outside of seqscan. This patch looks fairly sane to me; I have a few small gripes about coding style but that can be fixed while applying. Heikki, you were concerned about the cycle-ID idea; do you have any objection to this patch? > This patch can be applied to HEAD, 8.2 and 8.1 with a few hunks. I don't think we should back-patch something that's a performance fix for an extreme case, especially not when it's not been through any extensive testing yet ... regards, tom lane ---------------------------(end of broadcast)--------------------------- TIP 2: Don't 'kill -9' the postmaster |