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-9812 Streaming Cluster Publisher #7523
ISPN-9812 Streaming Cluster Publisher #7523
Conversation
I still have to organize some of the classes and add more docs for the internal classes. This is still in Preview as only core tests should be pretty much passing. |
There is a random failure that I can't seem to isolate or get a trace from that I have been still trying to track down. It seems to only happen when running without trace and always seems to fail two different tests. So I am not sure if it is related to running those in parallel somehow. |
I have not deleted the old distributed stream classes, but that will be the next PR and it should remove needless to say a lot of lines of code (more than was added for this I believe). |
d8c281c
to
9cd4444
Compare
I was able to squash the remaining intermittent failure I could find. Was caused by the async closure of a publisher was too slow and a failover could request again with the same id. Now it properly overwrites an old state if it is present and complete (not completed still throws exception). |
Looks like I need to tweak some query stuff to no longer return a null value :) |
a8dd157
to
5bdccf9
Compare
Query should hopefully be fixed now too :) |
CI is looking pretty good - it appears my segment completion isn't quite on par yet though |
CI appears to be passing just fine now. Just have to add Javadoc and maybe reorg classes slightly. |
011b1ac
to
47750bc
Compare
Testing with https://github.com/infinispan/infinispan-benchmarks/tree/master/iteration I have anywhere from 13-33% increase in throughput when rehash is disabled. When rehash is not disabled the increase is anywhere from 38-141% in throughput. |
Averaging the various runs non rehash had a performance increase of 20.7% and rehash had an increase of 76.4%. https://docs.google.com/spreadsheets/d/1p3rArTx-lIZ66vALMcuXjxeCW7ivxfCqeYCfluwzQyw/edit?usp=sharing |
Some recent changes have introduced a failure, probably a typo. Fixing. |
core/src/main/java/org/infinispan/reactive/publisher/impl/PublisherHandler.java
Outdated
Show resolved
Hide resolved
core/src/main/java/org/infinispan/cache/impl/EncodingFunction.java
Outdated
Show resolved
Hide resolved
core/src/main/java/org/infinispan/reactive/publisher/impl/ClusterPublisherManagerImpl.java
Outdated
Show resolved
Hide resolved
} | ||
segments.forEach(completedSegmentConsumer); | ||
}) | ||
); |
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.
Should we also handle doOnError
?
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.
What were you thinking would go in there? We don't want to complete the segments. The error would be propagated to the caller, so the entire Subscription would be cancelled anyways.
core/src/main/java/org/infinispan/reactive/publisher/impl/MaybeValueRetainedFunction.java
Outdated
Show resolved
Hide resolved
core/src/main/java/org/infinispan/reactive/publisher/impl/LocalPublisherManagerImpl.java
Outdated
Show resolved
Hide resolved
core/src/main/java/org/infinispan/reactive/publisher/impl/LocalPublisherManagerImpl.java
Outdated
Show resolved
Hide resolved
core/src/main/java/org/infinispan/reactive/publisher/impl/ClusterPublisherManagerImpl.java
Show resolved
Hide resolved
core/src/main/java/org/infinispan/reactive/publisher/impl/ClusterPublisherManagerImpl.java
Show resolved
Hide resolved
core/src/main/java/org/infinispan/reactive/publisher/impl/PublisherHandler.java
Outdated
Show resolved
Hide resolved
core/src/main/java/org/infinispan/reactive/publisher/impl/commands/batch/PublisherResponse.java
Outdated
Show resolved
Hide resolved
...ava/org/infinispan/reactive/publisher/impl/commands/batch/PublisherResponseExternalizer.java
Show resolved
Hide resolved
Okay |
Key tracking map/flatMap is better optimized now as it doesn't have to eagerly retrieve the values into a list, which is especially costly for map as it is always 1:1 or 1:0. |
Addressed all the current comments as well as fixed another bug with flatMap if there was a large number of entries generated from it. |
* can be useful for some optimizations that may need to track produced values from the original. | ||
* @return if the values in the publisher are unchanged | ||
*/ | ||
boolean isModified(); |
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 needs updating to say that is should return true when the function does change the value.
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.
Sure, let me make sure this correct again.
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.
Should be fixed now.
log.tracef("Completing last segments of: %s", completedSegments); | ||
listener.accept(completedSegments::iterator); | ||
completedSegments.clear(); | ||
} | ||
} | ||
|
||
private class RehashIterator<S> extends AbstractIterator<S> implements CloseableIterator<S> { |
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.
It seems we can now remove this and CompletionListenerRehashIterator
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.
Yup that will be handled in https://issues.jboss.org/browse/ISPN-10895. I didn't want to bloat this PR too much.
1f7833e
to
3325a83
Compare
Rebased and squashed to 1 commit. |
3325a83
to
17a8913
Compare
17a8913
to
d36e2ac
Compare
CI found a small gap in partition handling between when a publisher is created and when it is subscribed to. Recheck the partition status after registering with listener to remove gap. I am not sure what those PooledConnectionOperation failures are, but I can't seem to reproduce and it seems like a setup issue more likely as everyone failed consistently. |
It looks like I fixed flatMap when rehash is enabled, but non rehash flatMap is still broken :( I need to actually fix this at the LocalPublisherManager level, which will in turn make the PublisherHandler code simpler. |
Non rehash flatMap should work properly now. I just piggy back off the rehash version, but don't return the keys to keep the response size smaller. This can be optimized later though. |
31bddb8
to
9c96504
Compare
Got a chance to think about it and the flatMap with non rehash is now properly optimized. In fact the LocalPublisherManager now should always properly return the segment completed or lost after all values as it was originally envisioned. Unfortunately, KeyPublisherState can't utilize this as it has to track by the original key to a segment, not just the values - so that will have to stay the same. |
@wburns The transformer changes have broken |
I messed up something with the predicate. I ran a bunch of of the tests,
but if course missed that one last night as I went to bed
…On Fri, Nov 15, 2019, 6:42 AM Ryan Emerson ***@***.***> wrote:
@wburns <https://github.com/wburns> The transformer changes have broken
SimpleClusterPublisherManagerTest.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#7523?email_source=notifications&email_token=AAE6H33WUSCSLDX6DD5EKLTQT2DK3A5CNFSM4JHDHD3KYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEEFGFDY#issuecomment-554328719>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAE6H35GEDO3SJJ52LCGETTQT2DK3ANCNFSM4JHDHD3A>
.
|
Context should be only applied once now. |
9d269fa
to
059f174
Compare
059f174
to
791c64f
Compare
Great stuff @wburns, thanks! |
https://issues.jboss.org/browse/ISPN-9812