Terracotta-OSS / terracotta-apis

Apache License 2.0
6 stars 25 forks source link

InvocationBuilder.replicate is not honoured #139

Closed AbfrmBlr closed 8 years ago

AbfrmBlr commented 8 years ago

public InvocationBuilder<M, R> replicate(boolean requiresReplication); method is not honoured, The messages marked as replicate = false are also getting replicated to passive entity.

jd0-sag commented 8 years ago

We need to decide if we should still have this method in the API since the replication needs to happen, either way, so that the passive can maintain the global message order. The only thing we could do, in this case, is decide not to run it on the passive. It isn't clear if that special case is really worth keeping. If we believe that it is, then just avoiding the invocation is the way to proceed (immediately sending the acks to the active - potentially just ensuring that the acks are sent when it would have been invoked).

chrisdennis commented 8 years ago

Even if we discount the fact that Ehcache has mutative messages that are irrelevant to the passive (because of the way passive replication works) this still is a useful feature because of "read-only" messages. Seems bizarre that the passive entity has to have a code block that says:

if (message.isReadOnly()) {
  return;
}
jd0-sag commented 8 years ago

Yeah, the plan is to honor this. While we were originally hoping that we could use it as an optimization opportunity on the wire, but then realized we couldn't, we can still use it to avoid the logical invocation of these messages, on the passive (since the notion of a read-only message is probably incredibly common).

myronkscott commented 8 years ago

Back to the original issue filed, are you seeing this with passthrough or the real server implementation or both?

AbfrmBlr commented 8 years ago

The issue I see is in real server. terracottaPlatformVersion = '5.0.3.beta2'. terracottaApisVersion = '1.0.3.beta' terracottaCoreVersion = '5.0.3-beta' galvanVersion = '1.0.3-beta2'

AbfrmBlr commented 8 years ago

https://github.com/AbfrmBlr/ehcache3/blob/issue-1208/clustered/integration-test/src/test/java/org/ehcache/clustered/BasicLifeCyclePassiveReplicationTest.java

myronkscott commented 8 years ago

Improve documentation to reflect default behavior

AbfrmBlr commented 8 years ago

For the default behavior, passthrough doesnot fails to replicate. endpoint.beginInvoke().message(message).invoke(); does not replicate for passthrough. It works if the call is made in following way - endpoint.beginInvoke().message(message).replicate(true).invoke();

jd0-sag commented 8 years ago

If this is purely a passthrough bug and no other API/doc changes are required, it should be tracked there: https://github.com/Terracotta-OSS/tc-passthrough-testing