kalayciburak opened a new pull request, #11720:
URL: https://github.com/apache/nifi/pull/11720

   <!-- Licensed to the Apache Software Foundation (ASF) under one or more -->
   <!-- contributor license agreements.  See the NOTICE file distributed with 
-->
   <!-- this work for additional information regarding copyright ownership. -->
   <!-- The ASF licenses this file to You under the Apache License, Version 2.0 
-->
   <!-- (the "License"); you may not use this file except in compliance with -->
   <!-- the License.  You may obtain a copy of the License at -->
   <!--     http://www.apache.org/licenses/LICENSE-2.0 -->
   <!-- Unless required by applicable law or agreed to in writing, software -->
   <!-- distributed under the License is distributed on an "AS IS" BASIS, -->
   <!-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 
implied. -->
   <!-- See the License for the specific language governing permissions and -->
   <!-- limitations under the License. -->
   
   # Summary
   
   [NIFI-16330](https://issues.apache.org/jira/browse/NIFI-16330)
   
   SearchElasticsearch is `@PrimaryNodeOnly` but stored its pagination cursor 
in local state. When the primary node changes, that cursor is gone and the 
query starts again from the first page. ConsumeElasticsearch already keeps the 
same cursor in cluster scope. This change uses cluster scope for 
SearchElasticsearch as well, and records the cursor so a new primary continues 
the search.
   
   An in-progress local cursor from a previous version is not copied. The first 
run after upgrade starts a new query, then later primary changes keep the 
cluster cursor.
   
   # Tracking
   
   ### Issue Tracking
   
   - [x] [Apache NiFi Jira](https://issues.apache.org/jira/browse/NIFI-16330) 
issue created
   
   ### Pull Request Tracking
   
   - [x] Pull Request title starts with Apache NiFi Jira issue number, such as 
`NIFI-00000`
   - [x] Pull Request commit message starts with Apache NiFi Jira issue number, 
as such `NIFI-00000`
   - [ ] Pull request contains commits signed with a registered key indicating 
`Verified` status
   
   ### Pull Request Formatting
   
   - [x] Pull Request based on current revision of the `main` branch
   - [x] Pull Request refers to a feature branch with one commit containing 
changes
   
   # Verification
   
   ### Build
   
   - [x] JDK 21 focused module tests
   - [ ] Build completed using `./mvnw clean install -P contrib-check`
   - [ ] JDK 25
   
   JDK 21:
   
   `./mvnw -pl 
nifi-extension-bundles/nifi-elasticsearch-bundle/nifi-elasticsearch-restapi-processors
 -am -Dtest=SearchElasticsearchTest,ConsumeElasticsearchTest 
-Dsurefire.failIfNoSpecifiedTests=false test`
   
   - SearchElasticsearchTest: 53 run, 0 failed
   - ConsumeElasticsearchTest: 74 run, 0 failed, 1 skipped
   - `checkstyle:check` on the same module: 0
   
   Before the fix, `testPaginationContinuesOnNewPrimaryFromClusterState` failed 
because the cursor was not in cluster state (`page.number` stayed `1` after 
local state was dropped).
   
   ### Licensing
   
   - [x] No new dependencies
   
   ### Documentation
   
   - [x] additionalDetails now says cluster state, matching ConsumeElasticsearch


-- 
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]

Reply via email to