Skip to content

Commit

Permalink
Setting JobSweeper search preference against primary shard (#483)
Browse files Browse the repository at this point in the history
* Setting sweepShard search request against primary shard

Signed-off-by: Joshua Palis <[email protected]>

* testing primary first

Signed-off-by: Joshua Palis <[email protected]>

* reverting back to primary

Signed-off-by: Joshua Palis <[email protected]>

* setting fail fast to false

Signed-off-by: Joshua Palis <[email protected]>

---------

Signed-off-by: Joshua Palis <[email protected]>
  • Loading branch information
joshpalis authored Sep 6, 2023
1 parent 886fa11 commit c1e2569
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ on:
jobs:
build:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
java: [11, 17]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit c1e2569

Please sign in to comment.