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

Beef up Translog testing with random channel exceptions #18997

Merged
merged 5 commits into from Jun 21, 2016

Conversation

s1monw
Copy link
Contributor

@s1monw s1monw commented Jun 21, 2016

Today we only throw random exceptions on the translog writer. This commit
extends it to also throw exceptions during checkpoint writing etc to test
if the correct flags are provided to open method etc.

Today we only throw random exceptions on the translog writer. This commit
extends it to also throw exceptions during checkpoint writing etc to test
if the correct flags are provided to open method etc.
@s1monw s1monw added >enhancement >test Issues or PRs that are addressing/adding tests review v5.0.0-alpha4 labels Jun 21, 2016
instance = creator.get();
System.out.println("------------ " + instance.getClass());
Copy link
Member

Choose a reason for hiding this comment

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

Leftover?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I was faster :)

@nik9000
Copy link
Member

nik9000 commented Jun 21, 2016

Makes sense to me.

@@ -200,7 +200,7 @@ public Translog(TranslogConfig config, TranslogGeneration translogGeneration) th
Files.createDirectories(location);
final long generation = 1;
Checkpoint checkpoint = new Checkpoint(0, 0, generation);
Checkpoint.write(location.resolve(CHECKPOINT_FILE_NAME), checkpoint, StandardOpenOption.WRITE, StandardOpenOption.CREATE_NEW);
Checkpoint.write(getChannelFactory()::open, location.resolve(CHECKPOINT_FILE_NAME), checkpoint, StandardOpenOption.WRITE, StandardOpenOption.CREATE_NEW);
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: we don't need the open method reference.

@bleskes
Copy link
Contributor

bleskes commented Jun 21, 2016

LGTM. Left a minor suggestion. Happy no failure came out of this.

@@ -56,6 +56,7 @@ public T get() {
*/
synchronized (InjectorImpl.class) {
if (instance == null) {

Copy link
Member

Choose a reason for hiding this comment

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

Nit: remove?

@jasontedor
Copy link
Member

I like it too, and agree with @bleskes suggestion.

@s1monw s1monw merged commit c80e837 into elastic:master Jun 21, 2016
@s1monw s1monw deleted the beef_up_translog_testing branch June 21, 2016 19:25
@clintongormley clintongormley added :Distributed/Distributed A catch all label for anything in the Distributed Area. If you aren't sure, use this one. :Distributed/Engine Anything around managing Lucene and the Translog in an open shard. and removed :Translog :Distributed/Distributed A catch all label for anything in the Distributed Area. If you aren't sure, use this one. labels Feb 13, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
:Distributed/Engine Anything around managing Lucene and the Translog in an open shard. >enhancement >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.

None yet

5 participants