Hyrum K. Wright wrote on Sat, 21 Nov 2009 at 22:01 -0600:
> 
> On Nov 21, 2009, at 5:00 PM, Ivan Zhakov wrote:
> 
> > Anyway svnsync sometimes fails with error that revision property not
> > found if repository packed in background. Probably this happened due
> > the following race condition:
> > 1. svnsync open FS using svn_fs_fs__open(), repository isn't packed so
> > fs->min_unpacked_revprop == 0
> > 2. svnadmin packs revprop and updates min-unpacked-revprop to 1000.
> > 3. svnsync changes revision property for revision 0, since repository
> > already open and min_unpacked_revprop == 0 it tries to write
> > properties to file 'revprops\1\0' instead of writing them to SQLite
> > database.
> > 
> > The same situation may happen when svnsync tries to get revision property.
> 
> I see a few possible solutions:
>  * Re-read the min-unpacked-rev and min-unpacked-revprop values whenever 
> acquiring the write lock.  Hmm, but the problem could happen to readers, too, 
> and those don't grab the lock.
>  * Wrap these files with a separate lock.  Ugly, and probably a performance 
> hit.
>  * On error, re-read the min-unpacked-rev and min-unpacked-revprop values and 
> try again (if different).
> 
> I'm leaning toward the last one, since it seems like a rather rare 
> occurrence, and it wouldn't kill performance.  Thoughts?
> 

The last one is what we do for min-unpacked-rev.

(Haven't read the race condition in detail, though; possibly there will 
still be a window where a 'propset' (on an old revision) might get 
ignored?  Or will such a 'propset' write to both the revprops/ file and 
the sqlite DB?)

Daniel

> -Hyrum

Reply via email to