You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-user@lucene.apache.org by nskmda <ns...@aol.com> on 2011/04/14 21:45:58 UTC

Solr 3.1 core with RAMDirectory isn't reloaded

Hello,

We just tried core reloading on a freshly installed Solr 3.1.0 with
RamDirectoryFactory.
It doesn't seem to happen.
With the FSDirectoryFactory everything works fine.

Looks like the RamDirectoryFactory implementation caches directory and if
it's available it doesn't really reopen it thus not having updated index
loaded into memory.

Can anyone comment on this?
Should we implement our own RamDirectoryFactory?

Here is the code snippet from Solr 3.1.0. It looks a bit confusing.

public Directory open(String path) throws IOException {
    synchronized (RAMDirectoryFactory.class) {
      RefCntRamDirectory directory = directories.get(path);
      if (directory == null || !directory.isOpen()) {
        directory = (RefCntRamDirectory) openNew(path);
        directories.put(path, directory);
      } else {
        directory.incRef();
      }

      return directory;
    }
  }


Shouldn't the directory reload the data whenever it gets an opening request
(because incRef doesn't really do much except for reference count
increment)?
We expected it to reload the data (or at least check the data on disk has
been updated) even if the path to the filesystem directory is the same.

Regards,
Dmitry


--
View this message in context: http://lucene.472066.n3.nabble.com/Solr-3-1-core-with-RAMDirectory-isn-t-reloaded-tp2821875p2821875.html
Sent from the Solr - User mailing list archive at Nabble.com.