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

Re: [PATCH v2 2/6] builtin/update-index: end ODB transaction when --verbose is specified

From
Justin Tobler <jltobler@gmail.com>
Date
Sep 16, 2025, 15:17 UTC
Message-ID
<xvrq3xrmxnotzwyurnrxmxxq6aoclns3ywykoguenlw4a7euyl@7xys5dgoxpbv>
In-Reply-To
<CAOLa=ZS_H2CKvYy09Xd1GPqS9Bd5v_dZYiOLjZRbKN4fbYRbVA@mail.gmail.com>
On 25/09/16 02:07AM, Karthik Nayak wrote:
Show 23 quoted lines
> Justin Tobler <jltobler@gmail.com> writes:
> > +			/*
> > +			 * It is possible, though unlikely, that a caller could
> > +			 * use the verbose output to synchronize with addition
> > +			 * of objects to the object database. The current
> > +			 * implementation of ODB transactions leaves objects
> > +			 * invisible while a transaction is active, so end the
> > +			 * transaction here early before processing the next
> > +			 * update. All further updates are performed outside of
> > +			 * a transaction.
> > +			 */
> > +			if (transaction && verbose) {
> > +				end_odb_transaction(transaction);
> > +				transaction = NULL;
> > +			}
> > +
> 
> So with this change, we now have all objects updated before the
> `--verbose` flag updated via a single transaction. Updates after the
> `--verbose` flag will no longer use a transaction.
> 
> The older version would flush the transaction on every report, is there
> is any benefits to the new flow with regards to performance?

The older version would only flush transaction during a report if the --verbose option is enabled. Object written without --verbose would not be immediately flushed on report.

In this version we have functionally the same thing, but instead of flushing the transaction every report, the transaction is ended and subsequent object writes are written outside of a transaction instead.

I'll try to clarify this in the commit message.
-Justin
Previous: Karthik NayakNext: Justin Tobler
Message 27 of 38 in “odb: add transaction interfaces to ODB subsystem”
  1. 0/6 odb: add transaction interfaces to ODB subsystemJustin Tobler, Sep 9, 2025
  2. 1/6 bulk-checkin: remove ODB transaction nestingJustin Tobler, Sep 9, 2025
  3. Patrick SteinhardtSep 11, 2025
  4. Justin ToblerSep 11, 2025
  5. Taylor BlauSep 15, 2025
  6. Justin ToblerSep 16, 2025
  7. Junio C HamanoSep 16, 2025
  8. Justin ToblerSep 16, 2025
  9. 2/6 builtin/update-index: end ODB transaction when --verbose is specifiedJustin Tobler, Sep 9, 2025
  10. Patrick SteinhardtSep 11, 2025
  11. Justin ToblerSep 11, 2025
  12. Patrick SteinhardtSep 15, 2025
  13. Justin ToblerSep 15, 2025
  14. Justin ToblerSep 15, 2025
  15. 3/6 bulk-checkin: drop flush_odb_transaction()Justin Tobler, Sep 9, 2025
  16. 4/6 object-file: relocate ODB transaction codeJustin Tobler, Sep 9, 2025
  17. 5/6 object-file: update naming from bulk-checkinJustin Tobler, Sep 9, 2025
  18. 6/6 odb: add transaction interfaceJustin Tobler, Sep 9, 2025
  19. Patrick SteinhardtSep 11, 2025
  20. Justin ToblerSep 11, 2025
  21. 0/6 odb: add transaction interfaces to ODB subsystemJustin Tobler, Sep 15, 2025
  22. 1/6 bulk-checkin: remove ODB transaction nestingJustin Tobler, Sep 15, 2025
  23. Karthik NayakSep 16, 2025
  24. Justin ToblerSep 16, 2025
  25. 2/6 builtin/update-index: end ODB transaction when --verbose is specifiedJustin Tobler, Sep 15, 2025
  26. Karthik NayakSep 16, 2025
  27. Justin ToblerSep 16, 2025
  28. 3/6 bulk-checkin: drop flush_odb_transaction()Justin Tobler, Sep 15, 2025
  29. 4/6 object-file: relocate ODB transaction codeJustin Tobler, Sep 15, 2025
  30. 5/6 object-file: update naming from bulk-checkinJustin Tobler, Sep 15, 2025
  31. 6/6 odb: add transaction interfaceJustin Tobler, Sep 15, 2025
  32. 0/6 odb: add transaction interfaces to ODB subsystemJustin Tobler, Sep 16, 2025
  33. 2/6 builtin/update-index: end ODB transaction when --verbose is specifiedJustin Tobler, Sep 16, 2025
  34. 1/6 bulk-checkin: remove ODB transaction nestingJustin Tobler, Sep 16, 2025
  35. 3/6 bulk-checkin: drop flush_odb_transaction()Justin Tobler, Sep 16, 2025
  36. 4/6 object-file: relocate ODB transaction codeJustin Tobler, Sep 16, 2025
  37. 5/6 object-file: update naming from bulk-checkinJustin Tobler, Sep 16, 2025
  38. 6/6 odb: add transaction interfaceJustin Tobler, Sep 16, 2025

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.