git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/3] refs: fix some bugs with batched-updates
@ 2025-06-02  9:57 Karthik Nayak
  2025-06-02  9:57 ` [PATCH 1/3] refs/files: skip updates with errors in batched updates Karthik Nayak
                   ` (6 more replies)
  0 siblings, 7 replies; 40+ messages in thread
From: Karthik Nayak @ 2025-06-02  9:57 UTC (permalink / raw)
  To: git; +Cc: jltobler, Christian Couder, Karthik Nayak

In 23fc8e4f61 (refs: implement batch reference update support,
2025-04-08) we introduced a mechanism to batch reference updates. The
idea being that we wanted to batch updates similar to a transaction, but
allow certain updates to fail. This would help reference backends
optimize such operations and also remove the overhead of processing
updates individually. Especially for the reftable backend, where
batching updates would ensure that the autocompaction would only occur
at the end of the batch instead of after every reference update.

As of 9d2962a7c4 (receive-pack: use batched reference updates,
2025-05-19) we also updated the 'git-fetch(1)' and 'git-receive-pack(1)'
command to use batched reference updates. This series fixes some bugs
that we found at GitLab by running our Gitaly service with the `next`
build of Git.

The first being in the files backend, which missed skipping over failed
updates in certain flows. When certain individual updates fail, we mark
them as such. However, we missed skipping over such failed updates,
which can cause a SEGFAULT.

The other is in the git-receive-pack(1) implementation when a user
pushes multiple branches such as:

  delete refs/heads/branch/conflict
  create refs/heads/branch

Before using batched updates, the references would be applied
sequentially and hence no conflicts would arise. With batched updates,
while the first update applies, the second fails due to F/D conflict. A
similar issue was present in 'git-fetch(1)' and was fixed by using
separating out reference pruning into a separate transaction. Apply a
similar mechanism for 'git-receive-pack(1)' and separate out reference
deletions into its own batch.

This is based off master 7014b55638 (A bit more topics for -rc1,
2025-05-30), with the changes from kn/fetch-push-bulk-ref-update merged
in.

---
 builtin/receive-pack.c           | 23 +++++++++++++++++++----
 refs/files-backend.c             |  7 +++++++
 t/t1400-update-ref.sh            | 14 ++++++++++++++
 t/t1416-ref-transaction-hooks.sh |  2 ++
 t/t5516-fetch-push.sh            | 23 ++++++++++++++++-------
 5 files changed, 58 insertions(+), 11 deletions(-)

Karthik Nayak (3):
      refs/files: skip updates with errors in batched updates
      t5516: use double quotes for tests with variables
      receive-pack: handle reference deletions separately



base-commit: 931c39f05e078e0df968a439379cb04b5c4666ef
change-id: 20250528-6769-address-test-failures-in-the-next-branch-caused-by-batched-reference-updates-24ff53680144

Thanks
- Karthik


^ permalink raw reply	[flat|nested] 40+ messages in thread

end of thread, other threads:[~2025-06-22 14:20 UTC | newest]

Thread overview: 40+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-06-02  9:57 [PATCH 0/3] refs: fix some bugs with batched-updates Karthik Nayak
2025-06-02  9:57 ` [PATCH 1/3] refs/files: skip updates with errors in batched updates Karthik Nayak
2025-06-02 12:00   ` Patrick Steinhardt
2025-06-02 12:46     ` Karthik Nayak
2025-06-02 15:06       ` Junio C Hamano
2025-06-02 17:13         ` Karthik Nayak
2025-06-02  9:57 ` [PATCH 2/3] t5516: use double quotes for tests with variables Karthik Nayak
2025-06-02 16:59   ` Eric Sunshine
2025-06-02 17:13     ` Karthik Nayak
2025-06-02  9:57 ` [PATCH 3/3] receive-pack: handle reference deletions separately Karthik Nayak
2025-06-02 11:59   ` Patrick Steinhardt
2025-06-02 12:54     ` Karthik Nayak
2025-06-02 15:20     ` Junio C Hamano
2025-06-02 15:56       ` Patrick Steinhardt
2025-06-04 11:08         ` Karthik Nayak
2025-06-05  8:19 ` [PATCH v2 0/2] refs: fix some bugs with batched-updates Karthik Nayak
2025-06-05  8:19   ` [PATCH v2 1/2] refs/files: skip updates with errors in batched updates Karthik Nayak
2025-06-05  8:19   ` [PATCH v2 2/2] receive-pack: handle reference deletions separately Karthik Nayak
2025-06-05  8:47     ` Patrick Steinhardt
2025-06-05  9:08       ` Karthik Nayak
2025-06-06  8:41 ` [PATCH v3 0/2] refs: fix some bugs with batched-updates Karthik Nayak
2025-06-06  8:41   ` [PATCH v3 1/2] refs/files: skip updates with errors in batched updates Karthik Nayak
2025-06-06  8:41   ` [PATCH v3 2/2] receive-pack: handle reference deletions separately Karthik Nayak
2025-06-12 17:03     ` Christian Couder
2025-06-12 20:40       ` Junio C Hamano
2025-06-13  7:23       ` Karthik Nayak
2025-06-13  8:10 ` [PATCH v4 0/2] refs: fix some bugs with batched-updates Karthik Nayak
2025-06-13  8:10   ` [PATCH v4 1/2] refs/files: skip updates with errors in batched updates Karthik Nayak
2025-06-13  8:10   ` [PATCH v4 2/2] receive-pack: handle reference deletions separately Karthik Nayak
2025-06-13 15:46     ` Junio C Hamano
2025-06-19  9:39       ` Karthik Nayak
2025-06-13 12:43   ` [PATCH v4 0/2] refs: fix some bugs with batched-updates Christian Couder
2025-06-13 18:57     ` Junio C Hamano
2025-06-20  7:15 ` [PATCH v5 " Karthik Nayak
2025-06-20  7:15   ` [PATCH v5 1/2] refs/files: skip updates with errors in batched updates Karthik Nayak
2025-06-20  7:15   ` [PATCH v5 2/2] receive-pack: handle reference deletions separately Karthik Nayak
2025-06-20 16:21   ` [PATCH v5 0/2] refs: fix some bugs with batched-updates Junio C Hamano
2025-06-21 11:08     ` Karthik Nayak
2025-06-22  4:23       ` Junio C Hamano
2025-06-22 14:20         ` Karthik Nayak

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).