Skip to content

Draft: Integrate WAL into UserCommitFiles for testing

Sami Hiltunen requested to merge smh-wal-user-commit-files into master

This commit changes UserCommitFiles to use the WAL for comitting its writes if enabled. When enabled, a transaction is begun through PartitionManager for the repository, the objects are written into the transaction's quarantine directory, and ultimately both reference changes and objects are committed through TransactionManager.

WAL is enabled if PartitionManager is set on the server instance. For now it is only set when the GITALY_TEST_WAL environment variable is set when running the test. A Makefile target will later be added for testing the WAL and a CI job.

There are slight behavior changes with the hooks which are left be for now:

  • 'reference-transaction prepared' is currently not acquiring locks nor verifying the reference changes. We'll likely have to extend the TransactionManager to handle this before we can roll WAL out given this affects Praefect's behavior.
  • 'update' hook is invoked with the objects still in the quarantine as opposed to the non-WAL variant. This will likely have to remain so. The objects are only written into the repository when the transaction is committed. For local execution, this shouldn't matter much since the quarantine directory is configured in the invocation. For loopback calls like what Rails does with pre-receive hook, this would be a breaking change.

Merge request reports