[Xapian-discuss] Threaded test (in C++) to reproduce our
database problems
Eric B. Ridge
ebr@tcdi.com
Wed, 16 Jun 2004 22:30:46 -0400
On 6/16/04 9:43 PM, "Olly Betts" <olly@survex.com> wrote:
> Great - this should be very helpful.
I hope so. This has been driving us nuts. We've got this problem on our
production systems and it's killin' us.
> That's less odd. After the writer has flushed twice, readers will get
> this exception - they need to call reopen() and restart the operation.
Woah, can you elaborate here? We're not calling reopen() anywhere. Not in
this little test, and not in our production code.
<short pause to RTFM>
Hmm. Sounds like we should just catch the DatabaseModifiedError, do the
reopen() and just try again, eh?
Our production code (like this test) does call flush() every-so-often, and
it's less than every 1000 add_document() calls, so we can probably track
when we do a flush() and do the re-open ourselves.
However, what if a reader thread is in the middle of reading back documents
while we do the flush() in the writer thread? Sounds like these need to be
synchronized in some way.
>
>> Writer: ERROR=Db block overwritten
>
> But the writer thread shouldn't get this unless there's another writer.
I thought this one was strange too. But you can see from the attached
example, just one writer.
> I can't see anything wrong from a quick read through. I'm right in the
> middle of something right now, but I'll give this a whirl in the next
> day or so.
If you happen to get to this sooner, send me your mailing address offline...
free pizza and beer. ;)
eric