diff --git a/graph/kv/indexing.go b/graph/kv/indexing.go index 83422395a..a972bc941 100644 --- a/graph/kv/indexing.go +++ b/graph/kv/indexing.go @@ -904,7 +904,7 @@ func (qs *QuadStore) initBloomFilter(ctx context.Context) error { it := b.Scan(nil) defer it.Close() for it.Next(ctx) { - v := it.Key() + v := it.Val() p = proto.Primitive{} err := p.Unmarshal(v) if err != nil { diff --git a/graph/kv/quadstore.go b/graph/kv/quadstore.go index 361a3fd6f..e92f42ab7 100644 --- a/graph/kv/quadstore.go +++ b/graph/kv/quadstore.go @@ -139,7 +139,9 @@ func New(kv BucketKV, _ graph.Options) (graph.QuadStore, error) { return nil, errors.New("kv: data version is out of date. Run cayleyupgrade for your config to update the data.") } qs.valueLRU = lru.New(2000) - qs.initBloomFilter(ctx) + if err := qs.initBloomFilter(ctx); err != nil { + return nil, err + } return qs, nil }