> Actually, Now I just got a similar error with the xapian backend:
>
> http://dpaste.com/hold/109548/
Quoting the xapian-haystack documentation:
Because Xapian does not support simultaneous WritableDatabase
connections, it is *strongly* recommended that users either set
`WSGIDaemonProcess processes=1` or override the default
SearchIndex class to remove the post-save and post-delete signals
that cause an immediate re-index. Instead, manually re-index your
site content through a cronjob at pre-determined times.
You can also use a queue (many senders, one receiver which is the only
thing needing a write lock on the database) to avoid full re-indexing,
which can become impractical in large systems.
J
--
James Aylett
Just to re-iterate what was discussed on IRC (in case anyone else is having a similar issue). It appears as though multi-threading the WSGIDaemonProcess may be causing the same issue with multiple WritableDatabse connections.
In this case, there are two possible solutions:
1) Re-write the WSGIDaemonProcess directive to only make use of one process and/or thread; or (a better solution in my opinion)
2) Derive your search indexes from a custom SearchIndex that overrides the post save and delete signals like this: http://gist.github.com/214254
Hope that helps.
David
Yep, so far so good. I made a blog post:
http://skyl.org/log/post/skyl/2009/10/django-haystack-with-whoosh-or-xapian-get-around-the-lockerrors-for-a-site-with-significant-traffic/
detailing today's activities. It will be outdated in no time (hopefully) but is decent haystack/xapian tutorial for today.
> I prefer the queue approach as James Aylett said. It would be better if
> haystack provide such function.
I believe that the Haystack attitude here is to let you plug into a
queue, since there are so many options. You should be able to hook up
any queue you want by overriding save/delete in the same way as
mentioned for just making them do nothing.
I believe that the Haystack attitude here is to let you plug into a
On Wed, Oct 21, 2009 at 09:40:20AM +0800, @@ wrote:
> I prefer the queue approach as James Aylett said. It would be better if
> haystack provide such function.
queue, since there are so many options. You should be able to hook up
any queue you want by overriding save/delete in the same way as
mentioned for just making them do nothing.