git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH 1/3] fast-import: die if we produce too many (MAX_PACK_ID) packs

From
Jonathan Nieder <jrnieder@gmail.com>
Date
Sep 18, 2011, 19:17 UTC
Message-ID
<20110918191741.GD2308@elie>
In-Reply-To
<1316372508-7173-2-git-send-email-divanorama@gmail.com>
Dmitry Ivankov wrote:
Show 6 quoted lines
> In fast-import pack_id is 16-bit with MAX_PACK_ID reserved to identify
> pre-existing objects. It is unlikely to wrap under reasonable settings
> but still things in fast-import will break once it happens.
>
> Add a check and immediate die() as the simplest reaction to being unable
> to continue the import.
Makes a lot of sense.  A few possible minor clarity improvements:
 - missing commas after "In fast-import" and before "with MAX_PACK_ID
   reserved"
 - "pre-existing objects": it would be clearer to say something like
   "objects this fast-import process instance did not write out to a
   packfile", like the comment before gfi_unpack_entry() does
 - I suppose "under reasonable settings" means "with a reasonable
   max-pack-size setting"?
 - "things will break" is a bit vague.
 - "immediate" -> "immediately"
Maybe:
	In fast-import, pack_id is a 16-bit unsigned integer, with MAX_PACK_ID
	(2^16 - 1) reserved for use by objects that are not in a packfile that
	this fast-import process instance wrote.  It is unusual for pack_id to
	hit MAX_PACK_ID with a reasonable --max-pack-size setting, but when it
	does, the pack_id stored in each "struct object_entry" wraps and
	fast-import gets utterly confused.
	Add a check and immediately die() so the operator can at least see what
	went wrong instead of experiencing an unexplained broken import.
With or without that clarification,
Reviewed-by: Jonathan Nieder <jrnieder@gmail.com>
Thanks!  A test would still be nice, if someone has time to write one.
Previous: Dmitry IvankovNext: Dmitry Ivankov
Message 3 of 9 in “fast-import: fix pack_id corner cases”
  1. 0/3 fast-import: fix pack_id corner casesDmitry Ivankov, Sep 18, 2011
  2. 1/3 fast-import: die if we produce too many (MAX_PACK_ID) packsDmitry Ivankov, Sep 18, 2011
  3. Jonathan NiederSep 18, 2011
  4. 2/3 fast-import: fix corner case for checkpointDmitry Ivankov, Sep 18, 2011
  5. Jonathan NiederSep 18, 2011
  6. 3/3 fast-import: rename object_count to pack_object_countDmitry Ivankov, Sep 18, 2011
  7. Jonathan NiederSep 18, 2011
  8. Dmitry IvankovSep 18, 2011
  9. Jonathan NiederSep 18, 2011

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.