Skip to content
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-7847 Deprecate DeltaAware #5187

Merged
merged 2 commits into from Jun 29, 2017
Merged

ISPN-7847 Deprecate DeltaAware #5187

merged 2 commits into from Jun 29, 2017

Conversation

rvansa
Copy link
Member

@rvansa rvansa commented Jun 8, 2017

  • DeltaAware, CopyableDeltaAware, Delta, DeltaCompositeKey deprecated
  • AdvancedCache.applyDelta deprecated, CacheImpl.applyDelta reimplemented using ReadWriteKeyValueCommand, permits to lock only on the main key
  • ApplyDeltaCommand and Visitor.visitApplyDeltaCommand deprecated (implementation removed)
  • DeltaAwareCacheEntry, DeltaAwareObjectOutput and some internal helpers removed

@rvansa rvansa requested a review from danberindei June 8, 2017 15:14
@rvansa rvansa added this to the 9.1.0.Final milestone Jun 8, 2017
@rvansa rvansa requested a review from wburns June 8, 2017 15:14
@tristantarrant
Copy link
Member

3 related failures

@rvansa
Copy link
Member Author

rvansa commented Jun 9, 2017

I've removed the three failing tests; these are no longer applicable because Flag.DELTA_AWARE is no longer used, and does not make the put requiring previous value on backup owner.
Also adding back the Wait CI Results label - we need to ran whole testsuite (not just core) to check potential problems in tree cache or lucene directory.

@galderz
Copy link
Member

galderz commented Jun 15, 2017

Last build din't work, but there was a build from 2 days back that run fine. Do you want to wait for another CI run?

@rvansa
Copy link
Member Author

rvansa commented Jun 15, 2017

@galderz Not really, but I see there is a conflict now :-/

@rvansa
Copy link
Member Author

rvansa commented Jun 16, 2017

@galderz Rebased.

Copy link
Member

@pruivo pruivo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just one small bug found :)
it looks good to me. It is good to see some code removed :) Nice job

DataWriteCommand command;
if (value instanceof Delta) {
command = createApplyDelta(key, (Delta) value, explicitFlags, ctx);
} if (value instanceof DeltaAware && (explicitFlags & FlagBitSets.CACHE_MODE_LOCAL) == 0) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

bug: else is missing

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

well spotted! :)

deltaAware = ((CopyableDeltaAware) value).copy();
} else if (value instanceof DeltaAware) {
try {
byte[] bytes = marshaller.objectToByteBuffer(value);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice :)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@rvansa Could it use MergeOnStore instead? Not that I think MergeOnStore is a good idea, but it seems quite close to the semantics of non-copyable DeltaAware.

@@ -272,7 +267,7 @@ private Object handleSecondPhaseCommand(TxInvocationContext ctx, TransactionBoun
LocalTransaction localTx = (LocalTransaction) ctx.getCacheTransaction();
LocalizedCacheTopology cacheTopology = dm.getCacheTopology();
Collection<Address> affectedNodes =
isReplicated ? null : cacheTopology.getWriteOwners(getAffectedKeysFromContext(ctx));
isReplicated ? null : cacheTopology.getWriteOwners((Collection<Object>) ctx.getAffectedKeys());
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you don't need the cast

@rvansa
Copy link
Member Author

rvansa commented Jun 19, 2017

@pruivo Thanks, rebased & fixed.

@rvansa
Copy link
Member Author

rvansa commented Jun 26, 2017

Fixed conflict in documentation.

@pruivo
Copy link
Member

pruivo commented Jun 28, 2017

@rvansa and @danberindei is there anything missing?

@danberindei
Copy link
Member

@pruivo Just one more look...

@danberindei
Copy link
Member

@pruivo I would have liked to have a longer discussion with @rvansa on MergeOnStore and why it's useful for the atomic maps but not for DeltaAware, but I don't think it would lead to changes to this PR, so I'm fine with integrating.

@rvansa
Copy link
Member Author

rvansa commented Jun 28, 2017

The purpose of DeltaAware was isolating incremental changes from the changing object on origin, and replicate only Delta. However, it has some issues (e.g. the one addressed by CopyableDeltaAware), sometimes an unclear semantic, and propagation through PKVC required 'extra ifs' as well as custom entry type. All in all it's inferior to use of functional commands, and we don't want to maintain two ways to do the same.

What you wanted to compare is the MergeOnStore - definitely a hack to implement FGAMs which should have never been born :) - and ApplyDeltaCommand which locks on different keys, and who-knows-on what nodes. And applies deltas, as well.

@danberindei
Copy link
Member

@rvansa Ok, if you say MergeOnStore is a hack that is only ever going to be used by FGAMs I believe you, but you should be aware that it's a public interface in a public package.

@rvansa
Copy link
Member Author

rvansa commented Jun 28, 2017

@danberindei Once we had to add the check into the code, I made it public since I like extensibility in general. I hope I've defined the behaviour well enough. Maybe it was not a wise choice - if you feel strongly about it, we still have some time to hide the interface. The only thing I'd like to have in mind is that IMO AtomicMap should be moved to its own module in 10.0, rather than staying in core.

@wburns
Copy link
Member

wburns commented Jun 28, 2017

Sorry this has conflicts now :(

@pruivo
Copy link
Member

pruivo commented Jun 28, 2017

@rvansa needs rebase. @danberindei just press the button when finish the discussion :)

@rvansa
Copy link
Member Author

rvansa commented Jun 28, 2017

Rebased.

@danberindei
Copy link
Member

@rvansa Still getting a duplicate externalizer id error on my machine:

18:51:23,137 ERROR (testng-SingleClusterExecutorTest) [TestSuiteProgress] Test failed: org.infinispan.manager.SingleClusterExecutorTest.testExecutorTriConsumer org.infinispan.manager.EmbeddedCacheManagerStartupException: org.infinispan.commons.CacheConfigurationException: ISPN000423: Duplicate id found! AdvancedExternalizer id=122 is shared by another externalizer (org.infinispan.atomic.impl.ApplyDelta$Externalizer)

@danberindei
Copy link
Member

@rvansa MergeOnStore can't be both a hack and a reasonable public API that should be used by any application at the same time, you have to decide on one :) I vote to make it internal API, because I hope the functional API is going to be good enough to support FGAMs at some point in the future, and I don't want to keep supporting MergeOnStore after that.

* DeltaAware, CopyableDeltaAware, Delta, DeltaCompositeKey deprecated
* AdvancedCache.applyDelta deprecated, CacheImpl.applyDelta reimplemented using ReadWriteKeyValueCommand, permits to lock only on the main key
* ApplyDeltaCommand and Visitor.visitApplyDeltaCommand deprecated (implementation removed)
* DeltaAwareCacheEntry, DeltaAwareObjectOutput and some internal helpers removed
@rvansa
Copy link
Member Author

rvansa commented Jun 29, 2017

@danberindei I've corrected the Ids and piggy-backed a commit moving MergeOnStore to o.i.container which is (a bit surprisingly) non-public.

@danberindei
Copy link
Member

@rvansa That is surprising, considering that DataContainer is exposed in the configuration, but I'm fine with it. I'll just wait for another run in CI.

@wburns
Copy link
Member

wburns commented Jun 29, 2017

Looks like there some related failures http://ci.infinispan.org/job/Infinispan/job/PR-5187/58

@wburns
Copy link
Member

wburns commented Jun 29, 2017

Actually it looks like this was already failing http://ci.infinispan.org/job/Infinispan/job/master/lastSuccessfulBuild/#showFailuresLink

@wburns wburns merged commit ee2d035 into infinispan:master Jun 29, 2017
@wburns
Copy link
Member

wburns commented Jun 29, 2017

Integrated into master, thanks @rvansa !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
6 participants