From 980ce9ebb300d66abedcc430277fd228d4b0d772 Mon Sep 17 00:00:00 2001 From: Sreekanth Sivasankaran Date: Mon, 19 Mar 2018 11:29:58 +0530 Subject: [PATCH] MB-28753 - document number "xxx" not found 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. --- index/scorch/introducer.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/index/scorch/introducer.go b/index/scorch/introducer.go index 98769ed5..627d4e4c 100644 --- a/index/scorch/introducer.go +++ b/index/scorch/introducer.go @@ -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() } } @@ -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() } }