-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 5 posts ] 
Author Message
 Post subject: FSSLaveDirectoryProvider : Should I have a directory zero?
PostPosted: Fri Jan 08, 2010 10:52 am 
Regular
Regular

Joined: Thu Oct 08, 2009 10:34 am
Posts: 55
Hi Guys,
Just trying to understand how this works at start up time. I have configured the FSSlaveDirectory in a test prototype client app and I am seeing some weird results at start up time. Ok I have two directories configured, a client directory (hibernate.search.default.indexBase) and a common shared directory (hibernate.search.default.sourceBase). Now the common directory has the latest index version in it and the client directory is completely empty at start up.


After running my app my client directory looks like so
+myindex
++com.package.Foo
+++ 0 (directory zero ) 1.1g
+++ 1 (directory one ) 2kb
+++ 2 (directory two ) 2kb
+++ current1 (marker file)

Now on inititialization of the FSSlaveDirectoryProvider copies the common directory index over into the directory zero but the marker file is set to be current1. This has the effect that any queries done are done against directory 1 which has no index file in there because it was copied over into zero. It is not until the "CopyDirectory" task kicks in that FSSSlave rectifies itself and starts querying a directory which has the an index in it.

I assume this shouldnt be happening??!!

Stepped through where this is happening

In FSSSlaveDirectoryProvider
Code:
public void start(){
.......
File destinationFile = new File( indexDir, Integer.valueOf( readCurrentState ).toString() );


readCurrentState is zero because "current" is set to zero on the initialize() call and when this is executed

Code:
try {
               FileHelper.synchronize(
                     new File( sourceIndexDir, String.valueOf( sourceCurrent ) ),
                     destinationFile, true, copyChunkSize
               );
            }
            catch ( IOException e ) {
               throw new SearchException( "Unable to synchronize directory: " + indexName, e );
            }


I end up with my directory structure above. It is fine for someone with a low refresh period but for someone with a long refresh period to be querying the wrong directory with no index in it is not what you want at start up ;).


Also side note, while stepping through i noticed that FSSlaveDirectoryProvider is created several times for the same index e.g For com.package.Foo i see initialise() gets called 3-4 times for this directory, please note that only start gets called once though but I was just curious as to why create it so many times???

As always, appreciate any feedback.

Cheers,
LL

p.s Please note that I am using the FSSSlaveProviderDirectory standalone , that means no JMS configuration. Dont think it makes a difference but thought it was worth mentioning.


Top
 Profile  
 
 Post subject: Re: FSSLaveDirectoryProvider : Should I have a directory zero?
PostPosted: Fri Jan 08, 2010 2:23 pm 
Hibernate Team
Hibernate Team

Joined: Thu Apr 05, 2007 5:52 am
Posts: 1689
Location: Sweden
Hi,

it seems you spotted a bug :) I created a jira issue for it HSEARCH-440.

Thanks for your help.

--Hardy


Top
 Profile  
 
 Post subject: Re: FSSLaveDirectoryProvider : Should I have a directory zero?
PostPosted: Fri Jan 08, 2010 4:29 pm 
Hibernate Team
Hibernate Team

Joined: Thu Apr 05, 2007 5:52 am
Posts: 1689
Location: Sweden
Fixed on trunk and btw there was already a jira HSEARCH-321


Top
 Profile  
 
 Post subject: Re: FSSLaveDirectoryProvider : Should I have a directory zero?
PostPosted: Mon Jan 11, 2010 4:53 am 
Regular
Regular

Joined: Thu Oct 08, 2009 10:34 am
Posts: 55
Ok thats fine, any time line on when the 3.2 version will be released? I dont see a date on the roadmap ;).

Thanks Guys,
LL


Top
 Profile  
 
 Post subject: Re: FSSLaveDirectoryProvider : Should I have a directory zero?
PostPosted: Mon Jan 11, 2010 7:03 am 
Hibernate Team
Hibernate Team

Joined: Fri Oct 05, 2007 4:47 pm
Posts: 2536
Location: Third rock from the Sun
No there are no dates set, from what I see from current "velocity" it will probably happen somewhere in end-february / march.
You're very welcome to try trunk / next beta to provide feedback!

_________________
Sanne
http://in.relation.to/


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 5 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.