Skip to content
This repository has been archived by the owner on Jun 19, 2023. It is now read-only.

fix(arc): striped locking on last byte of CID #67

Merged
merged 1 commit into from
May 4, 2021

Conversation

frrist
Copy link
Member

@frrist frrist commented Apr 6, 2021

No description provided.

@frrist frrist mentioned this pull request Apr 6, 2021
@frrist frrist force-pushed the frrist/arc-cache-bench branch 2 times, most recently from 11498f4 to 80e1a84 Compare April 7, 2021 18:22
@frrist frrist requested a review from aschmahmann April 7, 2021 20:15
@frrist frrist force-pushed the frrist/arc-cache-stripe branch 2 times, most recently from 878e3f9 to d94af12 Compare April 8, 2021 18:45
@frrist frrist self-assigned this Apr 8, 2021
@frrist frrist requested a review from Stebalien April 8, 2021 19:12
@frrist frrist mentioned this pull request Apr 26, 2021
2 tasks
@frrist frrist changed the base branch from frrist/arc-cache-bench to master May 3, 2021 18:52
@frrist frrist force-pushed the frrist/arc-cache-stripe branch 2 times, most recently from 83cb480 to 72ade3e Compare May 3, 2021 19:21
arc_cache.go Outdated Show resolved Hide resolved
arc_cache.go Outdated Show resolved Hide resolved
arc_cache.go Outdated Show resolved Hide resolved
arc_cache.go Outdated Show resolved Hide resolved
arc_cache.go Outdated Show resolved Hide resolved
@frrist frrist marked this pull request as ready for review May 4, 2021 20:22
arc_cache.go Outdated
var good []blocks.Block
for _, block := range bs {
// call put on block if result is inconclusive or we are sure that
// the block isn't in storage
if has, _, ok := b.queryCache(block.Cid()); !ok || (ok && !has) {
if !block.Cid().Defined() {
log.Error("undefined cid in arc cache")
continue
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

unsure if we want to continue or bail in the event an undefined CID is in bs, thoughts?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On put, bail. This is definitely an invalid block.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

removed this case since it should never (right?) be the case that the CID of a blocks.Block is undefined.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, that should be impossible.

@frrist frrist force-pushed the frrist/arc-cache-stripe branch 3 times, most recently from b305189 to 7475315 Compare May 4, 2021 21:12
arc_cache.go Outdated Show resolved Hide resolved
arc_cache.go Outdated Show resolved Hide resolved
arc_cache.go Outdated Show resolved Hide resolved
arc_cache.go Outdated Show resolved Hide resolved
arc_cache.go Outdated Show resolved Hide resolved
Copy link
Member

@Stebalien Stebalien left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Two small things but otherwise LGTM.

arc_cache.go Outdated Show resolved Hide resolved
arc_cache.go Outdated Show resolved Hide resolved
@Stebalien Stebalien merged commit d90561b into master May 4, 2021
@Stebalien
Copy link
Member

Thanks!

@Stebalien Stebalien deleted the frrist/arc-cache-stripe branch May 4, 2021 22:40
@aschmahmann aschmahmann mentioned this pull request Dec 13, 2021
59 tasks
Jorropo pushed a commit to ipfs/go-libipfs-rapide that referenced this pull request Mar 23, 2023
…che-stripe

fix(arc): striped locking on last byte of CID

This commit was moved from ipfs/go-ipfs-blockstore@d90561b
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants