git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Nasser Grainawi <nasser@codeaurora.org>
To: Jeff King <peff@peff.net>
Cc: git@vger.kernel.org
Subject: Re: git receive-pack deletes refs one at a time?
Date: Thu, 13 Jun 2019 13:46:05 -0600	[thread overview]
Message-ID: <34FD9B2B-D53A-4CD2-AEF0-3AFAF1586EB7@codeaurora.org> (raw)
In-Reply-To: <20190613174331.GA19795@sigill.intra.peff.net>


> On Jun 13, 2019, at 11:43 AM, Jeff King <peff@peff.net> wrote:
> 
> On Thu, Jun 13, 2019 at 11:33:40AM -0600, Nasser Grainawi wrote:
> 
>> I have a situation where I need to delete 100k+ refs on 15+ separate
>> hosts/disks. This setup is using Gerrit replication, so I can trigger
>> it all on one host and it will push the deletes to the rest (all
>> running git-daemon v2.18.0 with receive-pack enabled). All the refs
>> being deleted on the receiving ends are packed.
>> 
>> What I see is the packed-refs file getting locked/updated over and
>> over for each ref. I had assumed it would do something more like
>> 'update-ref --stdin' and do a bulk removal of refs. Am I seeing the
>> correct behavior? If yes, is there a specific reason it works this way
>> or is "bulk delete through push" just a feature that hasn't been
>> implemented yet?
> 
> The underlying ref code is smart enough to coalesce all of the deletions
> in a single transaction into a single write of the packed-refs file.
> 
> But historically, pushes do not do a single ref transaction because we
> would allow the push for one ref to succeed while others failed. Later,
> we added an "atomic" mode that does it all in a single transaction.
> 
> Try with "git push --atomic", which should be able to do it in a single
> write.

Thanks!

Is there a way to get the bulk behavior without the all-or-nothing behavior?

-- 
Qualcomm Innovation Center, Inc.
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum, 
a Linux Foundation Collaborative Project


  reply	other threads:[~2019-06-13 19:46 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-06-13 17:33 git receive-pack deletes refs one at a time? Nasser Grainawi
2019-06-13 17:43 ` Jeff King
2019-06-13 19:46   ` Nasser Grainawi [this message]
2019-06-13 21:20     ` Jeff King

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=34FD9B2B-D53A-4CD2-AEF0-3AFAF1586EB7@codeaurora.org \
    --to=nasser@codeaurora.org \
    --cc=git@vger.kernel.org \
    --cc=peff@peff.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).