Skip to content

Commit 3cf763e

Browse files
added filter for vector lengths
1 parent 75e1578 commit 3cf763e

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

posting/index.go

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -466,10 +466,10 @@ func (txn *Txn) addConflictKeyWithUid(key []byte, pl *pb.PostingList, hasUpsert
466466
txn.conflicts = make(map[uint64]struct{})
467467
}
468468
keyHash := farm.Fingerprint64(key)
469-
// if hasUpsert {
470-
// txn.conflicts[keyHash] = struct{}{}
471-
// return
472-
// }
469+
if hasUpsert {
470+
txn.conflicts[keyHash] = struct{}{}
471+
return
472+
}
473473
for _, post := range pl.Postings {
474474
txn.conflicts[keyHash^post.Uid] = struct{}{}
475475
}
@@ -675,9 +675,10 @@ func (mp *MutationPipeline) ProcessSingle(ctx context.Context, pipeline *Predica
675675
binary.BigEndian.PutUint64(dataKey[len(dataKey)-8:], uid)
676676
key := baseKey + string(dataKey[len(dataKey)-8:])
677677

678-
// if !info.noConflict {
679-
// mp.txn.addConflictKey(farm.Fingerprint64([]byte(key)))
680-
// }
678+
if !info.noConflict {
679+
fmt.Println("Creating token", farm.Fingerprint64([]byte(key)), uid, pipeline.attr)
680+
mp.txn.addConflictKey(farm.Fingerprint64([]byte(key)))
681+
}
681682

682683
if _, err := mp.txn.AddDelta(key, *pl); err != nil {
683684
return err

0 commit comments

Comments
 (0)