Skip to content

partition: Remove `MarkDefaultBranchUpdated`

When references are updated, the reference-transaction hook obtains the reference updates and votes on the reference updates. This ensures that when using Praefect, we can ensure all nodes are in sync. When using the WAL, the reference-transaction hook captures the updates and adds it to the transaction using tx.UpdateReferences(updates).

This works well for all references apart from symrefs. The only symref we care about in Gitaly is the HEAD ref. Because Git never supported transactions for symrefs. We used to manually update the HEAD ref in Gitaly via repo.setDefaultBranchManually, which would manually add a lock file and vote on the updated value of the HEAD ref.

With the introduction of 'symref-update' support in Git v2.46.0, we no longer need to do this manually and can handle symrefs through transactions + reference-transaction hook just like regular refs.

This means we can also get rid of MarkDefaultBranchUpdated in the transaction manager, since we can collect symref update information from the reference-transaction hook.

Doing so also requires us adding the required support for files backend to handle symref updates.

Closes #6344

Merge request reports

Loading