On 3/9/07, Bosko Milekic <[EMAIL PROTECTED]> wrote: > I am stress testing and here's a problem I just hit: > > - got a Rails app using AAF, indexing on several fields of the > NamespaceMembership model > > - in one rails console, I do this: > (0..10000).each do |i| > vt = VehicleType.new(...) > vt.save! > nm = NamespaceMembership.new(...) > nm.save! # this causes indexing to get triggered due to AAF after_create > hook > vt = vt.id > nm = nm.id > # this causes indexing to get triggered due to AAF after_update hook: > NamespaceMembership.destroy(nm) > VehicleType.destroy(vt) > end > > - Then while this runs I open up a browser and repeatedly hit up a > controller action with searches with a keyword that i know will match > the NamespaceMembership model I'm adding and removing in a tightloop > above. When I do this most of the time the search returns empty, but > I've got it to fail a few times; what follows is the stack trace: > > Ferret::StateError (State Error occured at <except.c>:93 in xraise > Error occured in index.c:4121 - sr_get_lazy_doc > Document 1 has already been deleted > > <snip>stack trace</snip> > > The second time it failed with a similar trace, except instead of > "Document 1 has already been deleted" it said "Document 0 has already > been deleted". > > This looks like it's coming from ferret. Know what's up?
Yep, the search finds the document and then the document is deleted by the time it is looked up. I can fix this. > This is > ferret 0.11.3 (latest as of this writing). I haven't tried multiple > simultaneous writers (e.g., two console processes adding and deleting > in a tightloop) yet, but I will next. Unfortunately, Ferret doesn't support two writers to the index so you are likely to get a lot of errors doing this. If you want multiple writers, use the acts_as_ferret DRb solution. > I've CC'd ferret-talk to see if Jens Kraemer has some advice as well. Jens, not to worry about this one. I'll get it working. -- Dave Balmain http://www.davebalmain.com/ _______________________________________________ Ferret-talk mailing list [email protected] http://rubyforge.org/mailman/listinfo/ferret-talk

