Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make PrimaryReplicaResyncer Fork to Generic Pool #69949

Merged

Conversation

original-brownbear
Copy link
Member

Reading ops from the translog snapshot must not run on the transport thread.
When sending more than one batch of ops the listener (and thus run) would be
invoked on the transport thread for all but the first batch of ops.
=> Forking to the generic pool like we do for sending ops during recovery.

Reading ops from the translog snapshot must not run on the transport thread.
When sending more than one batch of ops the listener (and thus `run`) would be
invoked on the transport thread for all but the first batch of ops.
=> Forking to the generic pool like we do for sending ops during recovery.
@original-brownbear original-brownbear added >bug :Distributed Indexing/CRUD A catch all label for issues around indexing, updating and getting a doc by id. Not search. v8.0.0 v7.12.0 v7.13.0 labels Mar 4, 2021
@elasticmachine elasticmachine added the Team:Distributed (Obsolete) Meta label for distributed team (obsolete). Replaced by Distributed Indexing/Coordination. label Mar 4, 2021
@elasticmachine
Copy link
Collaborator

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

Copy link
Contributor

@DaveCTurner DaveCTurner left a comment

Choose a reason for hiding this comment

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

Thanks Armin, one question about cleanup

@@ -159,7 +160,8 @@ protected DiscoveryNode getDiscoveryNode(String id) {
private volatile ReplicationTargets replicationTargets;

private final PrimaryReplicaSyncer primaryReplicaSyncer = new PrimaryReplicaSyncer(
new TaskManager(Settings.EMPTY, threadPool, Collections.emptySet()),
new MockTransport().createTransportService(Settings.EMPTY, threadPool,
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we need to shut this (at least the threadpool) down cleanly?

Copy link
Member Author

Choose a reason for hiding this comment

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

It's just using the fake transport so I don;t think the service needs any shutting down here. The threadPool is torn down via the parent IndexShardTestCase -> I think we're good?

Copy link
Contributor

Choose a reason for hiding this comment

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

Oh right we already had a threadpool we're just using the transport service as a wrapper. Nvm.

Copy link
Contributor

@DaveCTurner DaveCTurner left a comment

Choose a reason for hiding this comment

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

LGTM

@@ -159,7 +160,8 @@ protected DiscoveryNode getDiscoveryNode(String id) {
private volatile ReplicationTargets replicationTargets;

private final PrimaryReplicaSyncer primaryReplicaSyncer = new PrimaryReplicaSyncer(
new TaskManager(Settings.EMPTY, threadPool, Collections.emptySet()),
new MockTransport().createTransportService(Settings.EMPTY, threadPool,
Copy link
Contributor

Choose a reason for hiding this comment

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

Oh right we already had a threadpool we're just using the transport service as a wrapper. Nvm.

@original-brownbear
Copy link
Member Author

Thanks David!

@original-brownbear original-brownbear merged commit e622b2c into elastic:master Mar 4, 2021
@original-brownbear original-brownbear deleted the repro-resyc-troubles branch March 4, 2021 08:51
original-brownbear added a commit to original-brownbear/elasticsearch that referenced this pull request Mar 4, 2021
Reading ops from the translog snapshot must not run on the transport thread.
When sending more than one batch of ops the listener (and thus `run`) would be
invoked on the transport thread for all but the first batch of ops.
=> Forking to the generic pool like we do for sending ops during recovery.
original-brownbear added a commit to original-brownbear/elasticsearch that referenced this pull request Mar 4, 2021
Reading ops from the translog snapshot must not run on the transport thread.
When sending more than one batch of ops the listener (and thus `run`) would be
invoked on the transport thread for all but the first batch of ops.
=> Forking to the generic pool like we do for sending ops during recovery.
original-brownbear added a commit that referenced this pull request Mar 4, 2021
Reading ops from the translog snapshot must not run on the transport thread.
When sending more than one batch of ops the listener (and thus `run`) would be
invoked on the transport thread for all but the first batch of ops.
=> Forking to the generic pool like we do for sending ops during recovery.
original-brownbear added a commit that referenced this pull request Mar 4, 2021
Reading ops from the translog snapshot must not run on the transport thread.
When sending more than one batch of ops the listener (and thus `run`) would be
invoked on the transport thread for all but the first batch of ops.
=> Forking to the generic pool like we do for sending ops during recovery.
DaveCTurner added a commit to DaveCTurner/elasticsearch that referenced this pull request Mar 17, 2021
We assert that the snapshot isn't closed on a transport thread, but we
close it without forking off the transport thread in case of a failure.
With this commit we fork on failure too.

Relates elastic#69949
Closes elastic#70407
DaveCTurner added a commit that referenced this pull request Mar 17, 2021
We assert that the snapshot isn't closed on a transport thread, but we
close it without forking off the transport thread in case of a failure.
With this commit we fork on failure too.

Relates #69949
Closes #70407
DaveCTurner added a commit that referenced this pull request Mar 17, 2021
We assert that the snapshot isn't closed on a transport thread, but we
close it without forking off the transport thread in case of a failure.
With this commit we fork on failure too.

Relates #69949
Closes #70407
DaveCTurner added a commit that referenced this pull request Mar 17, 2021
We assert that the snapshot isn't closed on a transport thread, but we
close it without forking off the transport thread in case of a failure.
With this commit we fork on failure too.

Relates #69949
Closes #70407
original-brownbear added a commit to original-brownbear/elasticsearch that referenced this pull request Mar 30, 2021
We can have a race here where the closed check passes and then we concurrently to
a shard close try to fail the shard also. Previously this was covered by the catch below
the changed code that would just ignore the already-closed exception but with elastic#69949 we're
now forking to the generic pool for this logic and thus have to handle the exception in the
callback as well.
original-brownbear added a commit that referenced this pull request Mar 31, 2021
We can have a race here where the closed check passes and then we concurrently to
a shard close try to fail the shard also. Previously this was covered by the catch below
the changed code that would just ignore the already-closed exception but with #69949 we're
now forking to the generic pool for this logic and thus have to handle the exception in the
callback as well.
original-brownbear added a commit to original-brownbear/elasticsearch that referenced this pull request Mar 31, 2021
We can have a race here where the closed check passes and then we concurrently to
a shard close try to fail the shard also. Previously this was covered by the catch below
the changed code that would just ignore the already-closed exception but with elastic#69949 we're
now forking to the generic pool for this logic and thus have to handle the exception in the
callback as well.
original-brownbear added a commit to original-brownbear/elasticsearch that referenced this pull request Mar 31, 2021
We can have a race here where the closed check passes and then we concurrently to
a shard close try to fail the shard also. Previously this was covered by the catch below
the changed code that would just ignore the already-closed exception but with elastic#69949 we're
now forking to the generic pool for this logic and thus have to handle the exception in the
callback as well.
original-brownbear added a commit that referenced this pull request Mar 31, 2021
We can have a race here where the closed check passes and then we concurrently to
a shard close try to fail the shard also. Previously this was covered by the catch below
the changed code that would just ignore the already-closed exception but with #69949 we're
now forking to the generic pool for this logic and thus have to handle the exception in the
callback as well.
original-brownbear added a commit that referenced this pull request Mar 31, 2021
We can have a race here where the closed check passes and then we concurrently to
a shard close try to fail the shard also. Previously this was covered by the catch below
the changed code that would just ignore the already-closed exception but with #69949 we're
now forking to the generic pool for this logic and thus have to handle the exception in the
callback as well.
@original-brownbear original-brownbear restored the repro-resyc-troubles branch April 18, 2023 21:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
>bug :Distributed Indexing/CRUD A catch all label for issues around indexing, updating and getting a doc by id. Not search. Team:Distributed (Obsolete) Meta label for distributed team (obsolete). Replaced by Distributed Indexing/Coordination. v7.12.0 v7.13.0 v8.0.0-alpha1
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants