> -----Original Message----- > From: Julian Foad [mailto:julianf...@btopenworld.com] > Sent: maandag 22 april 2013 16:34 > To: Johan Corveleyn > Cc: Bert Huijben; Subversion Development > Subject: Re: Pristine text missing - cleanup doesn't work > > I have filed this as issue #4357, "Pristine text missing - cleanup doesn't > work", > with a reference to this email thread. > > I thought of the following possible improvements, which I have noted in the > doc string of pristine_cleanup_wcroot(): > > * TODO: At least check that any zero refcount is really correct, before > * using it.
We already do this in debug builds. The foreign key check enforces this, but at a certainly not-null performance cost (understatement). This is why I haven't enabled this for release builds. (The original reason for not enabling them was that it required a newer Sqlite version) You can't delete a PRISTINE row that is used with foreign keys enabled. (That part is currently not backed by an index... the performance killer. And optimized away by our reference counting via triggers) > * TODO: Ideas for possible extra clean-up operations: > * > * * Check and correct all the refcounts. Identify any rows missing > * from the 'pristine' table. (Create a temporary index for speed > * if necessary?) The index you need is already there, or the triggers that update them on any change of NODES would be terribly slow. With foreign key checking enabled you can't add a row to NODES pointing to a non-existing PRISTINE row. > * > * * Check the checksums. (Very expensive to check them all, so find > * a way to not check them all.) > * > * * Check for pristine files missing from disk but referenced in the > * 'pristine' table. > * > * * Repair any pristine files missing from disk and/or rows missing > * from the 'pristine' table and/or bad checksums. Generally > * requires contacting the server, so requires support at a higher > * level than this function. > * > * * Identify any pristine text files on disk that are not referenced > * in the DB, and delete them. > * > * TODO: Provide feedback about any errors found and any corrections > made. > > Also, here is the "svn-fetch-pristine-by-sha1.sh" script that I mentioned in > my initial email but forgot to attach there. Bert