git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
* Order of operations at the end of fast-import?
@ 2020-04-16  4:24 Mike Hommey
  2020-04-16  5:09 ` Jeff King
  2020-04-16 11:34 ` Mike Hommey
  0 siblings, 2 replies; 5+ messages in thread
From: Mike Hommey @ 2020-04-16  4:24 UTC (permalink / raw)
  To: git

Hi,

I just noticed that the order of operations at the end of fast-import
are:
- end_packfile
- dump_branches
- dump_tags

The first may create loose objects if the pack is small (per
fastimport.unpackLimit, defaulting to 100). The latter two create refs.

There seems to be a theoretical race condition here, if something else
triggers a gc at the "wrong" time, the loose objects might be cleaned up
and the branches/tags refs become dangling.

I understand that the packfile does need to be finished before creating
the refs, and that the unpacking replaces that when there aren't enough
objects, but wouldn't it be more data-safe to actually finish the pack,
create the refs, and then unpack?

Mike

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

end of thread, other threads:[~2020-04-16 18:58 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-16  4:24 Order of operations at the end of fast-import? Mike Hommey
2020-04-16  5:09 ` Jeff King
2020-04-16 18:34   ` Johannes Sixt
2020-04-16 18:58     ` Jeff King
2020-04-16 11:34 ` Mike Hommey

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).