Patrick Steinhardt reports that since 5946a564cd (odb/source: make read_object_info() function pluggable, 2026-03-05), Git no longer reloads alternates when an object cannot be found. Earlier versions did. He says the scenario is uncommon, but his team hit it on production systems.
The case he describes is long-lived git-cat-file processes that are queried interactively. If the object database's alternates are rewritten while the process runs and its objects move to an alternate, lookups can no longer find any of them.
Patrick says only the second patch is needed to restore the behavior. The fix made lookups of 20,000 missing objects slower, from 180ms to 309ms. The last two patches address that. One uses a struct stat_validity so the alternates file is skipped when stat(3p) shows it unchanged. The other reorders the usability checks so the cheap hashmap lookup for an already-known alternate runs before the filesystem checks. Another patch drops the now-misleading odb_ prefix from the alternates functions in the files backend.
Junio C Hamano's review so far concerns the stat_validity change. He notes that the validity is updated before the file is read, so a transient I/O error in strbuf_read() or a concurrent rewrite leaves the validity updated even though parsing failed. He asked whether it is safer to update validity only after a successful read, and whether the extra safety is worth it.
Patrick has not yet replied in the excerpts, so that question is open.