Re: [PATCH v2 03/11] object-file: embed transaction flush logic in commit function
- From
Justin Tobler <jltobler@gmail.com>
- Date
- Jul 8, 2026, 16:08 UTC
- Message-ID
- <ak5rFZOYdEQ3zRni@denethor>
- In-Reply-To
- <ak3xFCzvgj1-Ev_3@pks.im>
On 26/07/08 08:41AM, Patrick Steinhardt wrote:
Show 14 quoted lines
> On Tue, Jul 07, 2026 at 11:14:04PM -0500, Justin Tobler wrote: > > When a "files" transaction is committed, > > `flush_loose_object_transaction()` is invoked to handle performing a > > hardware flush along with migrating the temporary object directory into > > the primary. In a subsequent commit, the temporary directory is also > > used to write packfiles. > > > > Instead of maintaining a separate helper function, embed the logic to > > flush and migrate the temporary directory directly into > > `odb_transaction_files_commit()`. > > The change itself looks simple enough, but this makes me wonder why we > want to change this. Like, what subsequent step does this enable that > would otherwise be harder to do?
Originally, I was planning to rename both `{fsync,flush}_loose_object_transaction()` to `odb_transaction_files_{fsync,flush}()` respectively. For the flush helper though, it's doing more than just "flushing" the temporary directory files; it's also migrating the objects to the primary ODB and reconfiguring the repository ODB sources accordingly.
This is really what you think of happening during the commit phase. Consequently, it made more sense to me organizationally to just embed the logic `odb_transaction_files_commit()`.
> Maybe this will be answered by a subsequent commit.
Will update the commit message to properly explain this.
-Justin