[ 
https://issues.apache.org/jira/browse/LUCENE-5173?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13738299#comment-13738299
 ] 

Robert Muir commented on LUCENE-5173:
-------------------------------------

{quote}
Maybe the assert in SegmentMerge should be a hard check, unless SegmentMerger 
always strictly throws away empty segments (not that somebody can somehow with 
a crazy alcoholic mergepolicy create those segments again).
{quote}

Or, maybe  mergeState.segmentInfo.setDocCount(setDocMaps()) should happen in 
the ctor of SegmentMerger instead of line 1 of merge()?

And it could a simple boolean method like shouldMerge(): returns docCount > 0, 
called by addIndexes and mergeMiddle?

this way the logic added to addIndexes in LUCENE-5116 wouldnt even need to be 
there, and we'd feel better that we arent writing such 0 document segments 
(which codecs are not prepared to handle today).

                
> Add checkindex piece of LUCENE-5116
> -----------------------------------
>
>                 Key: LUCENE-5173
>                 URL: https://issues.apache.org/jira/browse/LUCENE-5173
>             Project: Lucene - Core
>          Issue Type: Improvement
>            Reporter: Robert Muir
>         Attachments: LUCENE-5173.patch
>
>
> LUCENE-5116 fixes addIndexes(Reader) to never write a 0-document segment (in 
> the case you merge in empty or all-deleted stuff).
> I considered it just an inconsistency, but it could cause confusing 
> exceptions to real users too if there was a "regression" here. (see solr 
> users list:Split Shard Error - maxValue must be non-negative). 

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to