julianfoad (with minor tweaks by me)


Patch
r1795351

r1795351 | stefan2 | 2017-05-16 18:20:41 +0000 (Tue, 16 May 2017)

Make verify-before-commit a configurable option in FSFS.

The option causes FSFS to verify each new revision immediately before
finalizing the commit (bumping the 'current' revision number).

It is useful to be able to enable this after repository corruption has been
observed that is suspected to be bug-induced.

The option is disabled by default in release-mode builds, and enabled by
default in debug-mode builds. Previously, the verification was permanently
disabled in release-mode builds and enabled in debug-mode builds.

* subversion/libsvn_fs_fs/fs_fs.c
  (read_config): Read the option.
  (write_config): Write a template for the option.

* subversion/libsvn_fs_fs/fs.h
  (CONFIG_OPTION_VERIFY_BEFORE_COMMIT): New.
  (fs_fs_data_t): Store the option value.

* subversion/libsvn_fs_fs/transaction.c
  (verify_as_revision_before_current_plus_plus): Rename to ...
  (verify_before_commit): ... this and compile unconditionally,
    not just in debug builds.
  (commit_body): Call the function only if the option is enabled.

Patch by: julianfoad (with minor tweaks by me)