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-2634 Implement cross-site replication based on IRAC #8244
Conversation
19ba38c
to
70e1955
Compare
I would really like to see a server integration test |
70e1955
to
6115acb
Compare
@tristantarrant added! |
fd84748
to
c51b544
Compare
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 have gotten through just about half, but I figured I should submit before looking again tomorrow.
core/src/main/java/org/infinispan/container/versioning/irac/DefaultIracVersionGenerator.java
Outdated
Show resolved
Hide resolved
|
||
Merger merger = Merger.NONE; | ||
for (VersionCompare v : vectorClock.values()) { | ||
merger = merger.accept(v); |
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.
Maybe we should short circuit if we ever get back CONFLICT?
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.
no need. the usual use case is 2 sites and the first compare never generates a conflict.
core/src/main/java/org/infinispan/container/versioning/irac/IracVersionGenerator.java
Outdated
Show resolved
Hide resolved
core/src/main/java/org/infinispan/container/versioning/irac/NoOpIracVersionGenerator.java
Show resolved
Hide resolved
@@ -300,6 +319,22 @@ private AsyncInterceptorChain buildInterceptorChain() { | |||
//Nothing... | |||
} | |||
|
|||
if (cacheMode.isClustered()) { |
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.
if (cacheMode.isClustered()) { | |
if (Configurations.isIracEnabled() && cacheMode.isClustered()) { |
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.
Can't do that.
Unfortunately, a cache without IRAC enabled can still receive IRAC updates from the remote site and the *IracRemoteInterceptor
needs to handle them to discard duplicated or out-of-order updates.
core/src/main/java/org/infinispan/container/versioning/irac/DefaultIracVersionGenerator.java
Outdated
Show resolved
Hide resolved
core/src/main/java/org/infinispan/interceptors/impl/NonTxIracLocalSiteInterceptor.java
Outdated
Show resolved
Hide resolved
core/src/main/java/org/infinispan/interceptors/xsite/NonTransactionalBackupInterceptor.java
Show resolved
Hide resolved
core/src/main/java/org/infinispan/metadata/impl/IracMetadata.java
Outdated
Show resolved
Hide resolved
core/src/main/java/org/infinispan/metadata/impl/IracMetadata.java
Outdated
Show resolved
Hide resolved
core/src/main/java/org/infinispan/commands/irac/IracStateResponseCommand.java
Outdated
Show resolved
Hide resolved
core/src/main/java/org/infinispan/commands/irac/IracUpdateKeyCommand.java
Outdated
Show resolved
Hide resolved
public CompletionStage<?> invokeAsync(ComponentRegistry registry) { | ||
//noinspection unchecked | ||
Cache<Object, Object> cache = registry.getCache().running(); | ||
//TODO! create a component for BackupReceiver |
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.
Is this going into this PR?
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.
definitely no.
I'm still not sure if I'll create a new component or just merge the code in PerCacheInboundInvocationHandler
In any case, I'll not add more complexity to this PR.
core/src/test/java/org/infinispan/xsite/irac/persistence/BaseIracPersistenceTest.java
Show resolved
Hide resolved
core/src/test/java/org/infinispan/xsite/irac/persistence/BaseIracPersistenceTest.java
Outdated
Show resolved
Hide resolved
|
||
protected abstract void addPersistence(ConfigurationBuilder builder); | ||
|
||
protected abstract V wrap(String key, String 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.
The wrap
and unwrap
implementations always return the value except in the case of the IracJpaStoreTest
. We should create a default impl of:
@Override
protected String wrap(String key, String value) {
return value;
}
@Override
protected String unwrap(String value) {
return value;
}
and override it in IracJpaStoreTest
.
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.
-1
That would require to remove the type V
and use casting (and unchecked casts)
I can use org.infinispan.persistence.PersistenceCompatibilityTest.KeyValueWrapper<K,V,T>
since I did hit the same "problem" before.
core/src/test/java/org/infinispan/xsite/irac/persistence/BaseIracPersistenceTest.java
Outdated
Show resolved
Hide resolved
ce72693
to
426bf10
Compare
updated. I think I handled/replied all your comment @wburns @ryanemerson |
c78dc40
to
268dd9b
Compare
268dd9b
to
f95d303
Compare
Thanks @pruivo |
https://issues.redhat.com/browse/ISPN-2634