-
Notifications
You must be signed in to change notification settings - Fork 32
brig ls
and repinning with large dataset takes forever and blocks other operations
#119
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
Hi, Your general assessment is correct: checking the pinned status is quite expensive operation. Since we talk to the ipfs and it then has to check for all chunks. Consequently, As for the hammering the disk every 15 minutes, it might be triggered Also try to set
it should help too. Try to use development version of But both IPFS and brig do not scale to well with many files repos, mostly because of IPFS. One can disable garbage collection which helps but than you may have a lot of stale chunks in the backend. IPFS has a database backend, instead of |
Thanks for your reply. I am using the latest development version already, as well as badgerds as my datastore for the IPFS node. I've worked around the performance issue caused by the These patches combined with some config tweaks seem to have made the whole thing decently workable. My current patches are probably far too hacky for upstreaming, but if I find better ways around these issues you'll see PRs from me. |
I would agree, it is too hacky to just disable the check. This way you cannot be sure about the state of the local repo. You might unpin something which has no replica anywhere else. As I said, the first check for pin status is the only one which is long. You can increase cache retention time and then consequent brig/backend/httpipfs/shell.go Line 104 in 6b7eccf
The rest is IPFS doing its own things. An ideal solution would be to have asynchronous pin test check. By the way, what is your use case? |
My use case is Syncthing-like (or Nextcloud-like, since that's the actual thing I seek to replace) personal file synchronization. I'm hoping to use brig for this because I already have a decent IPFS setup on my machines and I like the "lazy synchronization" aspect where files are only fetched when accessed. |
Currently we ask IPFS about every file pin status separately. Could you check how long does it take on your large data collection On a separate note, if you file collection is static brig will work. But if you thinking about using it as a work tree with a lot of changes, then merging might give you trouble. @sahib and I worked on it while ago, but did not make it fully bullet proof. |
I cancelled
Regarding work tree operations, I do intend to use brig like that and I believe I've already run into a problem. I've been debugging it with the following repro steps:
I can open a separate issue for that if you think it's worth looking at. |
Thanks for benchmark, I double check the isPinned code at Line 76 in 6b7eccf
The situation is a bit more complex: the pin status alone is not enough. Pin is equivalent for download and keep request, it does not guarantee that children chunks are already locally available. So we called for My use case was to ask But pinning is difficult: there is pin at Please file a separate bug about tree operations. Only @sahib fully understand the tree storage system. I recall working on similar issue, but I was not able to solve it. There were no merge conflict resolution mechanism envisioned, so syncing has strange side effects. |
Describe the bug
With a large dataset (~70GB, ~4500 files),
brig ls
takes a very long time, as does performing a repin, Worse yet, repinning seems to be an operation that blocks all other file operations, so with the default configuration brig stalls for hours every 15 minutes. I suspect this is due toIsCached
being called on everything in the repo and therefore performing a/refs
call on all the CIDs brig knows about.To Reproduce
brig ls
or
Please always include the output of the following commands in your report!
brig bug -s
go version: ````
uname -s -v -m:
Linux #1-NixOS SMP PREEMPT Wed May 18 08:28:23 UTC 2022 x86_64
IPFS config (only datastore):
brig client version:
v.. [build: ]
(built from 6b7eccf)brig server version:
v..+
IPFS Version:
0.12.2+
Expected behavior
brig ls
should return (near) instantly. Repinning should be performed in the background, without blocking other commands and without hammering the disk with read operations.The text was updated successfully, but these errors were encountered: