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
ISPN-14192 Do not send empty batches with IRAC #10367
Conversation
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.
LGTM
commons/all/src/main/java/org/infinispan/commons/util/ConcurrentSmallIntSet.java
Outdated
Show resolved
Hide resolved
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.
LGTM, just some minor things
@@ -178,7 +178,8 @@ public static IntSet mutableSet(int value1, int value2) { | |||
* @return concurrent set | |||
*/ | |||
public static IntSet concurrentSet(int maxExclusive) { | |||
return new ConcurrentSmallIntSet(maxExclusive); | |||
// if maxExclusive = 0; then we have an empty set | |||
return maxExclusive < 1 ? immutableEmptySet() : new ConcurrentSmallIntSet(maxExclusive); |
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 would personally say only return immutable empty set when maxExclusive == 0. That way we will get the new exception you added above if it is negative.
@@ -189,6 +190,10 @@ public static IntSet concurrentSet(int maxExclusive) { | |||
* @return concurrent copy | |||
*/ | |||
public static IntSet concurrentCopyFrom(IntSet intSet, int maxExclusive) { | |||
// if maxExclusive = 0; then we have an empty set | |||
if (maxExclusive < 1) { |
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 would personally say only return immutable empty set when maxExclusive == 0. That way we will get the new exception you added above if it is negative.
} | ||
onUnexpectedThrowable(throwable); | ||
return Completable.complete(); |
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.
This slightly changes how exception handling operates. With the new changes if there is a Throwable, we now have to wait for the registered remote site backup commands to complete. Do we want that? It is probably a very small chance of this happening, but just wanted to make sure.
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.
Do you mean the invalidState
list being cleaned up now and not before?
There is no reason to keep the invalid state around more time than necessary to be cleaned up in the "next round".
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.
Not quite, If you have more than one backup if the second errors, we would have to wait until the first completes as rspCollector would have a stage dependency.
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 see. I'm setting rspCollector = null;
to avoid waiting although, I think, this code will never be executed.
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.
Oh, yes I missed that sorry. So we are good.
* Includes change to ConcurrentSmallIntSet preventing wrong constructor argument
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.
LGTM
https://issues.redhat.com/browse/ISPN-14192