You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Owner: whoever owns IPFS/storage (unassigned) · Priority: Medium — does not block rollout of the Redis approach elsewhere, but the raw-content sub-decision below should land before this migrates, not after.
Description
IpfsPinningService (src/ipfs-pinning/ipfs-pinning.service.ts) keeps two process-local stores: Map<cid, PinRecord> (pin metadata/status, read by RepinWorkerService to find under-replicated pins) and Map<cid, Buffer> (the original uploaded bytes, retained so a re-pin retry doesn't need the original caller to re-upload). Follow-up from the persistence spike (#181) — see backend/PERSISTENT_STORAGE_SPIKE.md (§2, §7).
These two stores don't have the same shape and shouldn't be migrated the same way:
Raw content Buffers are a poor fit for Redis as general-purpose KV storage — binary blobs bloat Redis memory fast, and this isn't what Redis is for. Needs its own decision: either move raw content to object storage (S3-compatible) with only a reference stored alongside the pin metadata, or drop the retry-without-refetch behavior and require the caller to resupply content on a failed re-pin. Get a rough per-record size × expected volume estimate before committing either way (see the spike's §7 sizing note).
Decide the raw-content Buffer map's fate: object storage vs. dropping retry-without-refetch (flag any new infra/cost implications — this may need its own follow-up rather than landing here)
Owner: whoever owns IPFS/storage (unassigned) · Priority: Medium — does not block rollout of the Redis approach elsewhere, but the raw-content sub-decision below should land before this migrates, not after.
Description
IpfsPinningService(src/ipfs-pinning/ipfs-pinning.service.ts) keeps two process-local stores:Map<cid, PinRecord>(pin metadata/status, read byRepinWorkerServiceto find under-replicated pins) andMap<cid, Buffer>(the original uploaded bytes, retained so a re-pin retry doesn't need the original caller to re-upload). Follow-up from the persistence spike (#181) — seebackend/PERSISTENT_STORAGE_SPIKE.md(§2, §7).These two stores don't have the same shape and shouldn't be migrated the same way:
PinRecordmetadata is a good Redis fit — small JSON per CID, point lookups, filter by replication status. Same pattern asGigService(Spike: Persistent, multi-instance-safe storage strategy to replace in-memory service state #181):SET pin:{cid} <json>, plus a set/sorted-set index for "needs re-pin" queriesRepinWorkerServiceruns.Buffers are a poor fit for Redis as general-purpose KV storage — binary blobs bloat Redis memory fast, and this isn't what Redis is for. Needs its own decision: either move raw content to object storage (S3-compatible) with only a reference stored alongside the pin metadata, or drop the retry-without-refetch behavior and require the caller to resupply content on a failed re-pin. Get a rough per-record size × expected volume estimate before committing either way (see the spike's §7 sizing note).Tasks
PinRecordmetadata to Redis following theGigServicepattern (Spike: Persistent, multi-instance-safe storage strategy to replace in-memory service state #181) — including its transaction-result verification, fallback metric, and production fail-fast behaviorBuffermap's fate: object storage vs. dropping retry-without-refetch (flag any new infra/cost implications — this may need its own follow-up rather than landing here)RepinWorkerService's under-replicated-pin query to use the new store (note: the distributed-lock work for this worker is tracked separately in Add distributed lock so background sweep workers run as a single active instance #182, not here)errorlevel, matchingGigService/NonceStoreServiceAcceptance Criteria
ipfs-pinning.service.spec.ts/repin-worker.service.spec.tstests still pass, updated for the new storeEstimated Time
2-3 days