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

Re: [PATCH v2 3/5] refs/reftable: add fsck check for number of tables

From
Karthik Nayak <karthik.188@gmail.com>
Date
Sep 15, 2025, 09:27 UTC
Message-ID
<CAOLa=ZR9nXkdXuMik2uq8+kpxQwmB72r7XZB0rnJSvKU7mKmkw@mail.gmail.com>
In-Reply-To
<aLf3NyodTZ38N8vY@pks.im>
Patrick Steinhardt <ps@pks.im> writes:
Show 14 quoted lines
> On Tue, Sep 02, 2025 at 09:05:23AM +0200, Karthik Nayak wrote:
>> Introduce a reftable fsck check to check that the number of files in the
>> reftable directory matches the number of files listed in 'tables.list'.
>> We do this by iterating over the files in the reftable directory and
>> counting all the files present excluding the 'tables.list'. This is also
>> exposed over Git's fsck checks as a 'badReftableStackCount' error.
>
> This feels overly strict, as it can always be the case that a concurrent
> process is currently updating the stack. Furthermore, it's expected that
> on Windows systems deletion of an old table may not work because the
> file is still kept open by another process. The reftable library is
> prepared to handle this alright and will re-try deleting the table at a
> later point in time.
>
Yeah that makes sense.
> So maybe a better check would be to verify that there are no files with
> unexpected names in the directory?
>
I was hoping to add structured consistency check in a layered format
- Stack
  - For each `Table`
    - For each `Block`
      - For each `Ref`

But this wouldn't belong to that, since it isn't part of the stack. So, I'll keep the above structure and also add this to the stack level. So we'll have

- Stack
  - For each `Table`
    - For each `Block`
      - For each `Ref`
  - Other Stack level checks
    - Check other files in the repo
> Patrick
Previous: Patrick SteinhardtNext: Karthik Nayak
Message 12 of 18 in “refs/reftable: add fsck checks”
  1. 0/5 refs/reftable: add fsck checksKarthik Nayak, Sep 2, 2025
  2. 1/5 fsck: order 'fsck_msg_type' alphabeticallyKarthik Nayak, Sep 2, 2025
  3. Junio C HamanoSep 2, 2025
  4. Karthik NayakSep 8, 2025
  5. 2/5 refs/reftable: add fsck check for checking the table nameKarthik Nayak, Sep 2, 2025
  6. Patrick SteinhardtSep 3, 2025
  7. shejialuoSep 3, 2025
  8. Karthik NayakSep 9, 2025
  9. Karthik NayakSep 9, 2025
  10. 3/5 refs/reftable: add fsck check for number of tablesKarthik Nayak, Sep 2, 2025
  11. Patrick SteinhardtSep 3, 2025
  12. Karthik NayakSep 15, 2025
  13. 4/5 refs/reftable: add fsck check for trailing newlineKarthik Nayak, Sep 2, 2025
  14. Junio C HamanoSep 2, 2025
  15. Patrick SteinhardtSep 3, 2025
  16. 5/5 refs/reftable: add fsck check for incorrect update indexKarthik Nayak, Sep 2, 2025
  17. Junio C HamanoSep 2, 2025
  18. Karthik NayakSep 18, 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.