Skip to content
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
- Grant access to testclusters dir for tests ([#19085](https://github.com/opensearch-project/OpenSearch/issues/19085))
- Fix assertion error when collapsing search results with concurrent segment search enabled ([#19053](https://github.com/opensearch-project/OpenSearch/pull/19053))
- Fix skip_unavailable setting changing to default during node drop issue ([#18766](https://github.com/opensearch-project/OpenSearch/pull/18766))
- Fix pull-based ingestion pause state initialization during replica promotion ([#19212](https://github.com/opensearch-project/OpenSearch/pull/19212))

### Dependencies
- Bump `com.netflix.nebula.ospackage-base` from 12.0.0 to 12.1.0 ([#19019](https://github.com/opensearch-project/OpenSearch/pull/19019))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -191,11 +191,13 @@ public void testPauseAndResumeIngestion() throws Exception {
produceData("2", "name2", "20");
internalCluster().startClusterManagerOnlyNode();
final String nodeA = internalCluster().startDataOnlyNode();
final String nodeB = internalCluster().startDataOnlyNode();

createIndexWithDefaultSettings(1, 1);
ensureYellowAndNoInitializingShards(indexName);
waitForSearchableDocs(2, Arrays.asList(nodeA));
final String nodeB = internalCluster().startDataOnlyNode();
ensureGreen(indexName);
waitForSearchableDocs(2, Arrays.asList(nodeA, nodeB));
assertTrue(nodeA.equals(primaryNodeName(indexName)));

// pause ingestion
PauseIngestionResponse pauseResponse = pauseIngestion(indexName);
Expand All @@ -219,12 +221,13 @@ public void testPauseAndResumeIngestion() throws Exception {
client().admin().cluster().prepareReroute().add(new AllocateReplicaAllocationCommand(indexName, 0, nodeC)).get();
ensureGreen(indexName);
assertTrue(nodeC.equals(replicaNodeName(indexName)));
assertEquals(2, getSearchableDocCount(nodeB));
waitForState(() -> {
GetIngestionStateResponse ingestionState = getIngestionState(indexName);
return Arrays.stream(ingestionState.getShardStates())
.allMatch(state -> state.isPollerPaused() && state.pollerState().equalsIgnoreCase("paused"));
return ingestionState.getFailedShards() == 0
&& Arrays.stream(ingestionState.getShardStates())
.allMatch(state -> state.isPollerPaused() && state.pollerState().equalsIgnoreCase("paused"));
});
assertEquals(2, getSearchableDocCount(nodeB));

// resume ingestion
ResumeIngestionResponse resumeResponse = resumeIngestion(indexName);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,8 @@ private DefaultStreamPoller(
this.errorStrategy = errorStrategy;
this.indexName = indexSettings.getIndex().getName();

// handle initial poller states
this.paused = initialState == State.PAUSED;
}

@Override
Expand Down
Loading