Skip to content

Commit

Permalink
changing addindexmutation
Browse files Browse the repository at this point in the history
  • Loading branch information
harshil-goel committed Oct 23, 2024
1 parent 6961384 commit 83006e4
Showing 1 changed file with 17 additions and 17 deletions.
34 changes: 17 additions & 17 deletions posting/index.go
Original file line number Diff line number Diff line change
Expand Up @@ -217,26 +217,26 @@ func (txn *Txn) addIndexMutation(ctx context.Context, edge *pb.DirectedEdge, tok
return err
}

//if err = plist.addMutation(ctx, txn, edge); err != nil {
// return err
//}

mpost := NewPosting(edge)
mpost.StartTs = txn.StartTs
if mpost.PostingType != pb.Posting_REF {
edge.ValueId = fingerprintEdge(edge)
mpost.Uid = edge.ValueId
if err = plist.addMutation(ctx, txn, edge); err != nil {
return err
}

//fmt.Println("ADDING MUTATION", plist.mutationMap, key, edge)
txn.addConflictKey(indexConflicKey(key, edge))
//mpost := NewPosting(edge)
//mpost.StartTs = txn.StartTs
//if mpost.PostingType != pb.Posting_REF {
// edge.ValueId = fingerprintEdge(edge)
// mpost.Uid = edge.ValueId
//}

plist.Lock()
defer plist.Unlock()
if err != plist.updateMutationLayer(mpost, false) {
return errors.Wrapf(err, "cannot update mutation layer of key %s with value %+v",
hex.EncodeToString(plist.key), mpost)
}
////fmt.Println("ADDING MUTATION", plist.mutationMap, key, edge)
//txn.addConflictKey(indexConflicKey(key, edge))

//plist.Lock()
//defer plist.Unlock()
//if err != plist.updateMutationLayer(mpost, false) {
// return errors.Wrapf(err, "cannot update mutation layer of key %s with value %+v",
// hex.EncodeToString(plist.key), mpost)
//}

//ostats.Record(ctx, x.NumEdges.M(1))
return nil
Expand Down

0 comments on commit 83006e4

Please sign in to comment.