Skip to content

Conversation

@fcofdez
Copy link
Contributor

@fcofdez fcofdez commented Feb 11, 2025

Closes ES-10787

@fcofdez fcofdez added >non-issue :Distributed Indexing/Engine Anything around managing Lucene and the Translog in an open shard. Team:Distributed Indexing Meta label for Distributed Indexing team v9.1.0 labels Feb 11, 2025
@fcofdez fcofdez requested review from arteam, kingherc and tlrx February 11, 2025 16:17
@elasticsearchmachine
Copy link
Collaborator

Pinging @elastic/es-distributed-indexing (Team:Distributed Indexing)

@elasticsearchmachine elasticsearchmachine added the serverless-linked Added by automation, don't add manually label Feb 11, 2025
Copy link
Contributor

@arteam arteam left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

) {
assert (task instanceof CancellableTask) == false; // TODO: add cancellation handling here once the task supports it
threadPool.executor(ThreadPool.Names.FORCE_MERGE).execute(ActionRunnable.supply(listener, () -> {
SubscribableListener.<IndexShard>newForked(l -> {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: seems to be neater to initialize indexShard and use SubscribableListener<Void> for indexShard.ensureMutable?

IndexShard indexShard = indicesService.indexServiceSafe(shardRouting.shardId().getIndex()).getShard(shardRouting.shardId().id());
SubscribableListener.<Void>newForked(l -> indexShard.ensureMutable(l))
    .<EmptyResult>andThen(l -> threadPool.executor(ThreadPool.Names.FORCE_MERGE).execute(ActionRunnable.supply(l, () -> {
        indexShard.forceMerge(request);
        return EmptyResult.INSTANCE;
    })))
    .addListener(listener);

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need to do the error handling when the index doesn't exist in the node anymore, that's why I included it in the listener.

Copy link
Contributor

@kingherc kingherc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@fcofdez fcofdez merged commit a0029cd into elastic:main Feb 12, 2025
18 checks passed
@fcofdez
Copy link
Contributor Author

fcofdez commented Feb 12, 2025

Thanks for the reviews!

Copy link
Member

@tlrx tlrx left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Late LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

:Distributed Indexing/Engine Anything around managing Lucene and the Translog in an open shard. >non-issue serverless-linked Added by automation, don't add manually Team:Distributed Indexing Meta label for Distributed Indexing team v9.1.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants