nick-boss-tech opened a new pull request, #5079:
URL: https://github.com/apache/solr/pull/5079

   🤖 *AI text below* 🤖 *(posted on behalf of Nick Shanin)*
   
   https://issues.apache.org/jira/browse/SOLR-6973
   
   ## What happens today
   
   **With `overwriteDupes`, a partial update with no signature fields can 
delete unrelated documents.**
   
   With a `fields` list, the processor's loop throws only if a signature field 
is present in the partial update. A partial update that sets other fields 
passes the loop with an empty signature. The processor writes that signature to 
`signatureField` and sets `updateTerm` to it 
([SignatureUpdateProcessorFactory.java](https://github.com/nick-boss-tech/solr/blob/fa5b59ba07b47fca7bd513ef619bec4632595b98/solr/core/src/java/org/apache/solr/update/processor/SignatureUpdateProcessorFactory.java#L169-L210)).
 `updateDocuments` deletes every document that matches `updateTerm` 
([DirectUpdateHandler2.java](https://github.com/nick-boss-tech/solr/blob/fa5b59ba07b47fca7bd513ef619bec4632595b98/solr/core/src/java/org/apache/solr/update/DirectUpdateHandler2.java#L1177-L1180)).
   
   ## What this change does
   
   **A partial update with no signature fields skips the signature step.**
   
   It goes to the next processor unchanged. Partial updates with a signature 
field still fail, and requests without `fields` still reject partial updates 
([SignatureUpdateProcessorFactory.java](https://github.com/nick-boss-tech/solr/blob/fa5b59ba07b47fca7bd513ef619bec4632595b98/solr/core/src/java/org/apache/solr/update/processor/SignatureUpdateProcessorFactory.java#L152-L196)).
   
   Behavior change: a partial update that creates a new document now stores it 
without `signatureField`. The old code gave it the shared empty signature, 
which caused the collision.
   
   ## Proof
   
   **The new test fails on the base code (by reading) and passes with this 
change.**
   
   The test is 
[SignatureUpdateProcessorFactoryTest.java](https://github.com/nick-boss-tech/solr/blob/fa5b59ba07b47fca7bd513ef619bec4632595b98/solr/core/src/test/org/apache/solr/update/processor/SignatureUpdateProcessorFactoryTest.java#L205-L236).
 It checks that `signatureField` is absent and `updateTerm` is null. On the 
base production code, the same class ran 7 tests with 1 failure. By reading, 
the new test is the one that breaks, because the base code sets both values it 
checks.
   
   With this change, the focused `SignatureUpdateProcessorFactoryTest` ran 7 of 
7, verified 2026-10-08 at head `fa5b59ba07b4`. The build checks (changelog 
parse, tidy, Error Prone compile, and core module check without tests) also 
passed.
   
   ## A choice to check
   
   **The update passes through. The other option is to reject it.**
   
   The no-`fields` setup already rejects partial updates with an error. This 
change passes them through, so the update works and no signature is stored. 
Rejecting would make the failure visible but would stop the update. Was 
pass-through the right call?
   
   ## Limits
   
   **The reporter's 5% symptom is not shown to come from this path.**
   
   The ticket comments suggest shard routing. This change removes one collision 
path. It does not show that the path explains the report. The effect on new 
documents was checked by reading only.
   
   Changelog: `changelog/unreleased/SOLR-6973-signature-partial-update.yml`
   
   ### AI assistance
   
   AI agents assisted with research, implementation, review, and drafting. Nick 
Shanin directed the work and takes responsibility for this contribution.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


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

Reply via email to