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

Yonik Seeley commented on SOLR-9506:
------------------------------------

A few random points after browsing this issue...

bq. We can not use current versionsHash (unless we cache all the individual 
version numbers), as it is not additive.

The current versionsHash is additive (it must be, because as you say segments 
may not line up between leader and replica, and document order may differ).  
When caching per segment, keep this property by simply adding the segment 
fingerprints together.  Am I missing something here?

bq. private final Map<LeafReaderContext, ...

LeafReaderContext objects are not reused between changed indexes, so it would 
not make an effective cache key.
Use the core cache key, as FieldCache does.

bq. We should keep in mind that previously written segments can change if there 
are deletes.

Right... the core cache key does not change, even if there are deletes for the 
segment.
One way to handle this w/o recomputing everything is:
1) compute the hash w/o regard to deleted docs
2) compute the hash of deleted docs only
3) subtract the two values to obtain your hash
4) keep track of the numDocs in the segment as well... if that doesn't change, 
no need to recompute.  If it does change, then there were additional deletions. 
 Recompute the hash for the deleted docs.



> cache IndexFingerprint for each segment
> ---------------------------------------
>
>                 Key: SOLR-9506
>                 URL: https://issues.apache.org/jira/browse/SOLR-9506
>             Project: Solr
>          Issue Type: Improvement
>      Security Level: Public(Default Security Level. Issues are Public) 
>            Reporter: Noble Paul
>         Attachments: SOLR-9506.patch, SOLR-9506_POC.patch
>
>
> The IndexFingerprint is cached per index searcher. it is quite useless during 
> high throughput indexing. If the fingerprint is cached per segment it will 
> make it vastly more efficient to compute the fingerprint



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org
For additional commands, e-mail: dev-h...@lucene.apache.org

Reply via email to