An error occurred while fetching folder content.
Sami Hiltunen
authored
This commit adds support for setting custom hooks through the write-ahead log. This will later ensure the hooks are replicated as part of the log and that they are included in the WAL based backups. The hooks are taken in the same TAR archive format as they are currently received by `SetCustomHooks`. The TAR archive itself may extract for example symbolic hooks and files that Gitaly does not have permission to operate on. This is a more general issue so these are not tested here as part of the `TranscationManager` tests. To keep the implementation simpler for now, we assume the hooks are generally fairly small. The hooks TAR is loaded into memory and written to the database. The custom hooks are stored in `<repo>/wal/hooks/<log_index>`. This enables supporting snapshot reads later as we can keep multiple versions of the hooks available. There's no logic to wire the hooks into the Git calls yet. This is left for later when we have a way to start a transaction, during which we'd decide which hooks to use for the transaction's snapshot. Once that is done, the correct version of hooks the hooks will be wired to the Git invocations via the `core.hooksPath` configuration option. While the log entries carrying the hooks are pruned, the hooks themselves are not yet pruned from the disk. This is left for later as well since we'd have to wait for all transactions to be done using the hooks before we can remove them. We'll add this functionality later once there is a way to start a transaction explicitly.
Name | Last commit | Last update |
---|