solrsolrjbackwards-compatibilitysolr8

Solr throws error on partial update after upgrade to 8.8


I'm doing a simple partial update scenario which worked with version 6.x and 7.x of Solr. After upgdrading both Solr and Solrj to 8.8, I'm getting the following exception:

2021-02-23 14:57:58.201 ERROR (qtp-459670553-28) [   x:core1] o.a.s.h.RequestHandlerBase org.apache.solr.common.SolrException: TransactionLog doesn't know how to serialize class org.apache.lucene.document.LazyDocument$LazyField; try implementing ObjectResolver?
    at org.apache.solr.update.TransactionLog$1.resolve(TransactionLog.java:100)
    at org.apache.solr.common.util.JavaBinCodec.writeVal(JavaBinCodec.java:266)
    at org.apache.solr.common.util.JavaBinCodec$BinEntryWriter.put(JavaBinCodec.java:441)
    at org.apache.solr.common.ConditionalKeyMapWriter$EntryWriterWrapper.put(ConditionalKeyMapWriter.java:44)
    at org.apache.solr.common.MapWriter$EntryWriter.putNoEx(MapWriter.java:101)
    at org.apache.solr.common.MapWriter$EntryWriter.lambda$getBiConsumer$0(MapWriter.java:161)
    at org.apache.solr.common.MapWriter$EntryWriter$$Lambda$548/0000000000000000.accept(Unknown Source)
    at org.apache.solr.common.SolrInputDocument.lambda$writeMap$0(SolrInputDocument.java:59)
    at org.apache.solr.common.SolrInputDocument$$Lambda$549/0000000000000000.accept(Unknown Source)
    .....

solrj code is just similar to the sample provided here and was working before upgrade. The operation is 'add' with a simple integer field for a document whose id is provided.

Note that this is different from a previous question on stackoverflow, since I'm passing simple integer field and on solr/lucene side it's replaced with org.apache.lucene.document.LazyDocument$LazyField.


Solution

  • Seems to be a bug in Solr https://issues.apache.org/jira/browse/SOLR-13034 to be fixed in the next version of solr 8 (8.9).

    Until it's released the workaround is to set <enableLazyFieldLoading>false</enableLazyFieldLoading> in solrconfig.xml