Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(core): Update error msg for txn too old to give more context #9170

Merged
merged 2 commits into from
Sep 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions posting/index.go
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ func (txn *Txn) addReverseMutationHelper(ctx context.Context, plist *List,
if hasCountIndex {
countBefore, found, _ = plist.getPostingAndLengthNoSort(txn.StartTs, 0, edge.ValueId)
if countBefore == -1 {
return emptyCountParams, ErrTsTooOld
return emptyCountParams, errors.Wrapf(ErrTsTooOld, "Adding reverse mutation helper count")
}
}
if err := plist.addMutationInternal(ctx, txn, edge); err != nil {
Expand Down Expand Up @@ -505,7 +505,7 @@ func (txn *Txn) addMutationHelper(ctx context.Context, l *List, doUpdateIndex bo
case hasCountIndex:
countBefore, found, currPost = l.getPostingAndLength(txn.StartTs, 0, getUID(t))
if countBefore == -1 {
return val, false, emptyCountParams, ErrTsTooOld
return val, false, emptyCountParams, errors.Wrapf(ErrTsTooOld, "Add mutation count index")
}
case doUpdateIndex || delNonListPredicate:
found, currPost, err = l.findPosting(txn.StartTs, fingerprintEdge(t))
Expand Down
2 changes: 1 addition & 1 deletion posting/list.go
Original file line number Diff line number Diff line change
Expand Up @@ -1278,7 +1278,7 @@ func (l *List) Uids(opt ListOptions) (*pb.List, error) {
if len(l.mutationMap) == 0 && opt.Intersect != nil && len(l.plist.Splits) == 0 {
if opt.ReadTs < l.minTs {
l.RUnlock()
return out, ErrTsTooOld
return out, errors.Wrapf(ErrTsTooOld, "While reading UIDs")
}
algo.IntersectCompressedWith(l.plist.Pack, opt.AfterUid, opt.Intersect, out)
l.RUnlock()
Expand Down
2 changes: 1 addition & 1 deletion posting/mvcc.go
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ func (ir *incrRollupi) Process(closer *z.Closer, getNewTs func(bool) uint64) {
currTs := time.Now().Unix()
for _, key := range *batch {
hash := z.MemHash(key)
if elem := m[hash]; currTs-elem >= 2 {
if elem := m[hash]; currTs-elem >= 10 {
// Key not present or Key present but last roll up was more than 2 sec ago.
// Add/Update map and rollup.
m[hash] = currTs
Expand Down
2 changes: 1 addition & 1 deletion worker/task.go
Original file line number Diff line number Diff line change
Expand Up @@ -854,7 +854,7 @@ func (qs *queryState) handleUidPostings(
}
len := pl.Length(args.q.ReadTs, 0)
if len == -1 {
return posting.ErrTsTooOld
return errors.Wrapf(posting.ErrTsTooOld, "While reading posting list length")
}
count := int64(len)
if evalCompare(srcFn.fname, count, srcFn.threshold[0]) {
Expand Down
Loading