Skip to content

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
apache:masterfrom
XianReallyHot-ZZH:IGNITE-29197-tx-binary-key-error
Open

XianReallyHot-ZZH wants to merge 2 commits into
apache:masterfrom
XianReallyHot-ZZH:IGNITE-29197-tx-binary-key-error

Conversation

@XianReallyHot-ZZH

@XianReallyHot-ZZH XianReallyHot-ZZH commented Oct 23, 2026 •

Copy link
Copy Markdown

Ticket: IGNITE-29197

What changes

GridNearTxLocal.enlistWriteEntry() builds two of its error messages with CU.value(cacheKey, cacheCtx, false), which deserializes the key:

  • "cannot have update value in transaction after EntryProcessor is applied"
  • "Cannot access key within transaction if lock is externally held"

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 to KeyCacheObject.toString() when deserialization fails (for BinaryObjectImpl this 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 with BinaryObjectBuilder for a type without a Java class, invoke() followed by put() 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 with BinaryInvalidTypeException: org.apache.ignite.nonexistent.TestKeyType thrown from GridNearTxLocal.enlistWriteEntry — exactly the masking reported in the ticket.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant