CURRENT branch

Russ Allbery rra at
Mon May 18 04:08:59 UTC 2009

Julien ÉLIE <julien at> writes:

> When we run tdx_search_open(), the remap is now done only when the
> high water mark becomes superior to the mapped high water mark.  Here,
> high water mark = 4 is not superior to the mapped high water mark = 5.
> Therefore, tdx_search() does not see it and ends up with that error.
> It is what happens.  The articles would be seen by tdx_search() if the
> DAT file was remapped by tdx_search_open(), but we have to change the
> logic which triggers that:
>    if (end > data->high && high > data->high) {
>        unmap_index(data);
>        map_index(data);
>        data->high = high;
>        unmap_data(data);
>    }
> Maybe a boolean in the group_data structure to say whether the file should
> be remapped?  (The boolean would be set during tdx_data_add().)

I think what your current fix will do is force the file to be remapped
any time any article write has happened except for a write at the
high-water mark and a search or article read that isn't at the
high-water mark.  Note that whenever you remap, you break any static
searches (that's what OVSTATICSEARCH is all about), so the comment in
the commit is a little wrong.

I think that the patch does more than is necessary.  It should be fine
if we fill in a hole in the overview below high; the active mmap should
still see that change on disk.  The problem, and what I suspect the test
is triggering, is when we've *rebased* the overview because we wrote
below the overview base number rather than just anything below the
high-water mark.  I suspect that if we just remapped when we rebased,
that would also solve the problem.

We still break the guarantee of OVSTATICSEARCH if there's an outstanding
search, though.  I wonder if we should really keep track of whether
there's an open search and change behavior in that case.

Russ Allbery (rra at             <>

    Please send questions to the list rather than mailing me directly.
     <> explains why.

More information about the inn-workers mailing list