Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SOLR-17120: handle null value when merging partials (backport of solr#2214) #2683

Merged
merged 1 commit into from Jan 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 3 additions & 0 deletions solr/CHANGES.txt
Expand Up @@ -42,6 +42,9 @@ Bug Fixes
* SOLR-17098: ZK Credentials and ACLs are no longer sent to all ZK Servers when using Streaming Expressions.
They will only be used when sent to the default ZK Host. (Houston Putman, Jan Høydahl, David Smiley, Gus Heck, Qing Xu)

* SOLR-17120: Fix NullPointerException in UpdateLog.applyOlderUpdates that can occur if there are multiple partial
updates of the same document in separate requests using commitWithin. (Calvin Smith, Christine Poerschke)

Comment on lines +45 to +47
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just noting that main and branch_9x and branch_9_5 (if releasing after 8.11.3) don't have a 8.11.3 section as yet but would presumably get it in bulk as part of the 8.11.3 release process i.e. no need for individual tickets to add the entries incrementally on those branches.

Optimizations
---------------------
* SOLR-16555: SolrIndexSearcher - FilterCache intersections/andNot should not clone bitsets repeatedly (Kevin Risden, David Smiley)
Expand Down
9 changes: 7 additions & 2 deletions solr/core/src/java/org/apache/solr/update/UpdateLog.java
Expand Up @@ -959,8 +959,13 @@ private void applyOlderUpdates(@SuppressWarnings({"rawtypes"})SolrDocumentBase n
for (String fieldName : olderDoc.getFieldNames()) {
// if the newerDoc has this field, then this field from olderDoc can be ignored
if (!newerDoc.containsKey(fieldName) && (mergeFields == null || mergeFields.contains(fieldName))) {
for (Object val : olderDoc.getFieldValues(fieldName)) {
newerDoc.addField(fieldName, val);
Collection<Object> values = olderDoc.getFieldValues(fieldName);
if (values == null) {
newerDoc.addField(fieldName, null);
} else {
for (Object val : values) {
newerDoc.addField(fieldName, val);
}
}
}
}
Expand Down