* Fixing handling of auto slices in bulk scroll requests * adjusting assertions for tests
This commit is contained in:
parent
1ddc4c8fc6
commit
0a95b8c24d
|
@ -112,7 +112,7 @@ class BulkByScrollParallelizationHelper {
|
||||||
(sum, term) -> sum + term
|
(sum, term) -> sum + term
|
||||||
));
|
));
|
||||||
Set<Integer> counts = new HashSet<>(countsByIndex.values());
|
Set<Integer> counts = new HashSet<>(countsByIndex.values());
|
||||||
int leastShards = Collections.min(counts);
|
int leastShards = counts.isEmpty() ? 1 : Collections.min(counts);
|
||||||
return Math.min(leastShards, AUTO_SLICE_CEILING);
|
return Math.min(leastShards, AUTO_SLICE_CEILING);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -306,4 +306,13 @@ public class DeleteByQueryBasicTests extends ReindexTestCase {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void testMissingSources() {
|
||||||
|
BulkByScrollResponse response = updateByQuery()
|
||||||
|
.source("missing-index-*")
|
||||||
|
.refresh(true)
|
||||||
|
.setSlices(AbstractBulkByScrollRequest.AUTO_SLICES)
|
||||||
|
.get();
|
||||||
|
assertThat(response, matcher().deleted(0).slices(hasSize(0)));
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -157,5 +157,13 @@ public class ReindexBasicTests extends ReindexTestCase {
|
||||||
assertHitCount(client().prepareSearch("dest").setSize(0).get(), allDocs.size());
|
assertHitCount(client().prepareSearch("dest").setSize(0).get(), allDocs.size());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void testMissingSources() {
|
||||||
|
BulkByScrollResponse response = updateByQuery()
|
||||||
|
.source("missing-index-*")
|
||||||
|
.refresh(true)
|
||||||
|
.setSlices(AbstractBulkByScrollRequest.AUTO_SLICES)
|
||||||
|
.get();
|
||||||
|
assertThat(response, matcher().created(0).slices(hasSize(0)));
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -160,4 +160,13 @@ public class UpdateByQueryBasicTests extends ReindexTestCase {
|
||||||
assertEquals(2, client().prepareGet(index, "test", Integer.toString(randomDoc)).get().getVersion());
|
assertEquals(2, client().prepareGet(index, "test", Integer.toString(randomDoc)).get().getVersion());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void testMissingSources() {
|
||||||
|
BulkByScrollResponse response = updateByQuery()
|
||||||
|
.source("missing-index-*")
|
||||||
|
.refresh(true)
|
||||||
|
.setSlices(AbstractBulkByScrollRequest.AUTO_SLICES)
|
||||||
|
.get();
|
||||||
|
assertThat(response, matcher().updated(0).slices(hasSize(0)));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue