<div class="gmail_extra"><div class="gmail_quote">2012/4/22 Olly Betts <span dir="ltr"><<a href="mailto:olly@survex.com" target="_blank">olly@survex.com</a>></span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="im">On Fri, Apr 20, 2012 at 02:17:24PM +0200, Websuche :: Felix Ostmann wrote:<br>
> 2012/4/20 Olly Betts <<a href="mailto:olly@survex.com">olly@survex.com</a>><br>
><br>
> > On Thu, Apr 19, 2012 at 03:45:36PM +0200, Websuche :: Felix Ostmann wrote:<br>
</div><div class="im">> > > /path/to/index/20120419010000<br>
> > > /path/to/index/20120419020000<br>
> > > /path/to/index/20120419030000<br>
> > > /path/to/index/default => /path/to/index/20120419030000<br>
> ><br>
> > Note that using symlinks for this isn't recommended - Xapian opens the<br>
> > files using the given path, so if it is in the middle of opening the<br>
> > database when you switch the symlink, it'll try to open half the old<br>
> > one and half the new one, which isn't good at all.<br>
> ><br>
> > It's better to use a stub database file instead.<br>
><br>
> The problem with the symlink is correct, but will only break 1 request when<br>
> the system starts and that also only in theory. If such a open occure, the<br>
> next request will close & open again (because the mtime of the iamchert is<br>
> now newer).<br>
<br>
</div>If requests are serviced in parallel, it can break more than one. It<br>
isn't going to be a huge issue if you only switch over the database<br>
hourly, but why suffer it at all when you don't need to?<br>
<div class="im"><br>
> I cannot follow your meaning of a stub-database, what do you mean?<br>
<br>
</div>The link James provided is good.<br></blockquote><div><br></div><div><div>OK, so one example:</div><div><br></div><div>- create a new database ( /path/to/databases/xapian-index-3 )</div><div>- create a new stub-file in the database directory with absolute file names and without symlinks ( /path/to/databases/xapian-index-3/stub )</div>
<div>- delete and create a default-database symlink to this database ( /path/to/databases/default => /path/to/databases/xapian-index-3 )</div><div>- check befor every request the modtime of the stub-file in the default-database and if newer close / open the database via stub-file</div>
</div><div><br></div><div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="im"><br>
> > If you destroy all references to the database, it should get closed, so<br>
> > this suggests that either the Perl bindings aren't keeping track of the<br>
> > references correctly, or there's an object you have around still with a<br>
> > reference to the Database (keeping an Enquire or MSet or TermIterator or<br>
> > similar will implicitly keep a reference to the database).<br>
><br>
> Perhaps i missed a reference, but i override the database, enquire and<br>
> queryparser-object with there new one after a new open. No other objects<br>
> should survive there scope.<br>
<br>
</div>It might be a reference tracking bug in the perl bindings, but without<br>
seeing the code it's hard to say (or find it if that's the issue). If<br>
you want to track it down (whether it is in the bindings or your own<br>
code), I'd add a line of code to print out the pointer value after each<br>
"new" of a Xapian object and before each "delete", and then see if any<br>
don't match up.<br></blockquote><div><br></div><div>i tried to reproduce it within a small snipit, but all out of scope and object-override destroys works as expected. So perhaps it is really a local problem with my code + Mojolicious. ->close help in my code so i am fine.</div>
<div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
Cheers,<br>
Olly<br>
</blockquote></div><br><br clear="all"><div><br></div>-- <br><span>Mit freundlichem Gruß</span><br><span>Felix Ostmann</span><br><br><font><span style="font-family:'courier new',monospace">-----------------------------------------------------------</span><br style="font-family:'courier new',monospace">
<span style="font-family:'courier new',monospace">Websuche Search Technology GmbH & Co. KG</span><br style="font-family:'courier new',monospace"><span style="font-family:'courier new',monospace">Martinistraße 3, D-49080 Osnabrück, Germany</span><br style="font-family:'courier new',monospace">
<span style="font-family:'courier new',monospace">-----------------------------------------------------------</span><br style="font-family:'courier new',monospace"><span style="font-family:'courier new',monospace">Tel.: +49 (0) 541 / 40666 0, Fax: +49 (0) 541 / 40666 22</span><br style="font-family:'courier new',monospace">
<span style="font-family:'courier new',monospace">Email: <a href="mailto:info@websuche.com" style="color:rgb(17,85,204)" target="_blank">info@websuche.com</a>, Web: <a href="http://www.websuche.com/" style="color:rgb(17,85,204)" target="_blank">www.websuche.com</a></span><br style="font-family:'courier new',monospace">
<span style="font-family:'courier new',monospace">-----------------------------------------------------------</span><br style="font-family:'courier new',monospace"><span style="font-family:'courier new',monospace">AG Osnabrück - HRA 200252, Ust-IdNr.: DE814737310</span><br style="font-family:'courier new',monospace">
<span style="font-family:'courier new',monospace">-----------------------------------------------------------</span><br style="font-family:'courier new',monospace"><span style="font-family:'courier new',monospace">Komplementärin: Websuche Search Technology Verwaltungs GmbH</span><br style="font-family:'courier new',monospace">
<span style="font-family:'courier new',monospace">AG Osnabrück - HRB 200359, Geschäftsführer: Ansas Meyer</span><br style="font-family:'courier new',monospace"><span style="font-family:'courier new',monospace">-----------------------------------------------------------</span><br style="font-family:'courier new',monospace">
<br style="font-family:'courier new',monospace"><span style="font-family:'courier new',monospace">Die in dieser Email enthaltenen Informationen sind vertrau-</span><br style="font-family:'courier new',monospace">
<span style="font-family:'courier new',monospace">lich zu behandeln und ausschließlich für den Adressaten be-</span><br style="font-family:'courier new',monospace"><span style="font-family:'courier new',monospace">stimmt. Jegliche Veröffentlichung, Verteilung oder sonstige</span><br style="font-family:'courier new',monospace">
<span style="font-family:'courier new',monospace">in diesem Zusammenhang stehende Handlung wird ausdrücklich</span><br style="font-family:'courier new',monospace"><span style="font-family:'courier new',monospace">untersagt.</span></font><br>
</div>