svn_fs_recover

Function svn_fs_recover 

Source
pub unsafe extern "C" fn svn_fs_recover(
    path: *const c_char,
    cancel_func: svn_cancel_func_t,
    cancel_baton: *mut c_void,
    pool: *mut apr_pool_t,
) -> *mut svn_error_t
Expand description

Perform any necessary non-catastrophic recovery on the Subversion filesystem located at @a path.

If @a cancel_func is not @c NULL, it is called periodically with @a cancel_baton as argument to see if the client wishes to cancel recovery. BDB filesystems do not currently support cancellation.

Do any necessary allocation within @a pool.

For FSFS filesystems, recovery is currently limited to recreating the db/current file, and does not require exclusive access.

For BDB filesystems, recovery requires exclusive access, and is described in detail below.

After an unexpected server exit, due to a server crash or a system crash, a Subversion filesystem based on Berkeley DB needs to run recovery procedures to bring the database back into a consistent state and release any locks that were held by the deceased process. The recovery procedures require exclusive access to the database — while they execute, no other process or thread may access the database.

In a server with multiple worker processes, like Apache, if a worker process accessing the filesystem dies, you must stop the other worker processes, and run recovery. Then, the other worker processes can re-open the database and resume work.

If the server exited cleanly, there is no need to run recovery, but there is no harm in it, either, and it take very little time. So it’s a fine idea to run recovery when the server process starts, before it begins handling any requests.

@since New in 1.5.