From: Karthik Nayak Date: Mon, 15 Sep 2025 09:27:43 GMT Subject: Re: [PATCH v2 3/5] refs/reftable: add fsck check for number of tables Message-ID: In-Reply-To: Patrick Steinhardt writes: > 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