Skip to content

Commit

Permalink
fix pending query
Browse files Browse the repository at this point in the history
  • Loading branch information
shivaji-kharse committed May 14, 2024
1 parent 91975b3 commit 5f08f28
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
5 changes: 3 additions & 2 deletions tok/hnsw/helper.go
Original file line number Diff line number Diff line change
Expand Up @@ -433,9 +433,10 @@ func (ph *persistentHNSW[T]) createEntryAndStartNodes(
err := ph.getVecFromUid(entry, c, vec)
if err != nil || len(*vec) == 0 {
// The entry vector has been deleted. We have to create a new entry vector.
entry, err := ph.PickStartNode(ctx, c, vec)
entry, err := ph.calculateNewEntryVec(ctx, c, vec)
if err != nil {
return 0, []*index.KeyValue{}, err
// No other node exists, go with the new node that has come
return create_edges(inUuid)
}
return create_edges(entry)
}
Expand Down
4 changes: 3 additions & 1 deletion worker/draft.go
Original file line number Diff line number Diff line change
Expand Up @@ -843,7 +843,9 @@ func (n *node) commitOrAbort(pkey uint64, delta *pb.OracleDelta) error {
if txn == nil {
return
}
txn.Update()
if commit != 0 {
txn.Update()
}
// We start with 20 ms, so that we end up waiting 5 mins by the end.
// If there is any transient issue, it should get fixed within that timeframe.
err := x.ExponentialRetry(int(x.Config.MaxRetries),
Expand Down
4 changes: 3 additions & 1 deletion worker/mutation.go
Original file line number Diff line number Diff line change
Expand Up @@ -950,7 +950,9 @@ func (w *grpcWorker) proposeAndWait(ctx context.Context, txnCtx *api.TxnContext,

node := groups().Node
err := node.proposeAndWait(ctx, &pb.Proposal{Mutations: m})
fillTxnContext(txnCtx, m.StartTs)
if err == nil {
fillTxnContext(txnCtx, m.StartTs)
}
return err
}

Expand Down

0 comments on commit 5f08f28

Please sign in to comment.