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

Re: [PATCH 05/15] run-job: implement pack-files job

From
Son Luong Ngoc <sluongng@gmail.com>
Date
May 2, 2020, 07:56 UTC
Message-ID
<CAL3xRKfcKh=XxGso4DTRfJMAVMtwqyQkO0VUhqVuZUr_aQ5f+A@mail.gmail.com>
Hi Derrick,

Sorry for another late reply on this RFC. This time is a question on the multi-pack-index repack process.

"Derrick Stolee via GitGitGadget" <gitgitgadget@gmail.com> writes:
> diff --git a/builtin/run-job.c b/builtin/run-job.c
> index cecf9058c51..d3543f7ccb9 100644
> --- a/builtin/run-job.c
> +++ b/builtin/run-job.c
...
Show 12 quoted lines
> +static int multi_pack_index_repack(void)
> +{
> + int result;
> + struct argv_array cmd = ARGV_ARRAY_INIT;
> + argv_array_pushl(&cmd, "multi-pack-index", "repack",
> + "--no-progress", "--batch-size=0", NULL);
> + result = run_command_v_opt(cmd.argv, RUN_GIT_CMD);
> +
> + if (result && multi_pack_index_verify()) {
> + warning(_("multi-pack-index verify failed after repack"));
> + result = rewrite_multi_pack_index();
> + }

Its a bit inconsistent where write() and expire() did not include verify() within them but repack does. What make repack() different?

Show 20 quoted lines
> +
> + return result;
> +}
> +
> +static int run_pack_files_job(void)
> +{
> + if (multi_pack_index_write()) {
> + error(_("failed to write multi-pack-index"));
> + return 1;
> + }
> +
> + if (multi_pack_index_verify()) {
> + warning(_("multi-pack-index verify failed after initial write"));
> + return rewrite_multi_pack_index();
> + }
> +
> + if (multi_pack_index_expire()) {
> + error(_("multi-pack-index expire failed"));
> + return 1;
> + }
Why expire *before* repack and not after?

I thought `core.multiPackIndex=true` would prevent old pack files from being used thus expiring immediately after repack is safe? (on that note, are users required to set this config prior to running the job?)

If expiring immediately after repack()+verify() is not safe, then should we have a minimum allowed interval set? (although I would preferred to make expire() safe)

Show 10 quoted lines
> +
> + if (multi_pack_index_verify()) {
> + warning(_("multi-pack-index verify failed after expire"));
> + return rewrite_multi_pack_index();
> + }
> +
> + if (multi_pack_index_repack()) {
> + error(_("multi-pack-index repack failed"));
> + return 1;
> + }

Again, I just think the decision to include verify() inside repack() made this part a bit inconsistent.

> +
> + return 0;
> +}
> +

Cheers, Son Luong

Next: Derrick Stolee
Message 1 of 2 in “Re: [PATCH 05/15] run-job: implement pack-files job”
  1. Son Luong NgocMay 2, 2020
  2. Derrick StoleeMay 4, 2020

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.