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

Re: [RFC/PATCH] read-cache: write all indexes with the same permissions

From
SZEDER Gábor <szeder.dev@gmail.com>
Date
Nov 16, 2018, 19:07 UTC
Message-ID
<20181116190716.GO30222@szeder.dev>
In-Reply-To
<CAP8UFD1Nd657Afgk6s+uNXMW=26Fg-6Jnv6ngB1biUX2mGBkSw@mail.gmail.com>
On Fri, Nov 16, 2018 at 06:41:43PM +0100, Christian Couder wrote:
> On Tue, Nov 13, 2018 at 6:34 PM Ævar Arnfjörð Bjarmason
> <avarab@gmail.com> wrote:
> > I'm asking whether the bug in this patch isn't revealing an existing
> > issue with us not having any tests for N number of sharedindex.*
> > files. I.e. we have >1 of them, merge them and prune them, don't we?
We don't merge shared index files, but write a new one.
Show 8 quoted lines
> I think we shouldn't have many of them. Usually we should have just
> one, though it's possible that switching the shared index files
> feature on and off several times or using temporary index files could
> create more than one.
>
> And there is clean_shared_index_files() which calls
> should_delete_shared_index() to make sure they are regularly cleaned
> up.

I would think that it's more common to have more than one shared index files, because a new shared index is written when the number of entries in the split index reaches the threshold given in 'splitIndex.maxPercentChange'. The old ones are kept until they expire, and 'splitIndex.sharedIndexExpire' defaults to 2 weeks (and can even be be set to "never").

With the default 20% threshold a new shared index is written rather frequently with our usual small test-repos:

  $ git init
  $ git update-index --split-index
  $ ls -1 .git/*index*
  .git/index
  .git/sharedindex.4370042739b31cd17a5c5cd6043a77c9a00df113
  $ echo 1 >file
  $ git add file
  $ git commit -q -m 1
  $ echo 2 >file
  $ git commit -q -m 2 file
  $ echo 3 >file
  $ git commit -q -m 3 file
  $ ls -1 .git/*index*
  .git/index
  .git/sharedindex.4370042739b31cd17a5c5cd6043a77c9a00df113
  .git/sharedindex.6aedbf71b1a6bdc0018078ec7571e1b21ba4b954
  .git/sharedindex.b9106e9b82a818a0e4e9148224fc44ea98f488a1
  .git/sharedindex.bad0b75d270a431b9e961cfc15df6ec935a67be8
> Anyway it's a different topic and according to what we privately
> discussed I just sent
> https://public-inbox.org/git/20181116173105.21784-1-chriscool@tuxfamily.org/
> to fix the current issue.
Previous: Christian CouderNext: Duy Nguyen
Message 19 of 22 in “read-cache: use shared perms when writing shared index”
  1. 1/3 read-cache: use shared perms when writing shared indexChristian Couder, Jun 22, 2017
  2. 2/3 t1301: move movebits() to test-lib-functions.shChristian Couder, Jun 22, 2017
  3. Junio C HamanoJun 22, 2017
  4. Ramsay JonesJun 22, 2017
  5. Junio C HamanoJun 23, 2017
  6. Christian CouderJun 23, 2017
  7. 3/3 t1700: make sure split-index respects core.sharedrepositoryChristian Couder, Jun 22, 2017
  8. Junio C HamanoJun 22, 2017
  9. Christian CouderJun 22, 2017
  10. Junio C HamanoJun 22, 2017
  11. Christian CouderJun 22, 2017
  12. Junio C HamanoJun 22, 2017
  13. Christian CouderJun 23, 2017
  14. Ævar Arnfjörð BjarmasonNov 13, 2018
  15. read-cache: write all indexes with the same permissionsÆvar Arnfjörð Bjarmason, Nov 13, 2018
  16. Duy NguyenNov 13, 2018
  17. Ævar Arnfjörð BjarmasonNov 13, 2018
  18. Christian CouderNov 16, 2018
  19. SZEDER GáborNov 16, 2018
  20. Duy NguyenNov 16, 2018
  21. Christian CouderNov 17, 2018
  22. SZEDER GáborNov 17, 2018

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.