Re: svn commit: r1326307 - in /subversion/trunk: ./ build/ac-macros/ subversion/include/ subversion/include/private/ subversion/libsvn_fs_fs/ subversion/libsvn_subr/ subversion/mod_dav_svn/ subversion
Am 24.04.2012 18:55, schrieb Daniel Shahaf: stef...@apache.org wrote on Sun, Apr 15, 2012 at 11:20:59 -: Author: stefan2 Date: Sun Apr 15 11:20:58 2012 New Revision: 1326307 URL: http://svn.apache.org/viewvc?rev=1326307view=rev Log: Merge all changes (-r1298521-1326293) from branches/revprop-cache to trunk and resolve minor conflicts. Stefan -- I've removed the branch (r1329848) as I presumed it's no longer needed. I was about to do the same today ;) -- Stefan^2.
Re: svn commit: r1326307 - in /subversion/trunk: ./ build/ac-macros/ subversion/include/ subversion/include/private/ subversion/libsvn_fs_fs/ subversion/libsvn_subr/ subversion/mod_dav_svn/ subversion
stef...@apache.org wrote on Sun, Apr 15, 2012 at 11:20:59 -: Author: stefan2 Date: Sun Apr 15 11:20:58 2012 New Revision: 1326307 URL: http://svn.apache.org/viewvc?rev=1326307view=rev Log: Merge all changes (-r1298521-1326293) from branches/revprop-cache to trunk and resolve minor conflicts. Stefan -- I've removed the branch (r1329848) as I presumed it's no longer needed.
Re: svn commit: r1326307 - in /subversion/trunk: ./ build/ac-macros/ subversion/include/ subversion/include/private/ subversion/libsvn_fs_fs/ subversion/libsvn_subr/ subversion/mod_dav_svn/ subversion
Bert Huijben wrote: -Original Message- From:stef...@apache.org [mailto:stef...@apache.org] Sent: zondag 15 april 2012 13:21 To:comm...@subversion.apache.org Subject: svn commit: r1326307 - in /subversion/trunk: ./ build/ac-macros/ subversion/include/ subversion/include/private/ subversion/libsvn_fs_fs/ subversion/libsvn_subr/ subversion/mod_dav_svn/ subversion/svnadmin/ subversion/svnserve/ subversion/tests/ subver... Partial review for some of the code in svn_io.h Author: stefan2 Date: Sun Apr 15 11:20:58 2012 New Revision: 1326307 URL:http://svn.apache.org/viewvc?rev=1326307view=rev Log: Merge all changes (-r1298521-1326293) from branches/revprop-cache to trunk and resolve minor conflicts. Added: subversion/trunk/subversion/include/private/svn_named_atomic.h - copied unchanged from r1326293, subversion/branches/revprop- cache/subversion/include/private/svn_named_atomic.h subversion/trunk/subversion/libsvn_subr/svn_named_atomic.c - copied unchanged from r1326293, subversion/branches/revprop- cache/subversion/libsvn_subr/svn_named_atomic.c subversion/trunk/subversion/tests/libsvn_subr/named_atomic-test- common.h - copied unchanged from r1326293, subversion/branches/revprop- cache/subversion/tests/libsvn_subr/named_atomic-test-common.h subversion/trunk/subversion/tests/libsvn_subr/named_atomic-test- proc.c - copied unchanged from r1326293, subversion/branches/revprop- cache/subversion/tests/libsvn_subr/named_atomic-test-proc.c subversion/trunk/subversion/tests/libsvn_subr/named_atomic-test.c - copied, changed from r1326293, subversion/branches/revprop- cache/subversion/tests/libsvn_subr/named_atomic-test.c Modified: subversion/trunk/ (props changed) subversion/trunk/build.conf subversion/trunk/build/ac-macros/svn-macros.m4 subversion/trunk/configure.ac subversion/trunk/subversion/include/svn_error_codes.h subversion/trunk/subversion/include/svn_fs.h subversion/trunk/subversion/include/svn_io.h subversion/trunk/subversion/libsvn_fs_fs/caching.c subversion/trunk/subversion/libsvn_fs_fs/fs.h subversion/trunk/subversion/libsvn_fs_fs/fs_fs.c subversion/trunk/subversion/libsvn_subr/io.c subversion/trunk/subversion/mod_dav_svn/dav_svn.h subversion/trunk/subversion/mod_dav_svn/mod_dav_svn.c subversion/trunk/subversion/mod_dav_svn/repos.c subversion/trunk/subversion/svnadmin/main.c subversion/trunk/subversion/svnserve/main.c subversion/trunk/subversion/svnserve/serve.c subversion/trunk/subversion/svnserve/server.h subversion/trunk/subversion/tests/libsvn_repos/repos-test.c subversion/trunk/subversion/tests/libsvn_subr/ (props changed) subversion/trunk/subversion/tests/svn_test.h Propchange: subversion/trunk/ -- Merged /subversion/branches/revprop-cache:r1298521-1326293 Modified: subversion/trunk/subversion/include/svn_io.h URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/include/svn_io. h?rev=1326307r1=1326306r2=1326307view=diff == --- subversion/trunk/subversion/include/svn_io.h (original) +++ subversion/trunk/subversion/include/svn_io.h Sun Apr 15 11:20:58 2012 @@ -682,6 +682,39 @@ svn_io_file_lock2(const char *lock_file, svn_boolean_t exclusive, svn_boolean_t nonblocking, apr_pool_t *pool); + +/** + * Lock the file @a lockfile_handle. If @a exclusive is TRUE, + * obtain exclusive lock, otherwise obtain shared lock. + * + * If @a nonblocking is TRUE, do not wait for the lock if it + * is not available: throw an error instead. + * + * Lock will be automatically released when @a pool is cleared or destroyed. + * You may also explicitly call @ref svn_io_unlock_open_file. + * Use @a pool for memory allocations. @a pool must be the pool that + * @a lockfile_handle has been created in or one of its sub-pools. + * + * @since New in 1.8. + */ +svn_error_t * +svn_io_lock_open_file(apr_file_t *lockfile_handle, + svn_boolean_t exclusive, + svn_boolean_t nonblocking, + apr_pool_t *pool); What does a nonexclusive shared lock 'lock'? What does it block? What does it allow? Does it just block exclusive locks? Or does it block writers? The same thing as in svn_io_file_lock2() ;) I haven't looked at the implementation but my guess is that it will prevent exclusive locks. + +/** + * Unlock the file @a lockfile_handle. + * + * Use @a pool for memory allocations. @a pool must be the pool that + * @a lockfile_handle has been created in or one of its sub-pools. + * + * @since New in 1.8. + */ +svn_error_t * +svn_io_unlock_open_file(apr_file_t *lockfile_handle, +apr_pool_t *pool); + /** * Flush any unwritten data from @a file
Re: svn commit: r1326307 - in /subversion/trunk: ./ build/ac-macros/ subversion/include/ subversion/include/private/ subversion/libsvn_fs_fs/ subversion/libsvn_subr/ subversion/mod_dav_svn/ subversion
On Sun, Apr 15, 2012 at 6:20 AM, stef...@apache.org wrote: Author: stefan2 Date: Sun Apr 15 11:20:58 2012 New Revision: 1326307 URL: http://svn.apache.org/viewvc?rev=1326307view=rev Log: Merge all changes (-r1298521-1326293) from branches/revprop-cache to trunk and resolve minor conflicts. Added: subversion/trunk/subversion/include/private/svn_named_atomic.h - copied unchanged from r1326293, subversion/branches/revprop-cache/subversion/include/private/svn_named_atomic.h subversion/trunk/subversion/libsvn_subr/svn_named_atomic.c - copied unchanged from r1326293, subversion/branches/revprop-cache/subversion/libsvn_subr/svn_named_atomic.c Minor nit: The svn_ prefix in this filename is redundant. I know we have existing svn_foo.c files in libsvn_subr, but that doesn't mean we need another one. :) -Hyrum -- uberSVN: Apache Subversion Made Easy http://www.uberSVN.com/
Re: svn commit: r1326307 - in /subversion/trunk: ./ build/ac-macros/ subversion/include/ subversion/include/private/ subversion/libsvn_fs_fs/ subversion/libsvn_subr/ subversion/mod_dav_svn/ subversion
On 04/15/2012 04:20 AM, stef...@apache.org wrote: Author: stefan2 Date: Sun Apr 15 11:20:58 2012 New Revision: 1326307 URL: http://svn.apache.org/viewvc?rev=1326307view=rev Log: Merge all changes (-r1298521-1326293) from branches/revprop-cache to trunk and resolve minor conflicts. +/* Test whether revprop cache and necessary infrastructure are + available in FS. */ +static svn_boolean_t +has_revprop_cache(svn_fs_t *fs) +{ + fs_fs_data_t *ffd = fs-fsap_data; + svn_error_t *error; + + /* is the cache (still) enabled? */ + if (ffd-revprop_cache == NULL) +return FALSE; + + /* try to access our SHM-backed infrastructure */ + error = ensure_revprop_generation(fs); + if (error) +{ + /* failure - disable revprop cache for good */ + + svn_error_clear(error); Should we log why it was disabled instead of silently doing so? I would want a way to determine why it was disabled. How about returning the error to the caller so they can log it? They can check the svn_error_t == SVN_NO_ERROR to see if it's enabled or not. +/* Read the current revprop generation and return it in *GENERATION. + Also, detect aborted / crashed writers and recover from that. + Use the access object in FS to set the shared mem values. */ +static svn_error_t * +read_revprop_generation(svn_fs_t *fs, +apr_int64_t *generation) Out parameters are normally listed first. Blair
Re: svn commit: r1326307 - in /subversion/trunk: ./ build/ac-macros/ subversion/include/ subversion/include/private/ subversion/libsvn_fs_fs/ subversion/libsvn_subr/ subversion/mod_dav_svn/ subversion
Blair Zajac wrote: On 04/15/2012 04:20 AM, stef...@apache.org wrote: Author: stefan2 Date: Sun Apr 15 11:20:58 2012 New Revision: 1326307 URL: http://svn.apache.org/viewvc?rev=1326307view=rev Log: Merge all changes (-r1298521-1326293) from branches/revprop-cache to trunk and resolve minor conflicts. +/* Test whether revprop cache and necessary infrastructure are + available in FS. */ +static svn_boolean_t +has_revprop_cache(svn_fs_t *fs) +{ + fs_fs_data_t *ffd = fs-fsap_data; + svn_error_t *error; + + /* is the cache (still) enabled? */ + if (ffd-revprop_cache == NULL) +return FALSE; + + /* try to access our SHM-backed infrastructure */ + error = ensure_revprop_generation(fs); + if (error) +{ + /* failure - disable revprop cache for good */ + + svn_error_clear(error); Should we log why it was disabled instead of silently doing so? I would want a way to determine why it was disabled. What logging API should I call? How about returning the error to the caller so they can log it? They can check the svn_error_t == SVN_NO_ERROR to see if it's enabled or not. I don't think that the answer to the question shall I use the revprop cache? should be does not compute! instead of a simple no. +/* Read the current revprop generation and return it in *GENERATION. + Also, detect aborted / crashed writers and recover from that. + Use the access object in FS to set the shared mem values. */ +static svn_error_t * +read_revprop_generation(svn_fs_t *fs, +apr_int64_t *generation) Out parameters are normally listed first. Fixed in r1326384. Thanks for the review! -- Stefan^2.
RE: svn commit: r1326307 - in /subversion/trunk: ./ build/ac-macros/ subversion/include/ subversion/include/private/ subversion/libsvn_fs_fs/ subversion/libsvn_subr/ subversion/mod_dav_svn/ subversion
-Original Message- From: stef...@apache.org [mailto:stef...@apache.org] Sent: zondag 15 april 2012 13:21 To: comm...@subversion.apache.org Subject: svn commit: r1326307 - in /subversion/trunk: ./ build/ac-macros/ subversion/include/ subversion/include/private/ subversion/libsvn_fs_fs/ subversion/libsvn_subr/ subversion/mod_dav_svn/ subversion/svnadmin/ subversion/svnserve/ subversion/tests/ subver... Partial review for some of the code in svn_io.h Author: stefan2 Date: Sun Apr 15 11:20:58 2012 New Revision: 1326307 URL: http://svn.apache.org/viewvc?rev=1326307view=rev Log: Merge all changes (-r1298521-1326293) from branches/revprop-cache to trunk and resolve minor conflicts. Added: subversion/trunk/subversion/include/private/svn_named_atomic.h - copied unchanged from r1326293, subversion/branches/revprop- cache/subversion/include/private/svn_named_atomic.h subversion/trunk/subversion/libsvn_subr/svn_named_atomic.c - copied unchanged from r1326293, subversion/branches/revprop- cache/subversion/libsvn_subr/svn_named_atomic.c subversion/trunk/subversion/tests/libsvn_subr/named_atomic-test- common.h - copied unchanged from r1326293, subversion/branches/revprop- cache/subversion/tests/libsvn_subr/named_atomic-test-common.h subversion/trunk/subversion/tests/libsvn_subr/named_atomic-test- proc.c - copied unchanged from r1326293, subversion/branches/revprop- cache/subversion/tests/libsvn_subr/named_atomic-test-proc.c subversion/trunk/subversion/tests/libsvn_subr/named_atomic-test.c - copied, changed from r1326293, subversion/branches/revprop- cache/subversion/tests/libsvn_subr/named_atomic-test.c Modified: subversion/trunk/ (props changed) subversion/trunk/build.conf subversion/trunk/build/ac-macros/svn-macros.m4 subversion/trunk/configure.ac subversion/trunk/subversion/include/svn_error_codes.h subversion/trunk/subversion/include/svn_fs.h subversion/trunk/subversion/include/svn_io.h subversion/trunk/subversion/libsvn_fs_fs/caching.c subversion/trunk/subversion/libsvn_fs_fs/fs.h subversion/trunk/subversion/libsvn_fs_fs/fs_fs.c subversion/trunk/subversion/libsvn_subr/io.c subversion/trunk/subversion/mod_dav_svn/dav_svn.h subversion/trunk/subversion/mod_dav_svn/mod_dav_svn.c subversion/trunk/subversion/mod_dav_svn/repos.c subversion/trunk/subversion/svnadmin/main.c subversion/trunk/subversion/svnserve/main.c subversion/trunk/subversion/svnserve/serve.c subversion/trunk/subversion/svnserve/server.h subversion/trunk/subversion/tests/libsvn_repos/repos-test.c subversion/trunk/subversion/tests/libsvn_subr/ (props changed) subversion/trunk/subversion/tests/svn_test.h Propchange: subversion/trunk/ -- Merged /subversion/branches/revprop-cache:r1298521-1326293 Modified: subversion/trunk/subversion/include/svn_io.h URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/include/svn_io. h?rev=1326307r1=1326306r2=1326307view=diff == --- subversion/trunk/subversion/include/svn_io.h (original) +++ subversion/trunk/subversion/include/svn_io.h Sun Apr 15 11:20:58 2012 @@ -682,6 +682,39 @@ svn_io_file_lock2(const char *lock_file, svn_boolean_t exclusive, svn_boolean_t nonblocking, apr_pool_t *pool); + +/** + * Lock the file @a lockfile_handle. If @a exclusive is TRUE, + * obtain exclusive lock, otherwise obtain shared lock. + * + * If @a nonblocking is TRUE, do not wait for the lock if it + * is not available: throw an error instead. + * + * Lock will be automatically released when @a pool is cleared or destroyed. + * You may also explicitly call @ref svn_io_unlock_open_file. + * Use @a pool for memory allocations. @a pool must be the pool that + * @a lockfile_handle has been created in or one of its sub-pools. + * + * @since New in 1.8. + */ +svn_error_t * +svn_io_lock_open_file(apr_file_t *lockfile_handle, + svn_boolean_t exclusive, + svn_boolean_t nonblocking, + apr_pool_t *pool); What does a nonexclusive shared lock 'lock'? What does it block? What does it allow? Does it just block exclusive locks? Or does it block writers? + +/** + * Unlock the file @a lockfile_handle. + * + * Use @a pool for memory allocations. @a pool must be the pool that + * @a lockfile_handle has been created in or one of its sub-pools. + * + * @since New in 1.8. + */ +svn_error_t * +svn_io_unlock_open_file(apr_file_t *lockfile_handle, +apr_pool_t *pool); + /** * Flush any unwritten data from @a file to disk. Use @a pool for * memory allocations. snip Modified: subversion/trunk