{"thread":{"id":"66322","subject":"[PATCH 0/2] object-file: fix packfile flush during transaction commit","startedAt":"2026-09-13T20:26:35Z","lastAt":"2026-09-24T06:13:42Z","messageCount":18,"participants":["Justin Tobler","Karthik Nayak","Patrick Steinhardt"],"isPatch":true,"patchVersion":1,"patchTotal":2},"messages":[{"id":"552650","messageId":"cover.1789328612.git.jltobler@gmail.com","threadId":"66322","inReplyTo":null,"subject":"[PATCH 0/2] object-file: fix packfile flush during transaction commit","fromName":"Justin Tobler","fromEmail":"jltobler@gmail.com","sentAt":"2026-09-13T20:26:20Z","receivedAt":"2026-09-13T20:26:35Z","isPatch":true,"body":"Greetings,\n\nThis short series fixes a bug I found related to committing an ODB\ntransaction that contains both a loose object and \"large\" blob when also\nconfigured to batch fsync loose objects. The issue can be reproduced\nwith the following:\n\n\tgit init\n\tgit config core.fsync loose-object\n\tgit config core.fsyncMethod batch\n\tgit config core.bigFileThreshold 5\n\techo foo >1-foo && echo foobar >2-foobar\n\tgit add 1-foo 2-foobar\n\nand produces the following error:\n\n\terror: unable to write file .git/objects/pack/pack-2b7c2470289822070687e8d64186093a710eaed3.pack: No such file or directory\n\tfatal: unable to rename temporary file to '.git/objects/pack/pack-2b7c2470289822070687e8d64186093a710eaed3.pack'\n\nIf a \"large\" blob packfile is written to the transaction temporary\ndirectory, it is unable to be flushed during transaction commit because\nthe underlying transaction is migrated to the main ODB before the\npackfile is finalized. To avoid this, this series ensures any pending\npackfile in the transaction is flushed first.\n\nThanks,\n-Justin\n\nJustin Tobler (2):\n  object-file: lift ODB reprepare out of packfile flush\n  object-file: flush transaction packfile before migrating objects\n\n object-file.c    | 12 ++++++++----\n t/t1050-large.sh | 16 ++++++++++++++++\n 2 files changed, 24 insertions(+), 4 deletions(-)\n\n\nbase-commit: 47ce80527c56f462cb97db4ca8125342204d3783\n-- \n2.55.0\n\n"},{"id":"552651","messageId":"cf14416f224f48475dfc9f79d8ec62756b9fdedf.1789328612.git.jltobler@gmail.com","threadId":"66322","inReplyTo":"cover.1789328612.git.jltobler@gmail.com","subject":"[PATCH 1/2] object-file: lift ODB reprepare out of packfile flush","fromName":"Justin Tobler","fromEmail":"jltobler@gmail.com","sentAt":"2026-09-13T20:26:21Z","receivedAt":"2026-09-13T20:26:36Z","isPatch":true,"body":"When flushing a packfile via `flush_packfile_transaction()`,\n`odb_reprepare()` is invoked so the written packfile becomes visible in\nthe current process. In a subsequent commit, repreparing the ODB is\nslightly deferred when committing a \"files\" ODB transaction.\n\nLift ODB reprepare out of `flush_packfile_transaction()` and instead\nrequire callers to explicitly invoke `odb_reprepare()` if required.\n\nSigned-off-by: Justin Tobler <jltobler@gmail.com>\n---\n object-file.c | 10 +++++++---\n 1 file changed, 7 insertions(+), 3 deletions(-)\n\ndiff --git a/object-file.c b/object-file.c\nindex a4cbf8b081df..0f123b79fad1 100644\n--- a/object-file.c\n+++ b/object-file.c\n@@ -857,8 +857,6 @@ static void flush_packfile_transaction(struct odb_transaction_files *transaction\n \tmemset(state, 0, sizeof(*state));\n \n \tstrbuf_release(&packname);\n-\t/* Make objects we just wrote available to ourselves */\n-\todb_reprepare(repo->objects);\n }\n \n /*\n@@ -909,8 +907,10 @@ static int odb_transaction_files_write_object_stream(struct odb_transaction *bas\n \t * to zlib compression and is sufficient for this check.\n \t */\n \tif (state->nr_written && pack_size_limit_cfg &&\n-\t    pack_size_limit_cfg < state->offset + stream->size)\n+\t    pack_size_limit_cfg < state->offset + stream->size) {\n \t\tflush_packfile_transaction(transaction);\n+\t\todb_reprepare(transaction->base.source->odb);\n+\t}\n \n \tCALLOC_ARRAY(idx, 1);\n \tprepare_packfile_transaction(transaction);\n@@ -1260,6 +1260,7 @@ static int odb_transaction_files_commit(struct odb_transaction *base)\n {\n \tstruct odb_transaction_files *transaction =\n \t\tcontainer_of(base, struct odb_transaction_files, base);\n+\tint have_packfile = !!transaction->packfile.f;\n \n \tif (transaction->objdir) {\n \t\tstruct strbuf temp_path = STRBUF_INIT;\n@@ -1293,6 +1294,9 @@ static int odb_transaction_files_commit(struct odb_transaction *base)\n \n \tflush_packfile_transaction(transaction);\n \n+\tif (have_packfile)\n+\t\todb_reprepare(transaction->base.source->odb);\n+\n \treturn 0;\n }\n \n-- \n2.55.0\n\n"},{"id":"552652","messageId":"18a1798d958d7f089614ec588346096c10b0666a.1789328612.git.jltobler@gmail.com","threadId":"66322","inReplyTo":"cover.1789328612.git.jltobler@gmail.com","subject":"[PATCH 2/2] object-file: flush transaction packfile before migrating objects","fromName":"Justin Tobler","fromEmail":"jltobler@gmail.com","sentAt":"2026-09-13T20:26:22Z","receivedAt":"2026-09-13T20:26:37Z","isPatch":true,"body":"A \"files\" ODB transaction creates a temporary directory to stage newly\nwritten objects in when configured to batch fsync loose objects. Once\nthe temporary directory is created, it is configured as the primary ODB\nand all object are written to it accordingly. This also includes\npackfiles containing blobs that exceed `core.bigFileThreshold` written\nvia `odb_transaction_files_write_object_stream()`.\n\nIf a \"large\" blob packfile is written to the ODB transaction temporary\ndirectory after other loose objects, the ODB transaction fails to commit\nas a result of the temporary directory being migrated prior to the\npackfile being flushed. Fix this bug by always flushing the packfile\ntransaction before objects are migrated to the main ODB.\n\nSigned-off-by: Justin Tobler <jltobler@gmail.com>\n---\n object-file.c    |  4 ++--\n t/t1050-large.sh | 16 ++++++++++++++++\n 2 files changed, 18 insertions(+), 2 deletions(-)\n\ndiff --git a/object-file.c b/object-file.c\nindex 0f123b79fad1..210984f82532 100644\n--- a/object-file.c\n+++ b/object-file.c\n@@ -1262,6 +1262,8 @@ static int odb_transaction_files_commit(struct odb_transaction *base)\n \t\tcontainer_of(base, struct odb_transaction_files, base);\n \tint have_packfile = !!transaction->packfile.f;\n \n+\tflush_packfile_transaction(transaction);\n+\n \tif (transaction->objdir) {\n \t\tstruct strbuf temp_path = STRBUF_INIT;\n \t\tstruct tempfile *temp;\n@@ -1292,8 +1294,6 @@ static int odb_transaction_files_commit(struct odb_transaction *base)\n \t\ttransaction->objdir = NULL;\n \t}\n \n-\tflush_packfile_transaction(transaction);\n-\n \tif (have_packfile)\n \t\todb_reprepare(transaction->base.source->odb);\n \ndiff --git a/t/t1050-large.sh b/t/t1050-large.sh\nindex d295c265c75c..fb83c8fba619 100755\n--- a/t/t1050-large.sh\n+++ b/t/t1050-large.sh\n@@ -87,6 +87,22 @@ test_expect_success 'add a large file or two' '\n \ttest $count = 1\n '\n \n+test_expect_success 'add large file with loose object in batch fsync' '\n+\ttest_when_finished \"rm -rf batch\" &&\n+\tgit init batch &&\n+\n+\tgit -C batch config core.bigFileThreshold 5 &&\n+\techo foo >batch/1-small &&\n+\techo foobar >batch/2-large &&\n+\n+\tgit -C batch -c core.fsync=loose-object -c core.fsyncMethod=batch \\\n+\t\tadd 1-small 2-large &&\n+\n+\t# Neither object may be left behind in a temporary location.\n+\tgit -C batch cat-file -e :1-small &&\n+\tgit -C batch cat-file -e :2-large\n+'\n+\n test_expect_success 'checkout a large file' '\n \tlarge1=$(git rev-parse :large1) &&\n \tgit update-index --add --cacheinfo 100644 $large1 another &&\n-- \n2.55.0\n\n"},{"id":"552735","messageId":"CAOLa=ZQBo5ZyHtx4yLvjJXzJYgGieeuX2g0mycPKOPt+VqJ93Q@mail.gmail.com","threadId":"66322","inReplyTo":"cf14416f224f48475dfc9f79d8ec62756b9fdedf.1789328612.git.jltobler@gmail.com","subject":"Re: [PATCH 1/2] object-file: lift ODB reprepare out of packfile flush","fromName":"Karthik Nayak","fromEmail":"karthik.188@gmail.com","sentAt":"2026-09-15T04:40:55Z","receivedAt":"2026-09-15T04:40:57Z","isPatch":true,"body":"Justin Tobler <jltobler@gmail.com> writes:\n\n> When flushing a packfile via `flush_packfile_transaction()`,\n> `odb_reprepare()` is invoked so the written packfile becomes visible in\n> the current process. In a subsequent commit, repreparing the ODB is\n> slightly deferred when committing a \"files\" ODB transaction.\n>\n> Lift ODB reprepare out of `flush_packfile_transaction()` and instead\n> require callers to explicitly invoke `odb_reprepare()` if required.\n>\n> Signed-off-by: Justin Tobler <jltobler@gmail.com>\n> ---\n>  object-file.c | 10 +++++++---\n>  1 file changed, 7 insertions(+), 3 deletions(-)\n>\n> diff --git a/object-file.c b/object-file.c\n> index a4cbf8b081df..0f123b79fad1 100644\n> --- a/object-file.c\n> +++ b/object-file.c\n> @@ -857,8 +857,6 @@ static void flush_packfile_transaction(struct odb_transaction_files *transaction\n>  \tmemset(state, 0, sizeof(*state));\n>\n>  \tstrbuf_release(&packname);\n> -\t/* Make objects we just wrote available to ourselves */\n> -\todb_reprepare(repo->objects);\n>  }\n>\n>  /*\n> @@ -909,8 +907,10 @@ static int odb_transaction_files_write_object_stream(struct odb_transaction *bas\n>  \t * to zlib compression and is sufficient for this check.\n>  \t */\n>  \tif (state->nr_written && pack_size_limit_cfg &&\n> -\t    pack_size_limit_cfg < state->offset + stream->size)\n> +\t    pack_size_limit_cfg < state->offset + stream->size) {\n>  \t\tflush_packfile_transaction(transaction);\n> +\t\todb_reprepare(transaction->base.source->odb);\n> +\t}\n>\n>  \tCALLOC_ARRAY(idx, 1);\n>  \tprepare_packfile_transaction(transaction);\n> @@ -1260,6 +1260,7 @@ static int odb_transaction_files_commit(struct odb_transaction *base)\n>  {\n>  \tstruct odb_transaction_files *transaction =\n>  \t\tcontainer_of(base, struct odb_transaction_files, base);\n> +\tint have_packfile = !!transaction->packfile.f;\n>\n>  \tif (transaction->objdir) {\n>  \t\tstruct strbuf temp_path = STRBUF_INIT;\n> @@ -1293,6 +1294,9 @@ static int odb_transaction_files_commit(struct odb_transaction *base)\n>\n>  \tflush_packfile_transaction(transaction);\n>\n\nEarlier this would unconditionally call `odb_reprepare()` within, now we\nonly call if needed. Which makes sense. Would it also make sense to only\ncall `flush_packfile_transaction(transaction)` if we have a packfile?\n\n> +\tif (have_packfile)\n> +\t\todb_reprepare(transaction->base.source->odb);\n> +\n>  \treturn 0;\n>  }\n>\n> --\n> 2.55.0\n"},{"id":"552736","messageId":"CAOLa=ZRCyowPgMABwsQBYTbW1cEf8PBBSszOEYQ4TKwLVKQfFA@mail.gmail.com","threadId":"66322","inReplyTo":"18a1798d958d7f089614ec588346096c10b0666a.1789328612.git.jltobler@gmail.com","subject":"Re: [PATCH 2/2] object-file: flush transaction packfile before migrating objects","fromName":"Karthik Nayak","fromEmail":"karthik.188@gmail.com","sentAt":"2026-09-15T04:46:18Z","receivedAt":"2026-09-15T04:46:22Z","isPatch":true,"body":"Justin Tobler <jltobler@gmail.com> writes:\n\n> A \"files\" ODB transaction creates a temporary directory to stage newly\n> written objects in when configured to batch fsync loose objects. Once\n> the temporary directory is created, it is configured as the primary ODB\n> and all object are written to it accordingly. This also includes\n> packfiles containing blobs that exceed `core.bigFileThreshold` written\n> via `odb_transaction_files_write_object_stream()`.\n>\n> If a \"large\" blob packfile is written to the ODB transaction temporary\n> directory after other loose objects, the ODB transaction fails to commit\n> as a result of the temporary directory being migrated prior to the\n> packfile being flushed. Fix this bug by always flushing the packfile\n> transaction before objects are migrated to the main ODB.\n\nOkay this makes sense.\n\n>\n> Signed-off-by: Justin Tobler <jltobler@gmail.com>\n> ---\n>  object-file.c    |  4 ++--\n>  t/t1050-large.sh | 16 ++++++++++++++++\n>  2 files changed, 18 insertions(+), 2 deletions(-)\n>\n> diff --git a/object-file.c b/object-file.c\n> index 0f123b79fad1..210984f82532 100644\n> --- a/object-file.c\n> +++ b/object-file.c\n> @@ -1262,6 +1262,8 @@ static int odb_transaction_files_commit(struct odb_transaction *base)\n>  \t\tcontainer_of(base, struct odb_transaction_files, base);\n>  \tint have_packfile = !!transaction->packfile.f;\n>\n> +\tflush_packfile_transaction(transaction);\n> +\n>  \tif (transaction->objdir) {\n>  \t\tstruct strbuf temp_path = STRBUF_INIT;\n>  \t\tstruct tempfile *temp;\n> @@ -1292,8 +1294,6 @@ static int odb_transaction_files_commit(struct odb_transaction *base)\n>  \t\ttransaction->objdir = NULL;\n>  \t}\n>\n> -\tflush_packfile_transaction(transaction);\n> -\n>  \tif (have_packfile)\n>  \t\todb_reprepare(transaction->base.source->odb);\n>\n> diff --git a/t/t1050-large.sh b/t/t1050-large.sh\n> index d295c265c75c..fb83c8fba619 100755\n> --- a/t/t1050-large.sh\n> +++ b/t/t1050-large.sh\n> @@ -87,6 +87,22 @@ test_expect_success 'add a large file or two' '\n>  \ttest $count = 1\n>  '\n>\n> +test_expect_success 'add large file with loose object in batch fsync' '\n> +\ttest_when_finished \"rm -rf batch\" &&\n> +\tgit init batch &&\n> +\n> +\tgit -C batch config core.bigFileThreshold 5 &&\n\nNit: we have `test_config` which automatically unsets after the test.\nPerhaps not really needed here, as we drop 'batch' anyways.\n\n> +\techo foo >batch/1-small &&\n> +\techo foobar >batch/2-large &&\n> +\n> +\tgit -C batch -c core.fsync=loose-object -c core.fsyncMethod=batch \\\n> +\t\tadd 1-small 2-large &&\n> +\n> +\t# Neither object may be left behind in a temporary location.\n> +\tgit -C batch cat-file -e :1-small &&\n> +\tgit -C batch cat-file -e :2-large\n> +'\n>\n\nLooks good.\n\n> +\n>  test_expect_success 'checkout a large file' '\n>  \tlarge1=$(git rev-parse :large1) &&\n>  \tgit update-index --add --cacheinfo 100644 $large1 another &&\n> --\n> 2.55.0\n"},{"id":"552748","messageId":"aqkGPcJdw3QagN0B@jtobler--20250820-SHC54","threadId":"66322","inReplyTo":"CAOLa=ZQBo5ZyHtx4yLvjJXzJYgGieeuX2g0mycPKOPt+VqJ93Q@mail.gmail.com","subject":"Re: [PATCH 1/2] object-file: lift ODB reprepare out of packfile flush","fromName":"Justin Tobler","fromEmail":"jltobler@gmail.com","sentAt":"2026-09-15T08:54:00Z","receivedAt":"2026-09-15T08:54:04Z","isPatch":true,"body":"On 26/09/15 12:40AM, Karthik Nayak wrote:\n>Justin Tobler <jltobler@gmail.com> writes:\n>> @@ -1260,6 +1260,7 @@ static int odb_transaction_files_commit(struct odb_transaction *base)\n>>  {\n>>  \tstruct odb_transaction_files *transaction =\n>>  \t\tcontainer_of(base, struct odb_transaction_files, base);\n>> +\tint have_packfile = !!transaction->packfile.f;\n>>\n>>  \tif (transaction->objdir) {\n>>  \t\tstruct strbuf temp_path = STRBUF_INIT;\n>> @@ -1293,6 +1294,9 @@ static int odb_transaction_files_commit(struct odb_transaction *base)\n>>\n>>  \tflush_packfile_transaction(transaction);\n>>\n>\n>Earlier this would unconditionally call `odb_reprepare()` within, now we\n>only call if needed. Which makes sense. Would it also make sense to only\n>call `flush_packfile_transaction(transaction)` if we have a packfile?\n\n`flush_packfile_transaction()` already returns early if there is nothing\nto do. We could make it more explicit here, but I think it is probably\nfine to leave it as-is.\n\n-Justin\n"},{"id":"552749","messageId":"aqkHyXWO4tRwYemS@jtobler--20250820-SHC54","threadId":"66322","inReplyTo":"CAOLa=ZRCyowPgMABwsQBYTbW1cEf8PBBSszOEYQ4TKwLVKQfFA@mail.gmail.com","subject":"Re: [PATCH 2/2] object-file: flush transaction packfile before migrating objects","fromName":"Justin Tobler","fromEmail":"jltobler@gmail.com","sentAt":"2026-09-15T08:59:09Z","receivedAt":"2026-09-15T08:59:14Z","isPatch":true,"body":"On 26/09/15 12:46AM, Karthik Nayak wrote:\n>Justin Tobler <jltobler@gmail.com> writes:\n>> +test_expect_success 'add large file with loose object in batch fsync' '\n>> +\ttest_when_finished \"rm -rf batch\" &&\n>> +\tgit init batch &&\n>> +\n>> +\tgit -C batch config core.bigFileThreshold 5 &&\n>\n>Nit: we have `test_config` which automatically unsets after the test.\n>Perhaps not really needed here, as we drop 'batch' anyways.\n\nYa, since we are deleting the repo here as part of this test, I don't\nthink there is much need to cleanup the config right before deleting.\nI'll leave it as-is.\n\n>> +\techo foo >batch/1-small &&\n>> +\techo foobar >batch/2-large &&\n>> +\n>> +\tgit -C batch -c core.fsync=loose-object -c core.fsyncMethod=batch \\\n>> +\t\tadd 1-small 2-large &&\n>> +\n>> +\t# Neither object may be left behind in a temporary location.\n>> +\tgit -C batch cat-file -e :1-small &&\n>> +\tgit -C batch cat-file -e :2-large\n>> +'\n>>\n>\n>Looks good.\n\nThanks for the review,\n-Justin\n"},{"id":"553056","messageId":"arPQrtYHen3UAvdk@pks.im","threadId":"66322","inReplyTo":"cf14416f224f48475dfc9f79d8ec62756b9fdedf.1789328612.git.jltobler@gmail.com","subject":"Re: [PATCH 1/2] object-file: lift ODB reprepare out of packfile flush","fromName":"Patrick Steinhardt","fromEmail":"ps@pks.im","sentAt":"2026-09-23T13:16:21Z","receivedAt":"2026-09-23T13:16:34Z","isPatch":true,"body":"On Sun, Sep 13, 2026 at 03:26:21PM -0500, Justin Tobler wrote:\n> diff --git a/object-file.c b/object-file.c\n> index a4cbf8b081df..0f123b79fad1 100644\n> --- a/object-file.c\n> +++ b/object-file.c\n> @@ -909,8 +907,10 @@ static int odb_transaction_files_write_object_stream(struct odb_transaction *bas\n>  \t * to zlib compression and is sufficient for this check.\n>  \t */\n>  \tif (state->nr_written && pack_size_limit_cfg &&\n> -\t    pack_size_limit_cfg < state->offset + stream->size)\n> +\t    pack_size_limit_cfg < state->offset + stream->size) {\n>  \t\tflush_packfile_transaction(transaction);\n> +\t\todb_reprepare(transaction->base.source->odb);\n> +\t}\n>  \n>  \tCALLOC_ARRAY(idx, 1);\n>  \tprepare_packfile_transaction(transaction);\n> @@ -1260,6 +1260,7 @@ static int odb_transaction_files_commit(struct odb_transaction *base)\n>  {\n>  \tstruct odb_transaction_files *transaction =\n>  \t\tcontainer_of(base, struct odb_transaction_files, base);\n> +\tint have_packfile = !!transaction->packfile.f;\n>  \n>  \tif (transaction->objdir) {\n>  \t\tstruct strbuf temp_path = STRBUF_INIT;\n> @@ -1293,6 +1294,9 @@ static int odb_transaction_files_commit(struct odb_transaction *base)\n>  \n>  \tflush_packfile_transaction(transaction);\n>  \n> +\tif (have_packfile)\n> +\t\todb_reprepare(transaction->base.source->odb);\n> +\n>  \treturn 0;\n>  }\n\nOne thing that I'm curious about: we don't have any error checking for\nflushing the object directory at alll. So there is actually a change in\nbehaviour here, where we now also reprepare in case flushing has failed.\nIt probably doesn't matter much, but it does raise the question whether\nwe may want to start checking for errors.\n\nPatrick\n"},{"id":"553057","messageId":"arPRM191URNQGu7V@pks.im","threadId":"66322","inReplyTo":"18a1798d958d7f089614ec588346096c10b0666a.1789328612.git.jltobler@gmail.com","subject":"Re: [PATCH 2/2] object-file: flush transaction packfile before migrating objects","fromName":"Patrick Steinhardt","fromEmail":"ps@pks.im","sentAt":"2026-09-23T13:16:35Z","receivedAt":"2026-09-23T13:16:42Z","isPatch":true,"body":"On Sun, Sep 13, 2026 at 03:26:22PM -0500, Justin Tobler wrote:\n> diff --git a/object-file.c b/object-file.c\n> index 0f123b79fad1..210984f82532 100644\n> --- a/object-file.c\n> +++ b/object-file.c\n> @@ -1262,6 +1262,8 @@ static int odb_transaction_files_commit(struct odb_transaction *base)\n>  \t\tcontainer_of(base, struct odb_transaction_files, base);\n>  \tint have_packfile = !!transaction->packfile.f;\n>  \n> +\tflush_packfile_transaction(transaction);\n> +\n>  \tif (transaction->objdir) {\n>  \t\tstruct strbuf temp_path = STRBUF_INIT;\n>  \t\tstruct tempfile *temp;\n> @@ -1292,8 +1294,6 @@ static int odb_transaction_files_commit(struct odb_transaction *base)\n>  \t\ttransaction->objdir = NULL;\n>  \t}\n>  \n> -\tflush_packfile_transaction(transaction);\n> -\n>  \tif (have_packfile)\n>  \t\todb_reprepare(transaction->base.source->odb);\n>  \n\nIn the preceding commit you wrote:\n\n    In a subsequent commit, repreparing the ODB is slightly deferred\n    when committing a \"files\" ODB transaction.\n\nBut that's not really true -- you don't delay repreparing the object\ndatabase, but instead only flush earlier. The reprepare still happens at\nthe same point in time.\n\n> diff --git a/t/t1050-large.sh b/t/t1050-large.sh\n> index d295c265c75c..fb83c8fba619 100755\n> --- a/t/t1050-large.sh\n> +++ b/t/t1050-large.sh\n> @@ -87,6 +87,22 @@ test_expect_success 'add a large file or two' '\n>  \ttest $count = 1\n>  '\n>  \n> +test_expect_success 'add large file with loose object in batch fsync' '\n> +\ttest_when_finished \"rm -rf batch\" &&\n> +\tgit init batch &&\n\nI feel like using a subshell might've helped here for readability. But,\noh well, it saves us an extra process.\n\n> +\tgit -C batch config core.bigFileThreshold 5 &&\n> +\techo foo >batch/1-small &&\n> +\techo foobar >batch/2-large &&\n> +\n> +\tgit -C batch -c core.fsync=loose-object -c core.fsyncMethod=batch \\\n> +\t\tadd 1-small 2-large &&\n> +\n> +\t# Neither object may be left behind in a temporary location.\n\nYou don't really verify whether they are left behind, but rather verify\nthat the can be read. Which is a bit of a different thing.\n\nSorry, feels like I'm in a nitpicky mood today :)\n\nThanks!\n\nPatrick\n"},{"id":"553115","messageId":"arQ8nsUzg9atdCeD@denethor","threadId":"66322","inReplyTo":"arPQrtYHen3UAvdk@pks.im","subject":"Re: [PATCH 1/2] object-file: lift ODB reprepare out of packfile flush","fromName":"Justin Tobler","fromEmail":"jltobler@gmail.com","sentAt":"2026-09-23T21:04:55Z","receivedAt":"2026-09-23T21:05:00Z","isPatch":true,"body":"On 26/09/23 03:16PM, Patrick Steinhardt wrote:\n> On Sun, Sep 13, 2026 at 03:26:21PM -0500, Justin Tobler wrote:\n> > diff --git a/object-file.c b/object-file.c\n> > index a4cbf8b081df..0f123b79fad1 100644\n> > --- a/object-file.c\n> > +++ b/object-file.c\n> > @@ -909,8 +907,10 @@ static int odb_transaction_files_write_object_stream(struct odb_transaction *bas\n> >  \t * to zlib compression and is sufficient for this check.\n> >  \t */\n> >  \tif (state->nr_written && pack_size_limit_cfg &&\n> > -\t    pack_size_limit_cfg < state->offset + stream->size)\n> > +\t    pack_size_limit_cfg < state->offset + stream->size) {\n> >  \t\tflush_packfile_transaction(transaction);\n> > +\t\todb_reprepare(transaction->base.source->odb);\n> > +\t}\n> >  \n> >  \tCALLOC_ARRAY(idx, 1);\n> >  \tprepare_packfile_transaction(transaction);\n> > @@ -1260,6 +1260,7 @@ static int odb_transaction_files_commit(struct odb_transaction *base)\n> >  {\n> >  \tstruct odb_transaction_files *transaction =\n> >  \t\tcontainer_of(base, struct odb_transaction_files, base);\n> > +\tint have_packfile = !!transaction->packfile.f;\n> >  \n> >  \tif (transaction->objdir) {\n> >  \t\tstruct strbuf temp_path = STRBUF_INIT;\n> > @@ -1293,6 +1294,9 @@ static int odb_transaction_files_commit(struct odb_transaction *base)\n> >  \n> >  \tflush_packfile_transaction(transaction);\n> >  \n> > +\tif (have_packfile)\n> > +\t\todb_reprepare(transaction->base.source->odb);\n> > +\n> >  \treturn 0;\n> >  }\n> \n> One thing that I'm curious about: we don't have any error checking for\n> flushing the object directory at alll. So there is actually a change in\n> behaviour here, where we now also reprepare in case flushing has failed.\n> It probably doesn't matter much, but it does raise the question whether\n> we may want to start checking for errors.\n\nRegarding the behavior change, I'm not entirely sure I follow.\n`flush_packfile_transaction()` only returns early in the case where\nthere is nothing to flush. In both of the above call sites,\n`odb_reprepare()` is only invoked in the same circumstance.\n\nI do agree with the sentiment that error handling could be improve here\nas most errors are simply handled by die()'ing in place. I'll probably\ndefer doing that as part of this series though.\n\nThanks,\n-Justin\n"},{"id":"553117","messageId":"arQ_Uz2R_sE4yzXu@denethor","threadId":"66322","inReplyTo":"arPRM191URNQGu7V@pks.im","subject":"Re: [PATCH 2/2] object-file: flush transaction packfile before migrating objects","fromName":"Justin Tobler","fromEmail":"jltobler@gmail.com","sentAt":"2026-09-23T21:17:26Z","receivedAt":"2026-09-23T21:17:32Z","isPatch":true,"body":"On 26/09/23 03:16PM, Patrick Steinhardt wrote:\n> On Sun, Sep 13, 2026 at 03:26:22PM -0500, Justin Tobler wrote:\n> > diff --git a/object-file.c b/object-file.c\n> > index 0f123b79fad1..210984f82532 100644\n> > --- a/object-file.c\n> > +++ b/object-file.c\n> > @@ -1262,6 +1262,8 @@ static int odb_transaction_files_commit(struct odb_transaction *base)\n> >  \t\tcontainer_of(base, struct odb_transaction_files, base);\n> >  \tint have_packfile = !!transaction->packfile.f;\n> >  \n> > +\tflush_packfile_transaction(transaction);\n> > +\n> >  \tif (transaction->objdir) {\n> >  \t\tstruct strbuf temp_path = STRBUF_INIT;\n> >  \t\tstruct tempfile *temp;\n> > @@ -1292,8 +1294,6 @@ static int odb_transaction_files_commit(struct odb_transaction *base)\n> >  \t\ttransaction->objdir = NULL;\n> >  \t}\n> >  \n> > -\tflush_packfile_transaction(transaction);\n> > -\n> >  \tif (have_packfile)\n> >  \t\todb_reprepare(transaction->base.source->odb);\n> >  \n> \n> In the preceding commit you wrote:\n> \n>     In a subsequent commit, repreparing the ODB is slightly deferred\n>     when committing a \"files\" ODB transaction.\n> \n> But that's not really true -- you don't delay repreparing the object\n> database, but instead only flush earlier. The reprepare still happens at\n> the same point in time.\n\nThat's fair. When I said \"deferred\" I really meant that\n`odb_reprepare()` was now happening after and outside of\n`flush_packfile_transaction()`, but logically it is really in the same\nplace.\n\nI will adapt the commit message accordingly.\n\n> > diff --git a/t/t1050-large.sh b/t/t1050-large.sh\n> > index d295c265c75c..fb83c8fba619 100755\n> > --- a/t/t1050-large.sh\n> > +++ b/t/t1050-large.sh\n> > @@ -87,6 +87,22 @@ test_expect_success 'add a large file or two' '\n> >  \ttest $count = 1\n> >  '\n> >  \n> > +test_expect_success 'add large file with loose object in batch fsync' '\n> > +\ttest_when_finished \"rm -rf batch\" &&\n> > +\tgit init batch &&\n> \n> I feel like using a subshell might've helped here for readability. But,\n> oh well, it saves us an extra process.\n\nYa, using a subshell is probably a bit easier on the eyes. Since I'm\nmaking some small changes anyways I'll go ahead and make this change\ntoo.\n\n> > +\tgit -C batch config core.bigFileThreshold 5 &&\n> > +\techo foo >batch/1-small &&\n> > +\techo foobar >batch/2-large &&\n> > +\n> > +\tgit -C batch -c core.fsync=loose-object -c core.fsyncMethod=batch \\\n> > +\t\tadd 1-small 2-large &&\n> > +\n> > +\t# Neither object may be left behind in a temporary location.\n> \n> You don't really verify whether they are left behind, but rather verify\n> that the can be read. Which is a bit of a different thing.\n\nThat fair, I'm not sure this comment is really that useful anyways so\nI'll just go ahead and remove it in the next version.\n\n> Sorry, feels like I'm in a nitpicky mood today :)\n\nIt is always welcome and appreciated! :)\n\nThanks,\n-Justin\n"},{"id":"553126","messageId":"20260923220315.569424-1-jltobler@gmail.com","threadId":"66322","inReplyTo":"cover.1789328612.git.jltobler@gmail.com","subject":"[PATCH v2 0/2] object-file: fix packfile flush during transaction commit","fromName":"Justin Tobler","fromEmail":"jltobler@gmail.com","sentAt":"2026-09-23T22:03:13Z","receivedAt":"2026-09-23T22:03:26Z","isPatch":true,"body":"Greetings,\n\nThis short series fixes a bug I found related to committing an ODB\ntransaction that contains both a loose object and \"large\" blob when also\nconfigured to batch fsync loose objects. The issue can be reproduced\nwith the following:\n\n        git init\n        git config core.fsync loose-object\n        git config core.fsyncMethod batch\n        git config core.bigFileThreshold 5\n        echo foo >1-foo && echo foobar >2-foobar\n        git add 1-foo 2-foobar\n\nand produces the following error:\n\n        error: unable to write file .git/objects/pack/pack-2b7c2470289822070687e8d64186093a710eaed3.pack: No such file or directory\n        fatal: unable to rename temporary file to '.git/objects/pack/pack-2b7c2470289822070687e8d64186093a710eaed3.pack'\n\nIf a \"large\" blob packfile is written to the transaction temporary\ndirectory, it is unable to be flushed during transaction commit because\nthe underlying transaction is migrated to the main ODB before the\npackfile is finalized. To avoid this, this series ensures any pending\npackfile in the transaction is flushed first.\n\nChanges since V1:\n- Updated a commit message of first patch.\n- Improved test readability in second patch.\n\nThanks,\n-Justin\n\nJustin Tobler (2):\n  object-file: lift ODB reprepare out of packfile flush\n  object-file: flush transaction packfile before migrating objects\n\n object-file.c    | 12 ++++++++----\n t/t1050-large.sh | 17 +++++++++++++++++\n 2 files changed, 25 insertions(+), 4 deletions(-)\n\nRange-diff against v1:\n1:  cf14416f22 ! 1:  6f74391ae8 object-file: lift ODB reprepare out of packfile flush\n    @@ Commit message\n     \n         When flushing a packfile via `flush_packfile_transaction()`,\n         `odb_reprepare()` is invoked so the written packfile becomes visible in\n    -    the current process. In a subsequent commit, repreparing the ODB is\n    -    slightly deferred when committing a \"files\" ODB transaction.\n    +    the current process. In a subsequent commit, flushing the packfile is\n    +    performed earlier when committing a \"files\" ODB transaction, but the ODB\n    +    reprepare needs to remain the last step.\n     \n         Lift ODB reprepare out of `flush_packfile_transaction()` and instead\n         require callers to explicitly invoke `odb_reprepare()` if required.\n2:  18a1798d95 ! 2:  ad2fa8ee3f object-file: flush transaction packfile before migrating objects\n    @@ t/t1050-large.sh: test_expect_success 'add a large file or two' '\n     +test_expect_success 'add large file with loose object in batch fsync' '\n     +\ttest_when_finished \"rm -rf batch\" &&\n     +\tgit init batch &&\n    ++\t(\n    ++\t\tcd batch &&\n    ++\t\tgit config core.bigFileThreshold 5 &&\n    ++\t\techo foo >1-small &&\n    ++\t\techo foobar >2-large &&\n     +\n    -+\tgit -C batch config core.bigFileThreshold 5 &&\n    -+\techo foo >batch/1-small &&\n    -+\techo foobar >batch/2-large &&\n    ++\t\tgit -c core.fsync=loose-object -c core.fsyncMethod=batch \\\n    ++\t\t\tadd 1-small 2-large &&\n     +\n    -+\tgit -C batch -c core.fsync=loose-object -c core.fsyncMethod=batch \\\n    -+\t\tadd 1-small 2-large &&\n    -+\n    -+\t# Neither object may be left behind in a temporary location.\n    -+\tgit -C batch cat-file -e :1-small &&\n    -+\tgit -C batch cat-file -e :2-large\n    ++\t\tgit cat-file -e :1-small &&\n    ++\t\tgit cat-file -e :2-large\n    ++\t)\n     +'\n     +\n      test_expect_success 'checkout a large file' '\n\nbase-commit: 47ce80527c56f462cb97db4ca8125342204d3783\n-- \n2.55.0.424.g13c7afec21\n\n"},{"id":"553127","messageId":"20260923220315.569424-2-jltobler@gmail.com","threadId":"66322","inReplyTo":"20260923220315.569424-1-jltobler@gmail.com","subject":"[PATCH v2 1/2] object-file: lift ODB reprepare out of packfile flush","fromName":"Justin Tobler","fromEmail":"jltobler@gmail.com","sentAt":"2026-09-23T22:03:14Z","receivedAt":"2026-09-23T22:03:28Z","isPatch":true,"body":"When flushing a packfile via `flush_packfile_transaction()`,\n`odb_reprepare()` is invoked so the written packfile becomes visible in\nthe current process. In a subsequent commit, flushing the packfile is\nperformed earlier when committing a \"files\" ODB transaction, but the ODB\nreprepare needs to remain the last step.\n\nLift ODB reprepare out of `flush_packfile_transaction()` and instead\nrequire callers to explicitly invoke `odb_reprepare()` if required.\n\nSigned-off-by: Justin Tobler <jltobler@gmail.com>\n---\n object-file.c | 10 +++++++---\n 1 file changed, 7 insertions(+), 3 deletions(-)\n\ndiff --git a/object-file.c b/object-file.c\nindex a4cbf8b081..0f123b79fa 100644\n--- a/object-file.c\n+++ b/object-file.c\n@@ -857,8 +857,6 @@ static void flush_packfile_transaction(struct odb_transaction_files *transaction\n \tmemset(state, 0, sizeof(*state));\n \n \tstrbuf_release(&packname);\n-\t/* Make objects we just wrote available to ourselves */\n-\todb_reprepare(repo->objects);\n }\n \n /*\n@@ -909,8 +907,10 @@ static int odb_transaction_files_write_object_stream(struct odb_transaction *bas\n \t * to zlib compression and is sufficient for this check.\n \t */\n \tif (state->nr_written && pack_size_limit_cfg &&\n-\t    pack_size_limit_cfg < state->offset + stream->size)\n+\t    pack_size_limit_cfg < state->offset + stream->size) {\n \t\tflush_packfile_transaction(transaction);\n+\t\todb_reprepare(transaction->base.source->odb);\n+\t}\n \n \tCALLOC_ARRAY(idx, 1);\n \tprepare_packfile_transaction(transaction);\n@@ -1260,6 +1260,7 @@ static int odb_transaction_files_commit(struct odb_transaction *base)\n {\n \tstruct odb_transaction_files *transaction =\n \t\tcontainer_of(base, struct odb_transaction_files, base);\n+\tint have_packfile = !!transaction->packfile.f;\n \n \tif (transaction->objdir) {\n \t\tstruct strbuf temp_path = STRBUF_INIT;\n@@ -1293,6 +1294,9 @@ static int odb_transaction_files_commit(struct odb_transaction *base)\n \n \tflush_packfile_transaction(transaction);\n \n+\tif (have_packfile)\n+\t\todb_reprepare(transaction->base.source->odb);\n+\n \treturn 0;\n }\n \n-- \n2.55.0.424.g13c7afec21\n\n"},{"id":"553128","messageId":"20260923220315.569424-3-jltobler@gmail.com","threadId":"66322","inReplyTo":"20260923220315.569424-1-jltobler@gmail.com","subject":"[PATCH v2 2/2] object-file: flush transaction packfile before migrating objects","fromName":"Justin Tobler","fromEmail":"jltobler@gmail.com","sentAt":"2026-09-23T22:03:15Z","receivedAt":"2026-09-23T22:03:29Z","isPatch":true,"body":"A \"files\" ODB transaction creates a temporary directory to stage newly\nwritten objects in when configured to batch fsync loose objects. Once\nthe temporary directory is created, it is configured as the primary ODB\nand all object are written to it accordingly. This also includes\npackfiles containing blobs that exceed `core.bigFileThreshold` written\nvia `odb_transaction_files_write_object_stream()`.\n\nIf a \"large\" blob packfile is written to the ODB transaction temporary\ndirectory after other loose objects, the ODB transaction fails to commit\nas a result of the temporary directory being migrated prior to the\npackfile being flushed. Fix this bug by always flushing the packfile\ntransaction before objects are migrated to the main ODB.\n\nSigned-off-by: Justin Tobler <jltobler@gmail.com>\n---\n object-file.c    |  4 ++--\n t/t1050-large.sh | 17 +++++++++++++++++\n 2 files changed, 19 insertions(+), 2 deletions(-)\n\ndiff --git a/object-file.c b/object-file.c\nindex 0f123b79fa..210984f825 100644\n--- a/object-file.c\n+++ b/object-file.c\n@@ -1262,6 +1262,8 @@ static int odb_transaction_files_commit(struct odb_transaction *base)\n \t\tcontainer_of(base, struct odb_transaction_files, base);\n \tint have_packfile = !!transaction->packfile.f;\n \n+\tflush_packfile_transaction(transaction);\n+\n \tif (transaction->objdir) {\n \t\tstruct strbuf temp_path = STRBUF_INIT;\n \t\tstruct tempfile *temp;\n@@ -1292,8 +1294,6 @@ static int odb_transaction_files_commit(struct odb_transaction *base)\n \t\ttransaction->objdir = NULL;\n \t}\n \n-\tflush_packfile_transaction(transaction);\n-\n \tif (have_packfile)\n \t\todb_reprepare(transaction->base.source->odb);\n \ndiff --git a/t/t1050-large.sh b/t/t1050-large.sh\nindex d295c265c7..95233458b4 100755\n--- a/t/t1050-large.sh\n+++ b/t/t1050-large.sh\n@@ -87,6 +87,23 @@ test_expect_success 'add a large file or two' '\n \ttest $count = 1\n '\n \n+test_expect_success 'add large file with loose object in batch fsync' '\n+\ttest_when_finished \"rm -rf batch\" &&\n+\tgit init batch &&\n+\t(\n+\t\tcd batch &&\n+\t\tgit config core.bigFileThreshold 5 &&\n+\t\techo foo >1-small &&\n+\t\techo foobar >2-large &&\n+\n+\t\tgit -c core.fsync=loose-object -c core.fsyncMethod=batch \\\n+\t\t\tadd 1-small 2-large &&\n+\n+\t\tgit cat-file -e :1-small &&\n+\t\tgit cat-file -e :2-large\n+\t)\n+'\n+\n test_expect_success 'checkout a large file' '\n \tlarge1=$(git rev-parse :large1) &&\n \tgit update-index --add --cacheinfo 100644 $large1 another &&\n-- \n2.55.0.424.g13c7afec21\n\n"},{"id":"553138","messageId":"arS77zUvWKdjEeS-@pks.im","threadId":"66322","inReplyTo":"arQ8nsUzg9atdCeD@denethor","subject":"Re: [PATCH 1/2] object-file: lift ODB reprepare out of packfile flush","fromName":"Patrick Steinhardt","fromEmail":"ps@pks.im","sentAt":"2026-09-24T05:58:07Z","receivedAt":"2026-09-24T05:58:14Z","isPatch":true,"body":"On Wed, Sep 23, 2026 at 04:04:55PM -0500, Justin Tobler wrote:\n> On 26/09/23 03:16PM, Patrick Steinhardt wrote:\n> > On Sun, Sep 13, 2026 at 03:26:21PM -0500, Justin Tobler wrote:\n> > > diff --git a/object-file.c b/object-file.c\n> > > index a4cbf8b081df..0f123b79fad1 100644\n> > > --- a/object-file.c\n> > > +++ b/object-file.c\n> > > @@ -909,8 +907,10 @@ static int odb_transaction_files_write_object_stream(struct odb_transaction *bas\n> > >  \t * to zlib compression and is sufficient for this check.\n> > >  \t */\n> > >  \tif (state->nr_written && pack_size_limit_cfg &&\n> > > -\t    pack_size_limit_cfg < state->offset + stream->size)\n> > > +\t    pack_size_limit_cfg < state->offset + stream->size) {\n> > >  \t\tflush_packfile_transaction(transaction);\n> > > +\t\todb_reprepare(transaction->base.source->odb);\n> > > +\t}\n> > >  \n> > >  \tCALLOC_ARRAY(idx, 1);\n> > >  \tprepare_packfile_transaction(transaction);\n> > > @@ -1260,6 +1260,7 @@ static int odb_transaction_files_commit(struct odb_transaction *base)\n> > >  {\n> > >  \tstruct odb_transaction_files *transaction =\n> > >  \t\tcontainer_of(base, struct odb_transaction_files, base);\n> > > +\tint have_packfile = !!transaction->packfile.f;\n> > >  \n> > >  \tif (transaction->objdir) {\n> > >  \t\tstruct strbuf temp_path = STRBUF_INIT;\n> > > @@ -1293,6 +1294,9 @@ static int odb_transaction_files_commit(struct odb_transaction *base)\n> > >  \n> > >  \tflush_packfile_transaction(transaction);\n> > >  \n> > > +\tif (have_packfile)\n> > > +\t\todb_reprepare(transaction->base.source->odb);\n> > > +\n> > >  \treturn 0;\n> > >  }\n> > \n> > One thing that I'm curious about: we don't have any error checking for\n> > flushing the object directory at alll. So there is actually a change in\n> > behaviour here, where we now also reprepare in case flushing has failed.\n> > It probably doesn't matter much, but it does raise the question whether\n> > we may want to start checking for errors.\n> \n> Regarding the behavior change, I'm not entirely sure I follow.\n> `flush_packfile_transaction()` only returns early in the case where\n> there is nothing to flush. In both of the above call sites,\n> `odb_reprepare()` is only invoked in the same circumstance.\n\nThere's a second early return when `tmp_objdir_migrate()` fails, and\nthat early return causes us to not flush.\n\nPatrick\n"},{"id":"553139","messageId":"arS8f6SShWyc2wrh@pks.im","threadId":"66322","inReplyTo":"arS77zUvWKdjEeS-@pks.im","subject":"Re: [PATCH 1/2] object-file: lift ODB reprepare out of packfile flush","fromName":"Patrick Steinhardt","fromEmail":"ps@pks.im","sentAt":"2026-09-24T06:00:31Z","receivedAt":"2026-09-24T06:00:36Z","isPatch":true,"body":"On Thu, Sep 24, 2026 at 07:58:07AM +0200, Patrick Steinhardt wrote:\n> On Wed, Sep 23, 2026 at 04:04:55PM -0500, Justin Tobler wrote:\n> > On 26/09/23 03:16PM, Patrick Steinhardt wrote:\n> > > On Sun, Sep 13, 2026 at 03:26:21PM -0500, Justin Tobler wrote:\n> > > > diff --git a/object-file.c b/object-file.c\n> > > > index a4cbf8b081df..0f123b79fad1 100644\n> > > > --- a/object-file.c\n> > > > +++ b/object-file.c\n> > > > @@ -909,8 +907,10 @@ static int odb_transaction_files_write_object_stream(struct odb_transaction *bas\n> > > >  \t * to zlib compression and is sufficient for this check.\n> > > >  \t */\n> > > >  \tif (state->nr_written && pack_size_limit_cfg &&\n> > > > -\t    pack_size_limit_cfg < state->offset + stream->size)\n> > > > +\t    pack_size_limit_cfg < state->offset + stream->size) {\n> > > >  \t\tflush_packfile_transaction(transaction);\n> > > > +\t\todb_reprepare(transaction->base.source->odb);\n> > > > +\t}\n> > > >  \n> > > >  \tCALLOC_ARRAY(idx, 1);\n> > > >  \tprepare_packfile_transaction(transaction);\n> > > > @@ -1260,6 +1260,7 @@ static int odb_transaction_files_commit(struct odb_transaction *base)\n> > > >  {\n> > > >  \tstruct odb_transaction_files *transaction =\n> > > >  \t\tcontainer_of(base, struct odb_transaction_files, base);\n> > > > +\tint have_packfile = !!transaction->packfile.f;\n> > > >  \n> > > >  \tif (transaction->objdir) {\n> > > >  \t\tstruct strbuf temp_path = STRBUF_INIT;\n> > > > @@ -1293,6 +1294,9 @@ static int odb_transaction_files_commit(struct odb_transaction *base)\n> > > >  \n> > > >  \tflush_packfile_transaction(transaction);\n> > > >  \n> > > > +\tif (have_packfile)\n> > > > +\t\todb_reprepare(transaction->base.source->odb);\n> > > > +\n> > > >  \treturn 0;\n> > > >  }\n> > > \n> > > One thing that I'm curious about: we don't have any error checking for\n> > > flushing the object directory at alll. So there is actually a change in\n> > > behaviour here, where we now also reprepare in case flushing has failed.\n> > > It probably doesn't matter much, but it does raise the question whether\n> > > we may want to start checking for errors.\n> > \n> > Regarding the behavior change, I'm not entirely sure I follow.\n> > `flush_packfile_transaction()` only returns early in the case where\n> > there is nothing to flush. In both of the above call sites,\n> > `odb_reprepare()` is only invoked in the same circumstance.\n> \n> There's a second early return when `tmp_objdir_migrate()` fails, and\n> that early return causes us to not flush.\n\nOh, never mind. I think I've been confusing the fact that what you're\nchanging is actually `odb_transaction_files_commit()` itself, and that\nearly return of course still exists in there. So this looks good to me.\n\nPatrick\n"},{"id":"553140","messageId":"arS8oikUroITi2d2@pks.im","threadId":"66322","inReplyTo":"20260923220315.569424-1-jltobler@gmail.com","subject":"Re: [PATCH v2 0/2] object-file: fix packfile flush during transaction commit","fromName":"Patrick Steinhardt","fromEmail":"ps@pks.im","sentAt":"2026-09-24T06:01:06Z","receivedAt":"2026-09-24T06:01:11Z","isPatch":true,"body":"On Wed, Sep 23, 2026 at 05:03:13PM -0500, Justin Tobler wrote:\n> Changes since V1:\n> - Updated a commit message of first patch.\n> - Improved test readability in second patch.\n\nThanks, this version looks good to me.\n\nPatrick\n"},{"id":"553142","messageId":"arS_kcMcgrjfT9KE@pks.im","threadId":"66322","inReplyTo":"20260923220315.569424-2-jltobler@gmail.com","subject":"Re: [PATCH v2 1/2] object-file: lift ODB reprepare out of packfile flush","fromName":"Patrick Steinhardt","fromEmail":"ps@pks.im","sentAt":"2026-09-24T06:13:37Z","receivedAt":"2026-09-24T06:13:42Z","isPatch":true,"body":"On Wed, Sep 23, 2026 at 05:03:14PM -0500, Justin Tobler wrote:\n> When flushing a packfile via `flush_packfile_transaction()`,\n> `odb_reprepare()` is invoked so the written packfile becomes visible in\n> the current process. In a subsequent commit, flushing the packfile is\n> performed earlier when committing a \"files\" ODB transaction, but the ODB\n> reprepare needs to remain the last step.\n\nYup, this is more in line with what that second commit will do.\n\nPatrick\n"}]}