ipfs-cluster/ipfsconn/ipfshttp
Hector Sanjuan ed54c665b8 ipfshttp: Fix "seen blocks" tracking and blockPut metrics
This fixes two bugs. First, the "blockPut response CID does not match the
multihash" warning was coming up when it shouldn't. Particularly, the
multipart reader called Node() several times for the same block, resulting in
CIDs been removed from the Seen set, and causing the warning when there were
several blocks (usually the empty dir block).

This also means we were counting Blockputs (and total data added) wrong in the
metrics, double-counting some blocks as these were recorded in Node() calls.

The fix makes the tracking in Next(), which is only called once for each
block. To avoid timing issues between Block reads from the channel and
blockput responses, the Seen set now stores how many times we have seen a
block. Thus a duplicated block that will get two BlockPut responses will not
trigger a warning regardless of the time when those responses arrive.

Fixes #1706.
2022-09-05 18:10:36 +02:00
..
config_test.go Fix: repo/stat gets hammered on busy cluster peers 2022-02-01 01:34:17 +01:00
config.go Enable spell checking and fix spelling errors (using US locale) 2022-06-16 17:43:30 +02:00
ipfshttp_test.go Migrate from ipfs/ipfs-cluster to ipfs-cluster/ipfs-cluster 2022-06-16 17:43:30 +02:00
ipfshttp.go ipfshttp: Fix "seen blocks" tracking and blockPut metrics 2022-09-05 18:10:36 +02:00