mirror of
https://github.com/dolthub/dolt.git
synced 2026-05-04 11:30:14 -05:00
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:
@@ -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
|
||||
|
||||
@@ -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")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user