kubo/core/node
Hector Sanjuan c953abb431 provider: buffer pin providers.
Fixes #10596.

The reproviding process can take long. Currently, each CID to be provided is
obtained by making a query to the pinner and reading one by one as the CIDs
get provided.

While this query is ongoing, the pinner holds a Read mutex on the pinset.

If a pin-add-request arrives, a goroutine will start waiting for a Write mutex
on the pinset. From that point, no new Read mutexes can be taken until the writer
can proceed and finishes.

However, no one can proceed because the read mutex is still held while the
reproviding is ongoing.

The fix is mostly in Boxo, where we add a "buffered" provider which reads the
cids onto memory so that they can be provided at its own pace without making
everyone wait.

The consequence is we will need more RAM memory. Rule of thumb is 1GiB extra per 20M cids to be reprovided.

(cherry picked from commit ba22102a64)
2025-03-14 18:20:00 +01:00
..
helpers collection of typo fixes (#10647) 2024-12-29 21:27:41 -08:00
libp2p feat(AutoTLS): enabled by default with 1h RegistrationDelay (#10724) 2025-02-25 22:25:58 +01:00
bitswap.go use go-datastore without go-process (#10736) 2025-03-04 18:52:26 -08:00
builder.go coreapi/unixfs: don't create an additional IpfsNode for --only-hash 2024-03-19 12:37:23 +01:00
core.go feat: expose BlockKeyCacheSize and enable WriteThrough datastore options (#10614) 2024-12-19 23:12:05 +00:00
dns.go refactor: switch gateway code to new API from go-libipfs (#9681) 2023-03-30 13:20:37 +00:00
groups.go feat(AutoTLS): enabled by default with 1h RegistrationDelay (#10724) 2025-02-25 22:25:58 +01:00
helpers.go refactor: update to boxo without goprocess (#10567) 2024-11-19 18:04:22 +01:00
identity.go chore: bump go-libp2p v0.22.0 & go1.18&go1.19 2022-09-09 17:09:38 +02:00
ipns.go refactor: update to boxo without goprocess (#10567) 2024-11-19 18:04:22 +01:00
peering.go chore: migrate peering to ipfs/boxo (#10157) 2023-10-31 13:45:51 +00:00
provider.go provider: buffer pin providers. 2025-03-14 18:20:00 +01:00
storage.go feat: expose BlockKeyCacheSize and enable WriteThrough datastore options (#10614) 2024-12-19 23:12:05 +00:00