Skip to content

Commit

Permalink
MB-28753 - document number "xxx" not found
Browse files Browse the repository at this point in the history
err with update workload

Introducer was incorrectly updating the offsets slice
of segments, by considering only the live doc count
while computing the "running". This can result in
incorrectly computing the residing segment as well as
the local doc numbers while loading a document after
a search hit.
  • Loading branch information
sreekanth-cb committed Mar 19, 2018
1 parent 6693a89 commit 980ce9e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions index/scorch/introducer.go
Expand Up @@ -154,7 +154,7 @@ func (s *Scorch) introduceSegment(next *segmentIntroduction) error {
newSnapshot.segment = append(newSnapshot.segment, newss)
root.segment[i].segment.AddRef()
newSnapshot.offsets = append(newSnapshot.offsets, running)
running += root.segment[i].Count()
running += newss.segment.Count()
}
}

Expand Down Expand Up @@ -315,7 +315,7 @@ func (s *Scorch) introduceMerge(nextMerge *segmentMerge) {
})
root.segment[i].segment.AddRef()
newSnapshot.offsets = append(newSnapshot.offsets, running)
running += root.segment[i].Count()
running += root.segment[i].segment.Count()
}
}

Expand Down

0 comments on commit 980ce9e

Please sign in to comment.