You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-user@lucene.apache.org by 明天会更好 <wu...@qq.com> on 2019/06/18 01:13:15 UTC

Some questions about solr source code

Dear Solr Developer,
    I am a Chinese Software developer and I having been using solr for nearly 4years.First Thank u for your continuous effort on improving solr.  Recently I began to read the source code because I am very curious about how it works. But I encountered many questions which I spend much time to thinkd about but failed.I hope u can explain for me.I list the question below.I am using solr 6.6.0.Please parden me for my poor English.
    1.In the method boolean handleVersions(ShardResponse srsp) of the class org.apache.solr.update.PeerSync,I can not understand the variant 'boolean completeList = otherVersions.size() < nUpdates;  ',I think it is just the opposite.Maybe I misunderstand the whole passage
    2.Also in the class org.apache.solr.update.PeerSync,the method 'handleVersionsWithRanges',I think there is a bug in line 555 
    while ((otherUpdatesIndex < otherVersions.size()) && (Math.abs(otherVersions.get(otherUpdatesIndex)) < Math.abs(ourUpdates.get(ourUpdatesIndex)))) {
        xxxxx
    }
    otherUpdatesIndex are always < otherVersions.size(),because it starts with otherVersions.size() -1 and it never get bigger,so there no point in checking this.I think it should be replaced with 'otherUpdatesIndex >= 0'
   I am not an expert of Solr.May be I misunderstand the whole class or method so please tell me directly if I am wrong.
   Please parden me again for my poor English.I am looking forward for your replay. Thank u again for your great effort to develop and improve Solr.


Best Regards
Guohua Wu