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
GEODE-9757: Ensure that tx cache ops always add CachedDeserializable entries #7022
Merged
jdeppe-pivotal
merged 3 commits into
apache:develop
from
jdeppe-pivotal:feature/GEODE-9757-tx-always-cachedeserializable
Oct 27, 2021
Merged
GEODE-9757: Ensure that tx cache ops always add CachedDeserializable entries #7022
jdeppe-pivotal
merged 3 commits into
apache:develop
from
jdeppe-pivotal:feature/GEODE-9757-tx-always-cachedeserializable
Oct 27, 2021
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
jdeppe-pivotal
requested review from
DonalEvans,
dschneider-pivotal,
jchen21,
kirklund,
nabarunnag,
nonbinaryprogrammer,
ringles and
upthewaterspout
as code owners
October 21, 2021 21:24
kirklund
requested changes
Oct 21, 2021
Comment on lines
2504
to
2535
@Override | ||
public void txApplyPut(Operation putOp, Object key, Object newValue, boolean didDestroy, | ||
TransactionId transactionId, TXRmtEvent event, EventID eventId, Object aCallbackArgument, | ||
List<EntryEventImpl> pendingCallbacks, FilterRoutingInfo filterRoutingInfo, | ||
ClientProxyMembershipID bridgeContext, TXEntryState txEntryState, VersionTag versionTag, | ||
long tailKey) { | ||
|
||
Object wrappedNewValue; | ||
if (newValue instanceof CachedDeserializable || newValue instanceof byte[] | ||
|| Token.isInvalidOrRemoved(newValue)) { | ||
wrappedNewValue = newValue; | ||
} else if (newValue instanceof Delta) { | ||
int vSize = CachedDeserializableFactory.calcMemSize(newValue, | ||
getPartitionedRegion().getObjectSizer(), false); | ||
wrappedNewValue = CachedDeserializableFactory.create(newValue, vSize, cache); | ||
} else { | ||
byte[] serializedBytes = null; | ||
if (txEntryState != null) { | ||
serializedBytes = txEntryState.getSerializedPendingValue(); | ||
} | ||
|
||
if (serializedBytes == null) { | ||
serializedBytes = EntryEventImpl.serialize(newValue); | ||
} | ||
|
||
wrappedNewValue = CachedDeserializableFactory.create(serializedBytes, cache); | ||
} | ||
|
||
super.txApplyPut(putOp, key, wrappedNewValue, didDestroy, transactionId, event, eventId, | ||
aCallbackArgument, pendingCallbacks, filterRoutingInfo, bridgeContext, txEntryState, | ||
versionTag, tailKey); | ||
} |
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 think you should consider adding unit test and dunit coverage for BucketRegion.txApplyPut(...)
.
dschneider-pivotal
requested changes
Oct 22, 2021
geode-core/src/main/java/org/apache/geode/internal/cache/BucketRegion.java
Show resolved
Hide resolved
DonalEvans
approved these changes
Oct 25, 2021
dschneider-pivotal
approved these changes
Oct 26, 2021
kirklund
approved these changes
Oct 27, 2021
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
example using a geode function), then the value is stored in the PR
locally in a CachedDeserializable. But if you do the same op in a
transaction it will store the object directly in the PR with no
CachedDeserializable.
did not support partitioned regions and on a non-pr region the local
region stored the value directly. So when support was added for
transactions on partitioned regions this part of the code was not
customized for partitions and just used the old code.
to send it back to a client. It can also cause bucket size exceptions
if you directly change the value stored.
For all changes:
Is there a JIRA ticket associated with this PR? Is it referenced in the commit message?
Has your PR been rebased against the latest commit within the target branch (typically
develop
)?Is your initial contribution a single, squashed commit?
Does
gradlew build
run cleanly?Have you written or updated unit tests to verify your changes?
If adding new dependencies to the code, are these dependencies licensed in a way that is compatible for inclusion under ASF 2.0?