Forum: Ferret why/when does the DRb server rebuild the index (when I don't

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Alain R. (Guest)
on 2007-07-20 19:53
(Received via mailing list)
Hi,

I'm using DRb server, and sometimes it starts rebuilding the index for
no - apparent - reason (no model nor DB schema change). As this blocks
the computer for more that an hour, I must fix this problem before I
put the system in production.

Question:
- how can I find WHY the server triggered an index rebuild?
- how can I avoid it?

Thanks in advance.

Alain
Jens K. (Guest)
on 2007-07-25 13:45
(Received via mailing list)
Hi!

First of all, what version of aaf do you use?

On Fri, Jul 20, 2007 at 05:52:22PM +0200, Alain R. wrote:
> Hi,
>
> I'm using DRb server, and sometimes it starts rebuilding the index for
> no - apparent - reason (no model nor DB schema change). As this blocks
> the computer for more that an hour, I must fix this problem before I
> put the system in production.
>
> Question:
> - how can I find WHY the server triggered an index rebuild?
> - how can I avoid it?

The only time the index is rebuilt automatically by the server is when
there is no index. Everything else I'd consider a bug.

Does the server really rebuild without any external activity, i.e.
deploying/restarting of application or drb server? Anything interesting
in the log files?


Jens

--
Jens Krämer
webit! Gesellschaft für neue Medien mbH
Schnorrstraße 76 | 01069 Dresden
Telefon +49 351 46766-0 | Telefax +49 351 46766-66
removed_email_address@domain.invalid | www.webit.de

Amtsgericht Dresden | HRB 15422
GF Sven Haubold, Hagen Malessa
Rich T. (Guest)
on 2008-03-28 21:25
I'm seeing the same re-index on every start issue as described in the
message below.  When I perform the following steps:

script/ferret_server start
mongrel_rails start

(btw, happens for every environment I've tried)

our entire User index gets rebuilt.  We've seen the problem with

ferret (0.11.6 and 0.10.13)
acts_as_ferret (plugin v. 0.4.3 I believe, unfortunately no version # in
README and we didn't record it but I'm pretty sure that's it)

I've done some debugging and the issue seems to be ferret_server.rb,
line 132, the "unless" condition in ensure_index() below:

      def ensure_index_exists(class_name)
        @logger.debug "DRb server: ensure_index_exists for class
#{class_name}"
        with_class class_name do |clazz|
          dir = clazz.aaf_configuration[:index_dir]
          unless File.directory?(dir) && File.file?(File.join(dir,
'segments')) && dir =~ %r{/\d+(_\d+)?$}
            rebuild_index(clazz)
          end
        end
      end

The regex expression in this condition is returning nil and thus kicking
off the entire re-indexing process. (I've removed this from our code
base and it seems to work). Regular expressions are not my strong suit
but I assume this is looking for the presence of index files with the
model's index directory.  Here are the contents of mine:

rjt:~/dev/aptana/plm thornett$ ls -al index/production/user/
total 7552
drwxr-xr-x   33 thornett  thornett    1122 Mar 28 14:22 .
drwxr-xr-x    9 thornett  thornett     306 Mar 28 08:59 ..
-rw-r-----    1 thornett  thornett  385352 Mar 28 08:58 _1q5.cfs
-rw-r-----    1 thornett  thornett      74 Mar 28 08:58 _1q5_f8.del
-rw-r-----    1 thornett  thornett  454390 Mar 28 08:58 _2l0.cfs
-rw-r-----    1 thornett  thornett  404030 Mar 28 08:58 _3fv.cfs
-rw-r-----    1 thornett  thornett  845336 Mar 28 08:58 _4aq.cfs
-rw-r-----    1 thornett  thornett  724955 Mar 28 08:58 _55l.cfs
-rw-r-----    1 thornett  thornett   74798 Mar 28 08:58 _58o.cfs
-rw-r-----    1 thornett  thornett  111594 Mar 28 08:58 _5br.cfs
-rw-r-----    1 thornett  thornett   20357 Mar 28 08:58 _5c2.cfs
-rw-r-----    1 thornett  thornett   12133 Mar 28 08:58 _5cd.cfs
-rw-r-----    1 thornett  thornett   21077 Mar 28 08:58 _5co.cfs
-rw-r-----    1 thornett  thornett   24513 Mar 28 08:58 _5cz.cfs
-rw-r-----    1 thornett  thornett   17663 Mar 28 08:58 _5da.cfs
-rw-r-----    1 thornett  thornett   16144 Mar 28 08:58 _5dl.cfs
-rw-r-----    1 thornett  thornett   13157 Mar 28 08:58 _5dw.cfs
-rw-r-----    1 thornett  thornett   10201 Mar 28 08:58 _5e7.cfs
-rw-r-----    1 thornett  thornett       5 Mar 28 08:58 _5e7_0.del
-rw-r-----    1 thornett  thornett    7318 Mar 28 08:58 _5ei.cfs
-rw-r-----    1 thornett  thornett    1137 Mar 28 08:58 _5ej.cfs
-rw-r-----    1 thornett  thornett    1132 Mar 28 08:58 _5ek.cfs
-rw-r-----    1 thornett  thornett    4339 Mar 28 08:58 _5el.cfs
-rw-r-----    1 thornett  thornett    2742 Mar 28 08:58 _5em.cfs
-rw-r-----    1 thornett  thornett    1097 Mar 28 08:58 _5en.cfs
-rw-r-----    1 thornett  thornett    2505 Mar 28 08:58 _5eo.cfs
-rw-r-----    1 thornett  thornett    1472 Mar 28 08:58 _5ep.cfs
-rw-r-----    1 thornett  thornett    2534 Mar 28 08:58 _5eq.cfs
-rw-r-----    1 thornett  thornett    2114 Mar 28 08:58 _5er.cfs
-rw-r-----    1 thornett  thornett  632131 Mar 28 08:58 _uu.cfs
-rw-r-----    1 thornett  thornett     130 Mar 28 08:58 _uu_qe.del
-rw-r-----    1 thornett  thornett      16 Mar 28 08:58 segments
-rw-r-----    1 thornett  thornett    1133 Mar 28 08:58 segments_6kt

and the value of dir that's being tested against the regex is:

./script/../vendor/plugins/acts_as_ferret/lib/../../../../index/production/user

Whatever the regex is looking for it doesn't seem to be finding it. Is
this a bug or is there something odd about our index?  Any insight into
this is much appreciated, thanks.

Rich Thornett

Jens K. wrote:
> Hi!
>
> First of all, what version of aaf do you use?
>
> On Fri, Jul 20, 2007 at 05:52:22PM +0200, Alain R. wrote:
>> Hi,
>>
>> I'm using DRb server, and sometimes it starts rebuilding the index for
>> no - apparent - reason (no model nor DB schema change). As this blocks
>> the computer for more that an hour, I must fix this problem before I
>> put the system in production.
>>
>> Question:
>> - how can I find WHY the server triggered an index rebuild?
>> - how can I avoid it?
>
> The only time the index is rebuilt automatically by the server is when
> there is no index. Everything else I'd consider a bug.
>
> Does the server really rebuild without any external activity, i.e.
> deploying/restarting of application or drb server? Anything interesting
> in the log files?
>
>
> Jens
>
> --
> Jens Kr�mer
> webit! Gesellschaft f�r neue Medien mbH
> Schnorrstra�e 76 | 01069 Dresden
> Telefon +49 351 46766-0 | Telefax +49 351 46766-66
> removed_email_address@domain.invalid | www.webit.de
>
> Amtsgericht Dresden | HRB 15422
> GF Sven Haubold, Hagen Malessa
This topic is locked and can not be replied to.