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
Conversation
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.
instance = creator.get(); | ||
System.out.println("------------ " + instance.getClass()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Leftover?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was faster :)
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); |
There was a problem hiding this comment.
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.
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) { | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: remove?
I like it too, and agree with @bleskes suggestion. |
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.