0
0
Fork 0

remove temporary error and replace with permanent check

This commit is contained in:
Marty Schoch 2016-02-03 10:23:49 -05:00
parent c5dea9e882
commit f38e3e1b24
2 changed files with 4 additions and 6 deletions

View File

@ -26,6 +26,7 @@ const (
ErrorAliasEmpty
ErrorUnknownIndexType
ErrorEmptyID
ErrorIndexReadInconsistency
)
// Error represents a more strongly typed bleve error for detecting
@ -52,4 +53,5 @@ var errorMessages = map[Error]string{
ErrorAliasEmpty: "cannot perform operation on empty alias",
ErrorUnknownIndexType: "unknown index type",
ErrorEmptyID: "document ID cannot be empty",
ErrorIndexReadInconsistency: "index read inconsistency detected",
}

View File

@ -361,10 +361,6 @@ func (i *indexImpl) DocCount() (uint64, error) {
return i.i.DocCount()
}
// this error message is a temporary measure to avoid crashing when an
// inconsistent state of the index is encountered
var errMsg17298 = fmt.Errorf("Internal Error Detected - A known inconsistency has been detected, and this search cannot be completed. The index is not corrupt and the search may succeed if you try again. Please see the following bug for the latest information: https://issues.couchbase.com/browse/MB-17298")
// Search executes a search request operation.
// Returns a SearchResult object or an error.
func (i *indexImpl) Search(req *SearchRequest) (sr *SearchResult, err error) {
@ -469,7 +465,7 @@ func (i *indexImpl) Search(req *SearchRequest) (sr *SearchResult, err error) {
} else if err == nil {
// unexpected case, a doc ID that was found as a search hit
// was unable to be found during document lookup
return nil, errMsg17298
return nil, ErrorIndexReadInconsistency
}
}
}
@ -512,7 +508,7 @@ func (i *indexImpl) Search(req *SearchRequest) (sr *SearchResult, err error) {
} else if doc == nil {
// unexpected case, a doc ID that was found as a search hit
// was unable to be found during document lookup
return nil, errMsg17298
return nil, ErrorIndexReadInconsistency
}
}
}