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

Re: Submodule object store

From
DLDavid Lang <david.lang@digitalinsight.com>
Date
Mar 27, 2007, 16:53 UTC
Message-ID
<Pine.LNX.4.63.0703270735550.15345@qynat.qvtvafvgr.pbz>
In-Reply-To
<20070327152507.GO22773@admingilde.org>
On Tue, 27 Mar 2007, Martin Waitz wrote:
Show 8 quoted lines
> On Mon, Mar 26, 2007 at 03:40:15PM -0800, David Lang wrote:
>> useing the same object store makes this work automaticaly (think of all the
>> copies of COPYING that would end up being the same as a trivial example)
>
> Yes, but I guess not much more than COPYING, INSTALL, some trivial
> Makefiles and empty files will be shared between subprojects.
> Except when you have the same subproject in your tree multiple times,
> of course.

although, if you end up packing multiple projects togeather you may end up finding more things that diff well against each other (although it will slow down the packing with more objects.

> Yet this sharing is exactly why I started to do it that way, until Linus
> stopped me.
I missed that one.
Show 14 quoted lines
>>> If someone comes up with a nice way to handle everything in one big
>>> object store I would happily use that! :-)
>>
>> what exactly are the problems with one big object store?
>
> I think we really have to discuss this separation on several layers:
> traversal, pack-files, and object database.
>
> For the traversal the point of separating it into a per-module traversal
> is that only one module has to be loaded into RAM at a time.
> This effects all operations which do a (potentially) recursive traversal:
> push, pull, fsck, prune, repack.
> However a separated traversal will no longer be garanteed to only list
> an object once, so this has to be handled in some way.
an object can already appear more then once in pack files.
Show 8 quoted lines
> Pack files should have better access patterns if they are per-module.
> Most of the time you are only interested in one individual module and
> locality is important here.
>
> Separating the entire object database is a way to improve unreachability
> analysis, as it now can be done per module.
> The other two separations are easier to implement with a separated
> object database, but that's not too strong an argument.

if modules are really as seperate as you make them out to be then what you want isn't multiple modules inside one overall project (top level .git) you want multiple projects and a way to link them togeather.

Show 15 quoted lines
>
> So if we can come up with a nice way to do unreachability analysis we
> can indeed go on with the shared object database and tackle the
> remaining scalability issues as they arise.  Those could then be added
> later without changing the on-disk format.
>
>> ones that I can think of:
>>
>> 1. when you are doing a fsck you need to walk all the trees and find out
>> the list of objects that you know about.
>>
>>   done as a tree of binary values you can hold a LOT in memory before
>>   running into swap.
>
> Could you explain the algorithm you are thinking about in more detail?

as I understand it the need is to efficiantly create a list of all the objects that are reachable (so that we can then go through the objects and remove them if they aren't on the list).

you need these sorted to make it easy to find if something is in the list, and with millions of entries you don't it to be a flat list (inserting new values becomes very inefficiant) so the classic answer is to do a tree structure. you can either do a tree with the object ID's in all the nodes, or you can do one where only the leaf nodes hold the object ID's and the other nodes just hold pointers (which would then allow you to spill the leaf nodes to disk more efficiantly as they wouldn't need to be accessed when inserting unless the node itself needed to be changed. looking them up is being done more or less in alpha order for loose objects (and could be made to be so for objects in packs) so any file I/O for lookups would be close to sequential

this sort of memory useage wouldn't be acceptable for something that happens frequently, but a fsck/prune is relativly infrequent and can be run off-hours.

Show 6 quoted lines
>>   if it's enough larger then available ram then an option for fsck to use
>>   trees on disk is an option.
>
> This could simplify some things.
> There could be an on-disk index of all known objects, so that the sha1
> sums do not have to loaded into RAM all at once.
you wouldn't want to trust this for a fsck/prune
David Lang
Previous: Martin WaitzNext: Junio C Hamano
Message 26 of 61 in “.gitlink for Summer of Code”
  1. Eric LeshMar 25, 2007
  2. Matthieu MoyMar 25, 2007
  3. Shawn O. PearceMar 25, 2007
  4. Johannes SchindelinMar 25, 2007
  5. Shawn O. PearceMar 25, 2007
  6. Junio C HamanoMar 25, 2007
  7. Shawn O. PearceMar 25, 2007
  8. Petr BaudisMar 27, 2007
  9. Eric LeshMar 26, 2007
  10. Matthieu MoyMar 26, 2007
  11. Eric LeshMar 26, 2007
  12. Martin WaitzMar 26, 2007
  13. Josef WeidendorferMar 26, 2007
  14. Matthieu MoyMar 26, 2007
  15. Josef WeidendorferMar 26, 2007
  16. Matthieu MoyMar 27, 2007
  17. Martin WaitzMar 26, 2007
  18. Junio C HamanoMar 26, 2007
  19. Submodule object storeMartin Waitz, Mar 26, 2007
  20. Junio C HamanoMar 26, 2007
  21. Martin WaitzMar 26, 2007
  22. David LangMar 26, 2007
  23. Martin WaitzMar 26, 2007
  24. David LangMar 26, 2007
  25. Martin WaitzMar 27, 2007
  26. David LangMar 27, 2007
  27. Junio C HamanoMar 27, 2007
  28. Martin WaitzMar 27, 2007
  29. Uwe Kleine-KönigMar 27, 2007
  30. Uwe Kleine-KönigMar 27, 2007
  31. Martin WaitzMar 27, 2007
  32. Josef WeidendorferMar 27, 2007
  33. Martin WaitzMar 27, 2007
  34. Uwe Kleine-KönigMar 27, 2007
  35. Linus TorvaldsMar 27, 2007
  36. Uwe Kleine-KönigMar 27, 2007
  37. Linus TorvaldsMar 27, 2007
  38. Linus TorvaldsMar 27, 2007
  39. Martin WaitzMar 27, 2007
  40. Josef WeidendorferMar 26, 2007
  41. Junio C HamanoMar 26, 2007
  42. Linus TorvaldsMar 27, 2007
  43. David LangMar 27, 2007
  44. Linus TorvaldsMar 27, 2007
  45. Martin WaitzMar 27, 2007
  46. Daniel BarkalowMar 27, 2007
  47. Linus TorvaldsMar 27, 2007
  48. Daniel BarkalowMar 27, 2007
  49. Linus TorvaldsMar 27, 2007
  50. David LangMar 27, 2007
  51. Jakub NarebskiMar 27, 2007
  52. David LangMar 27, 2007
  53. Steven GrimmMar 27, 2007
  54. Daniel BarkalowMar 27, 2007
  55. Linus TorvaldsMar 27, 2007
  56. Josef WeidendorferMar 26, 2007
  57. Martin WaitzMar 26, 2007
  58. Jakub NarebskiMar 26, 2007
  59. Matthieu MoyMar 26, 2007
  60. Jakub NarebskiMar 27, 2007
  61. Shawn O. PearceMar 25, 2007

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.