From: Jonathan Nieder <jrnieder@gmail.com>
To: Dmitry Ivankov <divanorama@gmail.com>
Cc: git@vger.kernel.org, "Shawn O. Pearce" <spearce@spearce.org>,
David Barr <davidbarr@google.com>
Subject: Re: [PATCH 1/3] fast-import: die if we produce too many (MAX_PACK_ID) packs
Date: Sun, 18 Sep 2011 14:17:41 -0500 [thread overview]
Message-ID: <20110918191741.GD2308@elie> (raw)
In-Reply-To: <1316372508-7173-2-git-send-email-divanorama@gmail.com>
Dmitry Ivankov wrote:
> 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.
next prev parent reply other threads:[~2011-09-18 19:18 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-09-18 19:01 [PATCH 0/3] fast-import: fix pack_id corner cases Dmitry Ivankov
2011-09-18 19:01 ` [PATCH 1/3] fast-import: die if we produce too many (MAX_PACK_ID) packs Dmitry Ivankov
2011-09-18 19:17 ` Jonathan Nieder [this message]
2011-09-18 19:01 ` [PATCH 2/3] fast-import: fix corner case for checkpoint Dmitry Ivankov
2011-09-18 19:28 ` Jonathan Nieder
2011-09-18 19:01 ` [PATCH 3/3] fast-import: rename object_count to pack_object_count Dmitry Ivankov
2011-09-18 19:32 ` Jonathan Nieder
2011-09-18 19:51 ` Dmitry Ivankov
2011-09-18 21:40 ` Jonathan Nieder
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20110918191741.GD2308@elie \
--to=jrnieder@gmail.com \
--cc=davidbarr@google.com \
--cc=divanorama@gmail.com \
--cc=git@vger.kernel.org \
--cc=spearce@spearce.org \
/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.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.