Repository navigation
Conversation
|
There is an issue in commit 13fb6bb:
|
The shared index of a split index is named after its trailing hash, which the split index records in its "link" extension to find it. Since ee1f0c2 (read-cache: add index.skipHash config option, 2023-01-06), do_write_index() skips that hash for the shared index too, so with index.skipHash and core.splitIndex both set, the shared index is written as "sharedindex.<null OID>" and the split index records a null OID as its base. Reading the index back, a null base means there is no shared index: the entries that were moved there are lost, "git ls-files" no longer shows them and "git status" reports them as deleted and untracked. With fsmonitor, it hits a BUG() in fsmonitor.c instead, as the fsmonitor bitmap refers to more entries than the index has. Scalar sets index.skipHash since 05f28e4 (scalar: use index.skipHash=true for performance, 2025-12-12), and feature.manyFiles implies it. The tests that ran into this under GIT_TEST_SPLIT_INDEX unset that variable instead, in 05f28e4, in 7cce609 (t9210, t9211: disable GIT_TEST_SPLIT_INDEX for scalar clone tests, 2026-04-15) and in a644ad5 (status: lock the index only to write it, 2026-10-22). Let the callers of do_write_index() decide whether to skip the hash, and always compute it for the shared index. This keeps most of the benefit: the shared index is rewritten only now and then (see splitIndex.maxPercentChange), while the split index, written on every index update, still skips it. Add a test, and drop the workarounds, as those tests now pass with GIT_TEST_SPLIT_INDEX. Signed-off-by: Xing Xin <xingxin.xx@bytedance.com>
blanet
force-pushed
the
xx/split-index-skip-hash
branch
from
November 26, 2026 10:04
13fb6bb to
0502560
Compare
Author
|
/submit |
|
Submitted as pull.2337.git.1795701443098.gitgitgadget@gmail.com To fetch this version into To fetch this version to local tag |
|
Junio C Hamano wrote on the Git mailing list (how to reply to this email): "blanet via GitGitGadget" <gitgitgadget@gmail.com> writes:
> From: Xing Xin <xingxin.xx@bytedance.com>
>
> The shared index of a split index is named after its trailing hash,
> which the split index records in its "link" extension to find it.
> Since ee1f0c242e (read-cache: add index.skipHash config option,
> 2023-01-06), do_write_index() skips that hash for the shared index
> too, so with index.skipHash and core.splitIndex both set, the shared
> index is written as "sharedindex.<null OID>" and the split index
> records a null OID as its base. Reading the index back, a null base
> means there is no shared index: the entries that were moved there are
> lost, "git ls-files" no longer shows them and "git status" reports
> them as deleted and untracked. With fsmonitor, it hits a BUG() in
> fsmonitor.c instead, as the fsmonitor bitmap refers to more entries
> than the index has.
It is correct to point out that the two "features", skipHash and
splitIndex, are incompatible. With skipHash, splitIndex will not
correctly work. We can say skipHash breaks splitIndex.
But does this change to _force_ the base index files to be hashed,
against the user's wish expressed by skipHash, take us in a better
direction, I have to wonder? With this change, skipHash's promise to
improve performance is not kept. We can say splitIndex breaks skipHash.
Stepping back a bit, isn't the expectation of splitIndex that these
incremental modifications held in non-base index files are relatively
small, thanks to the bulk of data that the base index file holds
covering almost everything in the repository? In other words, isn't the
use of splitIndex a strong sign that the base index file would benefit
the most from skipHash? And this patch is breaking the skipHash feature
for the use case that would benefit the most. And not hashing the index
files that are not bases would not save as much, since they are expected
to be much smaller.
I wonder if going in the other direction, i.e., when both are enabled,
disabling splitIndex and working only on the base hash, would be an
alternative that is equally viable as this change? Both will *break*
the promise of one feature so that the result can live with the other
feature. What are the pros and cons between them?
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.