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

Re: reftable [v4]: new ref storage format

From
Stefan Beller <sbeller@google.com>
Date
Aug 2, 2017, 19:54 UTC
Message-ID
<CAGZ79kb5UjxQFpQWy-muCwkuQsmuxQcKfs4f5HGenGSb+SiOhw@mail.gmail.com>
In-Reply-To
<CAJo=hJv7scc1L0_MdRkFeLAJGjYm2UkTFNOgj2e4+9Zj7KSiiQ@mail.gmail.com>
Show 11 quoted lines
> ### Ref block format
>
> A ref block is written as:
>
>     'r'
>     uint24( block_len )
>     ref_record+
>     uint32( restart_offset )+
>     uint16( restart_count )
>     padding?
>

So I learned that your current writer is a two block pass, i.e. the block is first written into memory and then once the block looks complete it is written out to disk.

This would allow us to shuffle the data around during the actual out-to-disk-phase, such as this:

  'r'
  uint24( restart_count )
  uint32( restart_offset )+
  ref_record+
  ref_record_endmarker
  padding?

(A) In nearby emails we discussed to have the restart offsets to be 24 bit, but now they are 32-bit aligned to the start of a block so we could keep them 32 bit for simplicity of reading.

(B) Note how there is no block_len encoding, which was originally only needed to lookup the position of restart_count. (so even for that we could rename it to padding_len, such that the position of restart_count can be decoded easily)

We no longer need the block_len as the restart_count comes right after the 'r'.

Instead we'll have a ref_record_endmarker that reads as a ref with both prefix and suffix to '0', type deletion (such that there is no further cost). The end marker would only need two '0's, which makes it indistinguishable from padding.

Previous: Junio C Hamano
Message 34 of 34 in “Re: reftable [v4]: new ref storage format”
  1. Shawn PearceJul 31, 2017
  2. Dave BorowitzJul 31, 2017
  3. Stefan BellerJul 31, 2017
  4. Shawn PearceJul 31, 2017
  5. Junio C HamanoJul 31, 2017
  6. Shawn PearceJul 31, 2017
  7. Shawn PearceAug 1, 2017
  8. Michael HaggertyAug 1, 2017
  9. Shawn PearceAug 1, 2017
  10. Michael HaggertyAug 2, 2017
  11. Shawn PearceAug 1, 2017
  12. Shawn PearceAug 1, 2017
  13. Michael HaggertyAug 2, 2017
  14. Shawn PearceAug 2, 2017
  15. Jeff KingAug 2, 2017
  16. Shawn PearceAug 2, 2017
  17. Junio C HamanoAug 2, 2017
  18. Jeff KingAug 2, 2017
  19. Dave BorowitzAug 2, 2017
  20. Jeff KingAug 2, 2017
  21. Michael HaggertyAug 3, 2017
  22. Shawn PearceAug 3, 2017
  23. Michael HaggertyAug 3, 2017
  24. Shawn PearceAug 4, 2017
  25. Shawn PearceAug 5, 2017
  26. Dave BorowitzAug 1, 2017
  27. Shawn PearceAug 1, 2017
  28. Junio C HamanoAug 2, 2017
  29. Jeff KingAug 2, 2017
  30. Shawn PearceAug 3, 2017
  31. Junio C HamanoAug 3, 2017
  32. Shawn PearceAug 3, 2017
  33. Junio C HamanoAug 3, 2017
  34. Stefan BellerAug 2, 2017

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.