-
-
Notifications
You must be signed in to change notification settings - Fork 353
The slotmap turned out to be too small #1788
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Thanks for reporting! This shouldn't be happening as it starts out the slotmap with Could you list the files in |
|
its on windows |
Thanks, it really looks like this is a bug where it can't properly scale beyond 32 anymore. |
What about the progress of the task? How can I help you? Perhaps you need additional information? |
This issue is top of my list, and still I didn't get to it - special times. gitoxide/gix/tests/gix/remote/fetch.rs Lines 88 to 90 in dbf079f
The test above could be adapted to create more than 32 packs in the local repository by fetching repeatedly. Then a default repository can be opened there, with the assumption that this reproduces the issue you are seeing after accessing the If this doesn't reproduce, and as an immediate fix, you could also try to set the default slotmap size to 96, which would allow 96 indices and packs to be opened at the same time (i.e. nearly 200 files) - that way it should just work without truly fixing the bug. If it still doesn't work though, this would certainly also tell us something about the nature of the issue. |
Apologies for the long wait. However, I did change the test in the linked PR to the point where it should be able to reproduce the issue. The hypothesis was that if there are many packs, it's unable properly configure its slotmap to be able to load all packs if needed. However, int he screenshot it seemingly failed to do that. A test was created to create a repository that would be above a set minimal amount of packs it could read, to validate it dynamically adjusts that value. And the test works as expected. Further, I have a repository with 145 packs, and Could you retry this with the latest version of My assumption would be that it is still reproducing for you, but ideally we could work on debugging this together to figure out what the problem is. In the screenshot, it clearly didn't see all packs and initialized the slotmap with the minimum of 32 slots, even though 95 packs (the slotmap should be 105 slots large then). gitoxide/gix-odb/src/store_impls/dynamic/load_index.rs Lines 457 to 460 in 52ff68b
Thanks in advance for your help. |
Perhaps a different cause, but I can consistently hit "slotmap too small" when a concurrent 'git fetch' brings down new pack files and I reuse an existing/stale gix::Repository object. |
Thanks for sharing! It's good that this sounds like parallelism isn't the issue here, but merely the local state of another gix::Repository. Does that means that you'd think the following triggers the issue? let fetch_repo = gix::open(path);
let other_repo = fetch_repo.clone();
let (packs, fetched_refs) = fetch_repo.fetch();
assert!(packs > 0);
// This works
fetched_refs[0].attach(&fetched_repo).id().object();
// slotmap too small
fetched_refs[0].attach(&other_repo).id().object(); If not, maybe you can update the example to something that resembles your code better (or share your code), so I can see if this reproduces in a test. |
Yes, I think this matches what I suspect.
I'm using a PoC/hack to make jj work with git blobless partial clones (git clone --filter blob:none). PR is jj-vcs/jj#6451. The code is real basic and just catches NotFound error from I see errors like:
Notably they're always "need 1 more", which I think strongly suggests the issue is tickled by my Oh, and fwiw, I think my build of jj is using (not modified in my PR):
|
That is great to hear that this is a PoC which basically dialled pack creation up to 11 :)! I presume this won't happen anymore if the Right now there is no dynamic growth of the fixed slotmap, and one has to instantiate it so that it can accommodate the anticipated maximum amount of packs. The default minimal size is 36 which assumes a worst-case geometric pack, but it will be what it needs to be +10% safety margin when instantiating a new Now I am thinking that maybe one way to improve the situation for most is to just put it to 256 or 512 even to cover even extreme real-world cases - for you that is still easily exhausted unless measures are taken to counter it. Ideally, it would dynamically grow, but getting this to work in this highly-concurrent portion of the codebase that is under-tested will be very hard and risky (things could break only when things get truly multi-threaded). |
Current behavior 😯
gix is not working with repository ~2M files + LFS
Expected behavior 🤔
work as git
Git behavior
Steps to reproduce 🕹
git status
git log
The text was updated successfully, but these errors were encountered: