Are you sure a commit didn't happen between? Also, a background merge might have happened.
As to using a backup, you are right, just stop solr, put the snapshot into index/data, and restart. Upayavira On Thu, Dec 20, 2012, at 05:16 PM, Andy D'Arcy Jewell wrote: > On 20/12/12 13:38, Upayavira wrote: > > The backup directory should just be a clone of the index files. I'm > > curious to know whether it is a cp -r or a cp -lr that the replication > > handler produces. > > > > You would prevent commits by telling your app not to commit. That is, > > Solr only commits when it is *told* to. > > > > Unless you use autocommit, in which case I guess you could monitor your > > logs for the last commit, and do your backup a 10 seconds after that. > > > > > Hmm. Strange - the files created by the backup API don't seem to > correlate exactly with the files stored under the solr data directory: > > andydj@me-solr01:~$ find /tmp/snapshot.20121220155853703/ > /tmp/snapshot.20121220155853703/ > /tmp/snapshot.20121220155853703/_2vq.fdx > /tmp/snapshot.20121220155853703/_2vq_Lucene40_0.tim > /tmp/snapshot.20121220155853703/segments_2vs > /tmp/snapshot.20121220155853703/_2vq_nrm.cfs > /tmp/snapshot.20121220155853703/_2vq.fnm > /tmp/snapshot.20121220155853703/_2vq_nrm.cfe > /tmp/snapshot.20121220155853703/_2vq_Lucene40_0.frq > /tmp/snapshot.20121220155853703/_2vq.fdt > /tmp/snapshot.20121220155853703/_2vq.si > /tmp/snapshot.20121220155853703/_2vq_Lucene40_0.tip > andydj@me-solr01:~$ find /var/lib/solr/data/index/ > /var/lib/solr/data/index/ > /var/lib/solr/data/index/_2w6_Lucene40_0.frq > /var/lib/solr/data/index/_2w6.si > /var/lib/solr/data/index/segments_2w8 > /var/lib/solr/data/index/write.lock > /var/lib/solr/data/index/_2w6_nrm.cfs > /var/lib/solr/data/index/_2w6.fdx > /var/lib/solr/data/index/_2w6_Lucene40_0.tip > /var/lib/solr/data/index/_2w6_nrm.cfe > /var/lib/solr/data/index/segments.gen > /var/lib/solr/data/index/_2w6.fnm > /var/lib/solr/data/index/_2w6.fdt > /var/lib/solr/data/index/_2w6_Lucene40_0.tim > > Am I correct in thinking that to restore from this backup, I would need > to do the following? > > 1. Stop Tomcat (or maybe just solr) > 2. Remove all files under /var/lib/solr/data/index/ > 3. Move/copy files from /tmp/snapshot.20121220155853703/ to > /var/lib/solr/data/index/ > 4. Restart Tomcat (or just solr) > > > Thanks everyone who's pitched in on this! Once I've got this working, > I'll document it. > -Andy > > -- > Andy D'Arcy Jewell > > SysMicro Limited > Linux Support > E: andy.jew...@sysmicro.co.uk > W: www.sysmicro.co.uk >