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

Re: [RFC/PATCH 8/8] read-cache: unlink old sharedindex files

From
Christian Couder <christian.couder@gmail.com>
Date
Jul 12, 2016, 07:04 UTC
Message-ID
<CAP8UFD01MiMnz6qNGYa9WEjZ_EOy-hBqO4gGKGyxUc71aOyp4w@mail.gmail.com>
In-Reply-To
<CACsJy8BqMFASHf5kJgUh+bd7XG98CafNydE964VJyPXz-emEvA@mail.gmail.com>
On Mon, Jul 11, 2016 at 8:27 PM, Duy Nguyen <pclouds@gmail.com> wrote:
Show 12 quoted lines
> On Mon, Jul 11, 2016 at 7:22 PM, Christian Couder
> <christian.couder@gmail.com> wrote:
>> Everytime split index is turned on, it creates a "sharedindex.XXXX"
>> file in the git directory. This makes sure that old sharedindex
>> files are removed after a new one has been created.
>
> Hmm it's one-way link, we don't know how many index files use this
> shared index file, how can you be sure nobody else will need it? I'm
> thinking about temporary indexes. If a temp index is created, saved on
> disk, and use delete the shared index file, the real, main index may
> become useless. Temp index will most likely replace the main index
> (git commit) but if a failure happens, we can't fall back.

Isn't there a way to scan all the current indexes (temp or not) to see which shared indexes they need?

> A safer approach is "touch" the shared index every time a linked index
> is used, then we can delete shared indexes with old mtime, older than
> a grace period, in git-prune (or here).

Maybe old linked indexes could be converted after some time to use a newer shared index, so that we can get rid of the old shared indexes. That seems safer than just deleting old linked indexes.

Thanks for your review, Christian.

Previous: Duy NguyenNext: Duy Nguyen
Message 10 of 19 in “Add configuration options for split-index”
  1. 0/8 Add configuration options for split-indexChristian Couder, Jul 11, 2016
  2. 2/8 split-index: add {add,remove}_split_index() functionsChristian Couder, Jul 11, 2016
  3. 3/8 read-cache: add and then use tweak_split_index()Christian Couder, Jul 11, 2016
  4. 5/8 Documentation/config: add information for core.splitIndexChristian Couder, Jul 11, 2016
  5. 6/8 Documentation/git-update-index: talk about core.splitIndex config varChristian Couder, Jul 11, 2016
  6. 7/8 t1700: add tests for core.splitIndexChristian Couder, Jul 11, 2016
  7. 4/8 update-index: warn in case of split-index incoherencyChristian Couder, Jul 11, 2016
  8. 8/8 read-cache: unlink old sharedindex filesChristian Couder, Jul 11, 2016
  9. Duy NguyenJul 11, 2016
  10. Christian CouderJul 12, 2016
  11. Duy NguyenJul 12, 2016
  12. Christian CouderJul 12, 2016
  13. Duy NguyenJul 13, 2016
  14. Christian CouderJul 13, 2016
  15. 1/8 config: add git_config_get_split_index()Christian Couder, Jul 11, 2016
  16. Duy NguyenJul 12, 2016
  17. Christian CouderJul 23, 2016
  18. Duy NguyenJul 25, 2016
  19. Christian CouderJul 25, 2016

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.