Skip to content

Commit

Permalink
fix: Tasklist archiver is creating too many scrolls
Browse files Browse the repository at this point in the history
  • Loading branch information
houssain-barouni committed Jan 7, 2025
1 parent 49ce6c4 commit eda71aa
Showing 1 changed file with 2 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
*/
package io.camunda.tasklist.archiver.os;

import static io.camunda.tasklist.util.OpenSearchUtil.SCROLL_KEEP_ALIVE_MS;
import static org.springframework.beans.factory.config.BeanDefinition.SCOPE_PROTOTYPE;

import io.camunda.tasklist.Metrics;
Expand All @@ -30,7 +29,6 @@
import org.opensearch.client.opensearch.OpenSearchAsyncClient;
import org.opensearch.client.opensearch._types.FieldValue;
import org.opensearch.client.opensearch._types.SortOrder;
import org.opensearch.client.opensearch._types.Time;
import org.opensearch.client.opensearch._types.query_dsl.Query;
import org.opensearch.client.opensearch.core.SearchRequest;
import org.opensearch.client.opensearch.core.SearchResponse;
Expand Down Expand Up @@ -76,7 +74,8 @@ public ProcessInstanceArchiverJobOpenSearch(final List<Integer> partitionIds) {
}

@Override
public CompletableFuture<Map.Entry<String, Integer>> archiveBatch(ArchiveBatch archiveBatch) {
public CompletableFuture<Map.Entry<String, Integer>> archiveBatch(
final ArchiveBatch archiveBatch) {
final CompletableFuture<Map.Entry<String, Integer>> archiveBatchFuture;
if (archiveBatch != null) {
LOGGER.debug("Following batch operations are found for archiving: {}", archiveBatch);
Expand Down Expand Up @@ -187,7 +186,6 @@ private SearchRequest createFinishedProcessInstanceSearchRequest() {
.size(tasklistProperties.getArchiver().getRolloverBatchSize())
.sort(s -> s.field(f -> f.field(ProcessInstanceIndex.END_DATE).order(SortOrder.Asc)))
.requestCache(false)
.scroll(Time.of(t -> t.time(SCROLL_KEEP_ALIVE_MS)))
.build();

LOGGER.debug("Query finished process instances for archiving request: \n{}", q.toString());
Expand Down

0 comments on commit eda71aa

Please sign in to comment.