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

   🤖 *AI text below* 🤖 *(posted on behalf of Nick Shanin)*
   
   https://issues.apache.org/jira/browse/SOLR-14262
   
   ## What happens today
   
   **A skipped commit gives the client the same response as a commit that ran.**
   
   The commit runs when there is no update log, when the update log is ACTIVE, 
or when the command is a replay. In any other state, such as BUFFERING, the 
code logs "Ignoring commit while not ACTIVE" and does nothing else 
([DistributedUpdateProcessor.java](https://github.com/nick-boss-tech/solr/blob/1e8d2b0075d7fded72ac19a049db27123a46ec10/solr/core/src/java/org/apache/solr/update/processor/DistributedUpdateProcessor.java#L1178-L1184)).
 The response has no field that says the commit was skipped.
   
   ## What this change does
   
   **A skipped commit now adds a `commitIgnored` header to the response.**
   
   The header name is `commitIgnored`. Its value is the update log state that 
caused the skip, such as `BUFFERING`. The header appears only when a commit is 
skipped. Commits that run get no header 
([DistributedUpdateProcessor.java](https://github.com/nick-boss-tech/solr/blob/1e8d2b0075d7fded72ac19a049db27123a46ec10/solr/core/src/java/org/apache/solr/update/processor/DistributedUpdateProcessor.java#L1185-L1189)).
   
   The commit is still skipped. Only the response changes, with one extra 
header.
   
   ## Proof
   
   **The test fails on the base code and passes with this change.**
   
   Gate run on 2026-10-07 at head `1e8d2b0075d7`:
   
   - `TestRecovery.testCommitWhileBufferingIsReported`, base production code 
with the new test: 1 of 1 fails, at the `commitIgnored` assertion.
   - `TestRecovery.testCommitWhileBufferingIsReported` with this change: 1/1 
passes. Module check rc=0.
   
   The test checks that the header is absent on an active commit, and present 
with the value `BUFFERING` on a buffering commit 
([TestRecovery.java](https://github.com/nick-boss-tech/solr/blob/1e8d2b0075d7fded72ac19a049db27123a46ec10/solr/core/src/test/org/apache/solr/search/TestRecovery.java#L403-L422)).
   
   ## A choice to check
   
   **The response contract is a custom header. The header name and value are 
not final.**
   
   The ticket discussion raises two other routes: waiting for the commit to 
run, or reporting the replication factor (`rf`). This change takes neither and 
adds a custom header instead.
   Is a `commitIgnored` header with the update log state the right way to tell 
a client that a commit was skipped?
   
   ## Limits
   
   **Cloud behavior is not covered. The test runs on a standalone core.**
   
   - SolrCloud: the path from a leader to a replica is not traced, and no cloud 
test is added. This draft makes no claim about what a SolrCloud client sees 
when a replica skips a commit. I can open a follow-up for the cloud case on 
request.
   - Docs: the header is described here. The diff adds no client reference text.
   - Autocommit overlap: SOLR-5941 routes autocommits through this same skip 
path. An autocommit has no client response, so the header would go nowhere 
there. This branch does not address that overlap.
   
   Changelog: `changelog/unreleased/SOLR-14262-commit-ignored-header.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