Merge pull request #8811 from dolthub/aaron/nbs-ghost-store-refcheck

[no-release-notes] go: store/nbs: GhostBlockStore: Add refCheck which participates in updating hasRecords.
This commit is contained in:
Aaron Son
2025-02-05 09:41:23 -08:00
committed by GitHub
2 changed files with 15 additions and 1 deletions
+1 -1
View File
@@ -250,7 +250,7 @@ func (gcs *GenerationalNBS) refCheck(recs []hasRecord) (hash.HashSet, error) {
return absent, nil
}
return gcs.ghostGen.hasMany(absent)
return gcs.ghostGen.refCheck(recs)
}
// Put caches c in the ChunkSource. Upon return, c must be visible to
+14
View File
@@ -149,6 +149,20 @@ func (g GhostBlockStore) hasMany(hashes hash.HashSet) (absent hash.HashSet, err
return absent, nil
}
func (g GhostBlockStore) refCheck(recs []hasRecord) (hash.HashSet, error) {
absent := hash.HashSet{}
for i := range recs {
if !recs[i].has {
if g.skippedRefs.Has(*recs[i].a) {
recs[i].has = true
} else {
absent.Insert(*recs[i].a)
}
}
}
return absent, nil
}
func (g GhostBlockStore) Put(ctx context.Context, c chunks.Chunk, getAddrs chunks.GetAddrsCurry) error {
panic("GhostBlockStore does not support Put")
}