From 19b777a3a620a4d3b532ed4f4a306e7e15a49c2c Mon Sep 17 00:00:00 2001 From: Joshua Palis Date: Tue, 5 Sep 2023 15:23:19 +0000 Subject: [PATCH 1/4] Setting sweepShard search request against primary shard Signed-off-by: Joshua Palis --- .../java/org/opensearch/jobscheduler/sweeper/JobSweeper.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/org/opensearch/jobscheduler/sweeper/JobSweeper.java b/src/main/java/org/opensearch/jobscheduler/sweeper/JobSweeper.java index 9fdcd0fa..e2bb077c 100644 --- a/src/main/java/org/opensearch/jobscheduler/sweeper/JobSweeper.java +++ b/src/main/java/org/opensearch/jobscheduler/sweeper/JobSweeper.java @@ -389,7 +389,7 @@ private void sweepShard(ShardId shardId, ShardNodes shardNodes, String startAfte String searchAfter = startAfter == null ? "" : startAfter; while (searchAfter != null) { SearchRequest jobSearchRequest = new SearchRequest().indices(shardId.getIndexName()) - .preference("_shards:" + shardId.id() + "|_only_local") + .preference("_shards:" + shardId.id() + "|_primary") .source( new SearchSourceBuilder().version(true) .seqNoAndPrimaryTerm(true) From 01e8decd91171398735793a0ac039ef70b6e97fd Mon Sep 17 00:00:00 2001 From: Joshua Palis Date: Tue, 5 Sep 2023 22:49:18 +0000 Subject: [PATCH 2/4] testing primary first Signed-off-by: Joshua Palis --- .../java/org/opensearch/jobscheduler/sweeper/JobSweeper.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/org/opensearch/jobscheduler/sweeper/JobSweeper.java b/src/main/java/org/opensearch/jobscheduler/sweeper/JobSweeper.java index e2bb077c..8ab8a437 100644 --- a/src/main/java/org/opensearch/jobscheduler/sweeper/JobSweeper.java +++ b/src/main/java/org/opensearch/jobscheduler/sweeper/JobSweeper.java @@ -389,7 +389,7 @@ private void sweepShard(ShardId shardId, ShardNodes shardNodes, String startAfte String searchAfter = startAfter == null ? "" : startAfter; while (searchAfter != null) { SearchRequest jobSearchRequest = new SearchRequest().indices(shardId.getIndexName()) - .preference("_shards:" + shardId.id() + "|_primary") + .preference("_shards:" + shardId.id() + "|_primary_first") .source( new SearchSourceBuilder().version(true) .seqNoAndPrimaryTerm(true) From c90a52a370cc907f20ccbf18c2bfac4220c6b958 Mon Sep 17 00:00:00 2001 From: Joshua Palis Date: Tue, 5 Sep 2023 23:12:48 +0000 Subject: [PATCH 3/4] reverting back to primary Signed-off-by: Joshua Palis --- .../java/org/opensearch/jobscheduler/sweeper/JobSweeper.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/org/opensearch/jobscheduler/sweeper/JobSweeper.java b/src/main/java/org/opensearch/jobscheduler/sweeper/JobSweeper.java index 8ab8a437..e2bb077c 100644 --- a/src/main/java/org/opensearch/jobscheduler/sweeper/JobSweeper.java +++ b/src/main/java/org/opensearch/jobscheduler/sweeper/JobSweeper.java @@ -389,7 +389,7 @@ private void sweepShard(ShardId shardId, ShardNodes shardNodes, String startAfte String searchAfter = startAfter == null ? "" : startAfter; while (searchAfter != null) { SearchRequest jobSearchRequest = new SearchRequest().indices(shardId.getIndexName()) - .preference("_shards:" + shardId.id() + "|_primary_first") + .preference("_shards:" + shardId.id() + "|_primary") .source( new SearchSourceBuilder().version(true) .seqNoAndPrimaryTerm(true) From 67f3b218f9adb1f2ca5bc20e42ba4bd7cf0a32ab Mon Sep 17 00:00:00 2001 From: Joshua Palis Date: Wed, 6 Sep 2023 00:52:31 +0000 Subject: [PATCH 4/4] setting fail fast to false Signed-off-by: Joshua Palis --- .github/workflows/ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 745ce057..ddeabe35 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -10,6 +10,7 @@ on: jobs: build: strategy: + fail-fast: false matrix: os: [ubuntu-latest, windows-latest, macos-latest] java: [11, 17]