Skip to content

hook: Always synchronize hook executions

In Gitaly Cluster, custom hooks only run on the primary node. Consequentially, secondary Gitaly nodes may already forge ahead while the primary is still executing the hooks. Depending on how long they run, this can cause the secondaries to already lock references for an extended amount of time while they are waiting for the primary node to catch up.

To fix this edge case we have introduced "synchronizing" votes in commit 38e01406 (gitaly/hook: Fix packed-refs lock contention by synchronizing hooks, 2023-06-13). These synchronizing votes cause the secondaries to wait for the primary to have executed the hooks before they start to lock any of the references on disk.

We have rolled out this change over a month ago and default-enabled the new behaviour with 002ec992 (hooks: Default-enable synchronized hook executions, 2023-06-29). We couldn't yet remove the flag until now though because changes to the voting logic need to be handled over at least two releases due to zero-downtime upgrades.

Now that the flag was released as default-enabled though via v16.2.0, we can finally remove it. Let's do so.

Closes #5359 (closed).

Merge request reports

Loading