Hi. We use FerretDrb for search. If the ferret process is down, our entire application comes down the moment we try to save a model which is indexed. Is there a way to decouple this relationship such that we can somehow resume normal operations despite ferret being down and not index the model? Thanks. Morten
Hongli Lai
2007-Nov-11 16:19 UTC
[Ferret-talk] Reducing dependency on remote ferret process
Morten wrote:> Hi. > > We use FerretDrb for search. If the ferret process is down, our entire > application comes down the moment we try to save a model which is indexed. > > Is there a way to decouple this relationship such that we can somehow > resume normal operations despite ferret being down and not index the model? > > Thanks. > > MortenI really don''t understand your concern. I could also say "if the web server process is down, our entire application is down" (assuming you''re talking about a web app). The FerretDrb process shouldn''t be down. If you continue even if it''s down, your index will become out of date. Depending on your data that may or may not be worse than crashing.
Hongli Lai wrote:> Morten wrote: >> Hi. >> >> We use FerretDrb for search. If the ferret process is down, our entire >> application comes down the moment we try to save a model which is indexed. >> >> Is there a way to decouple this relationship such that we can somehow >> resume normal operations despite ferret being down and not index the model? >> >> Thanks. >> >> Morten > > I really don''t understand your concern. I could also say "if the web > server process is down, our entire application is down" (assuming you''re > talking about a web app). The FerretDrb process shouldn''t be down. If > you continue even if it''s down, your index will become out of date. > Depending on your data that may or may not be worse than crashing.I don''t think your comparison is quite fair. Ferret is nice, but it''s not fully matured compared to Apache, MySQL and so on. At least I''m having more stability issues with it than I''ve had with the other processes that I base my work on, which is why I think my concern is completely valid. Br, Morten
Benjamin Krause
2007-Nov-11 21:36 UTC
[Ferret-talk] Reducing dependency on remote ferret process
Hey .. unfortunately, no .. not with the current construction. However, there might be a chance to switch to a messaging service like ap4r, so your indexing requests doesn''t get lost. I think there are some considerations about re-factoring the drb server, so maybe this dependency might be dropped in the future.. Cheers Ben On 2007-11-11, at 16:09, Morten wrote:> > Hi. > > We use FerretDrb for search. If the ferret process is down, our entire > application comes down the moment we try to save a model which is > indexed. > > Is there a way to decouple this relationship such that we can somehow > resume normal operations despite ferret being down and not index the > model? > > Thanks. > > Morten > > > _______________________________________________ > Ferret-talk mailing list > Ferret-talk at rubyforge.org > http://rubyforge.org/mailman/listinfo/ferret-talkGruss Ben --- Benjamin Krause http://www.omdb.org/ bk at benjaminkrause.com Rails-Schulung "Advancing with Rails" mit David A. Black 19.11.-22.11.2007, Berlin-Mitte Details u. Anmeldung: http://www.railsschulung.de -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/ferret-talk/attachments/20071111/aeb7c5d3/attachment.html
Julio Cesar Ody
2007-Nov-11 22:03 UTC
[Ferret-talk] Reducing dependency on remote ferret process
Let me take a wild guess on this one. On ACTS_AS_FERRET_GEM_ROOT/lib/index.rb def ferret_create if ferret_enabled? logger.debug "ferret_create/update: #{self.class.name} : #{self.id}" self.class.aaf_index << self else ferret_enable if @ferret_disabled == :once end true # signal success to AR end Try wrapping "aaf_index<<" like this begin self.class.aaf_index << self rescue Exception => e logger.warn "Error creating/updating document: #{e.inspect}\n#{e.backtrace.join("\n\t")}" end Mind I''m just reading the source and writing the code here straight away. In the event of my theory being right, this would gracefully handle exceptions related to adding an entry to the index by dropping a warning in the AAF log file and moving on. I think this could be an optional in config/initializers (Rails 2.0) perhaps, as in config.aaf.exception_on_save = true IMHO, of course. On Nov 12, 2007 8:36 AM, Benjamin Krause <bk at benjaminkrause.com> wrote:> Hey .. > > unfortunately, no .. not with the current construction. > However, there might be a chance to switch to a > messaging service like ap4r, so your indexing > requests doesn''t get lost. > > I think there are some considerations about re-factoring > the drb server, so maybe this dependency might be > dropped in the future.. > > Cheers > Ben > > > > > > > On 2007-11-11, at 16:09, Morten wrote: > > Hi. > > We use FerretDrb for search. If the ferret process is down, our entire > application comes down the moment we try to save a model which is indexed. > > Is there a way to decouple this relationship such that we can somehow > resume normal operations despite ferret being down and not index the model? > > Thanks. > > Morten > > > _______________________________________________ > Ferret-talk mailing list > Ferret-talk at rubyforge.org > http://rubyforge.org/mailman/listinfo/ferret-talk > > > > Gruss > Ben > --- > Benjamin Krause > http://www.omdb.org/ > bk at benjaminkrause.com > > Rails-Schulung "Advancing with Rails" mit David A. Black > 19.11.-22.11.2007, Berlin-Mitte > Details u. Anmeldung: http://www.railsschulung.de > > > > _______________________________________________ > Ferret-talk mailing list > Ferret-talk at rubyforge.org > http://rubyforge.org/mailman/listinfo/ferret-talk >
Peter Jones
2007-Nov-16 16:24 UTC
[Ferret-talk] Reducing dependency on remote ferret process
Morten, If you''re still looking at how to solve this, here is what I did. This is just a hack, but I didn''t really have a choice, this coupling was killing my entire application stack. --- act_methods.rb (revision 1534) +++ act_methods.rb (working copy) @@ -185,9 +185,10 @@ end logger.info "default field list: #{aaf_configuration[:ferret] [:default_field].inspect}" - if options[:remote] - aaf_index.ensure_index_exists - end + # FIXME fix and send a patch to the AAF team + # if options[:remote] + # aaf_index.ensure_index_exists + # end end -- Peter Jones - 303-669-2637 pmade inc. - http://pmade.com On Nov 11, 2007, at 08:09, Morten wrote:> We use FerretDrb for search. If the ferret process is down, our entire > application comes down the moment we try to save a model which is > indexed. > > Is there a way to decouple this relationship such that we can somehow > resume normal operations despite ferret being down and not index the > model?
John Bachir
2008-Feb-01 01:32 UTC
[Ferret-talk] Reducing dependency on remote ferret process
I''ve added suggestions from Julio Cesar Ody and Peter Jones to the relevant ticket: http://projects.jkraemer.net/acts_as_ferret/ticket/149 If anyone has another solution, consider adding it to the ticket. Quote code in trac like this: {{{ my code }}}