-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
Ensure the Transaction Manager node name is less than or equal to 28 bytes #40613
Conversation
I added a comment to the issue indicating that the spring boot port should just avoid using the UTF-8 encoding and use ISO-LATIN-1 instead. This would mean the original code submitted by @turing85 would stand. |
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 am declining this PR because the node name is less than or equal to 28 bytes when a fixed-length character encoding is used to convert it to a byte array.
Closed as not a bug |
.../narayana-jta/runtime/src/main/java/io/quarkus/narayana/jta/runtime/NarayanaJtaRecorder.java
Outdated
Show resolved
Hide resolved
This is going to need a better title |
This comment has been minimized.
This comment has been minimized.
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.
LGTM, though I'll wait for @mmusgrov's approval before actually approving -- he knows the implications in Narayana, I really don't.
.../narayana-jta/runtime/src/main/java/io/quarkus/narayana/jta/runtime/NarayanaJtaRecorder.java
Outdated
Show resolved
Hide resolved
.../narayana-jta/runtime/src/main/java/io/quarkus/narayana/jta/runtime/NarayanaJtaRecorder.java
Show resolved
Hide resolved
0a2ce53
to
a595636
Compare
...ayana-jta/runtime/src/test/java/io/quarkus/narayana/jta/runtime/NarayanaJtaRecorderTest.java
Outdated
Show resolved
Hide resolved
...ayana-jta/runtime/src/test/java/io/quarkus/narayana/jta/runtime/NarayanaJtaRecorderTest.java
Outdated
Show resolved
Hide resolved
...ayana-jta/runtime/src/test/java/io/quarkus/narayana/jta/runtime/NarayanaJtaRecorderTest.java
Outdated
Show resolved
Hide resolved
Hi @marcosgopen, is there still something open preventing to merge this PR? I ask because I'd like to port this solution to narayana-spring-boot :) FYI @geoand |
@graben We created and merged a narayana PR for https://issues.redhat.com/browse/JBTM-3883 (Add a setNodeIdentifier config method that accepts a byte array) which should render this PR superfluous but it would need to be replaced with a change that calls the new setNodeIdentifier config method that accepts a byte array. All being well, we should be releasing a version that contains that change this week. |
Hi @mmusgrov, thanks for the info. Does exist a timeline for the new narayana release containing this patch? |
All being well, we should be releasing a version that contains that change this week. FYI The test that validates the new setting is https://github.com/jbosstm/narayana/blob/main/ArjunaJTA/jta/tests/classes/com/hp/mwtests/ts/jta/xa/NodeIdentifierUnitTest.java#L38 @graben you may notice that the test is largely based on the test you included with the original issue and thanks for contributing it :-) |
I'd recommend leaving this PR open until the new patch has been tested against Quarkus. |
0fa6b6d
to
44d9f80
Compare
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
44d9f80
to
eee79e1
Compare
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
eee79e1
to
e6d0325
Compare
This comment has been minimized.
This comment has been minimized.
e6d0325
to
cb72274
Compare
This comment has been minimized.
This comment has been minimized.
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.
LGTM - thank you
This comment has been minimized.
This comment has been minimized.
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.
Hey,
The implementation LGTM, thanks. Documentation contains a mistake, though: the name of the property.
I would also simplify phrasing in the documentation, but feel free to ignore that suggestion.
...a/runtime/src/main/java/io/quarkus/narayana/jta/runtime/TransactionManagerConfiguration.java
Outdated
Show resolved
Hide resolved
d07a2ea
to
e14067b
Compare
Thank you very much @yrodiere , updated and rebased. |
Tom approved from the Narayana side, and the Quarkus side LGTM: let's merge once CI passes. Thanks! |
Status for workflow
|
This comment has been minimized.
This comment has been minimized.
This looks like an infra issue/flake, I restarted that build. |
Status for workflow
|
We need to include the node name in the fixed size Xid data structure(limited to 28 bytes) so that the TM can determine which XA resource branches it is responsible for.
related to PR: #36752
please note: this is fixing the issue truncating the byte array which means that it impacts the collision avoidance. This is why I added a stress test to 'test' the collision. I think that the risk of collision is still very low but a preferable solution may be to have a byte array type 'nodeName' so that the collision resistance exclusively relies on the hash algorithm.