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

Introduce Replication unit tests using real shards #18930

Merged
merged 2 commits into from
Jun 18, 2016

Conversation

bleskes
Copy link
Contributor

@bleskes bleskes commented Jun 16, 2016

This commit introduce unit testing infrastructure to test replication operations using real index shards. This is infra is complementary to the full integration tests and unit testing of ReplicationOperation we already have. The new ESIndexLevelReplicationTestCase base makes it easier to test and simulate failure mode that require real shards and but do not need the full blow stack of a complete node.

The commit also add a simple "nothing is wrong" test plus a test that checks we don't drop docs during the various stages of recovery.

For now, only single doc indexing is supported but this can be easily extended in the future.

This is still rough around the edges but I think it's in good enough shape to get feedback. @s1monw @ywelsch @jasontedor your input is welcome

This commit introduce unit testing infrastructure to test replication operations using real index shards. This is infra is complimentary to the full integration tests and unit testing of ReplicationOperation  we already have. The new ESIndexLevelReplicationTestCase base makes it easier to test and simulate failure mode that require real shards and but do not need the full blow stack of a complete node.

 The commit also add a simple "nothing is wrong" test plus a test that checks we don't drop docs during the various stages of recovery.

 For now, only single doc indexing is supported but this can be easily extended in the future.
@bleskes bleskes added >enhancement >non-issue >test Issues or PRs that are addressing/adding tests v5.0.0-alpha4 labels Jun 16, 2016
boolean executeOnReplicas, boolean checkWriteConsistency,
Replicas<ReplicaRequest> replicas,
Supplier<ClusterState> clusterStateSupplier, ESLogger logger, String opType) {
public ReplicationOperation(Request request, Primary<Request, ReplicaRequest, PrimaryResultT> primary,
Copy link
Contributor

Choose a reason for hiding this comment

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

instead of making it public maybe we move this entire package into core/src/test/java/org/elasticsearch/index/replication/ or even move everything into core/src/test/java/org/elasticsearch/index/

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 could, problem is that ReplicationOperation is currently part of the universe of actions and is also used by TransportReplicationAction (which is subclassed by TransportIndexAction, for example) - so moving it will cause problems with those actions. IMO it's not a big deal to make this public?

Copy link
Contributor

Choose a reason for hiding this comment

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

sure - I just think we can move all of them in one package :)

@s1monw
Copy link
Contributor

s1monw commented Jun 17, 2016

I left a bunch of comments, but hey lets push this it's really such an improvement over what we have, we should not wait! LGTM

@bleskes
Copy link
Contributor Author

bleskes commented Jun 17, 2016

@s1monw I pushed another commit

@s1monw
Copy link
Contributor

s1monw commented Jun 18, 2016

looks good - get it in!

@bleskes bleskes changed the title [WIP] Introduce Replication unit tests using real shards Introduce Replication unit tests using real shards Jun 18, 2016
@bleskes bleskes merged commit 14cd8a6 into elastic:master Jun 18, 2016
@bleskes bleskes deleted the index_replication_test branch June 18, 2016 16:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
>test Issues or PRs that are addressing/adding tests v5.0.0-alpha4
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants