Repository navigation
IGNITE-29197 Binary key deserialization masks the error when put follows invoke in a transaction - #13737
Open
XianReallyHot-ZZH wants to merge 2 commits into
Open
IGNITE-29197 Binary key deserialization masks the error when put follows invoke in a transaction#13737XianReallyHot-ZZH wants to merge 2 commits into
XianReallyHot-ZZH wants to merge 2 commits into
Conversation
…ows invoke in a transaction
This file contains hidden or 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
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.
Ticket: IGNITE-29197
What changes
GridNearTxLocal.enlistWriteEntry()builds two of its error messages withCU.value(cacheKey, cacheCtx, false), which deserializes the key:If the key is a binary object built without a Java class, constructing the message itself throws
BinaryInvalidTypeException, so the user sees a key deserialization failure instead of the actual reason the operation was rejected.Both messages are now built through a
safeKeyValue()helper: it first tries the current representation and falls back toKeyCacheObject.toString()when deserialization fails (forBinaryObjectImplthis prints the fields from binary metadata, no Java class required). For keys that deserialize normally the message text is unchanged.Testing
New
IgniteBinaryTxPutAfterInvokeSelfTest(modules/core, binary tests): single-node transactional cache, key built withBinaryObjectBuilderfor a type without a Java class,invoke()followed byput()for that key inside a transaction. The test walks the exception chain to the root cause and asserts it carries "cannot have update value in transaction after EntryProcessor is applied". On the unfixed code the test fails withBinaryInvalidTypeException: org.apache.ignite.nonexistent.TestKeyTypethrown fromGridNearTxLocal.enlistWriteEntry— exactly the masking reported in the ticket.