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

Ensure the Transaction Manager node name is less than or equal to 28 bytes #40613

Merged
merged 1 commit into from
Oct 22, 2024

Conversation

marcosgopen
Copy link
Contributor

@marcosgopen marcosgopen commented May 13, 2024

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.

@quarkus-bot quarkus-bot bot added the area/narayana Transactions / Narayana label May 13, 2024
@marcosgopen
Copy link
Contributor Author

FYI @turing85 and @mmusgrov

@mmusgrov
Copy link
Contributor

mmusgrov commented May 14, 2024

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.

Copy link
Contributor

@mmusgrov mmusgrov left a 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.

@marcosgopen
Copy link
Contributor Author

marcosgopen commented May 14, 2024

Closed as not a bug

@quarkus-bot quarkus-bot bot added the triage/invalid This doesn't seem right label May 14, 2024
@geoand geoand reopened this May 16, 2024
@quarkus-bot quarkus-bot bot removed the triage/invalid This doesn't seem right label May 16, 2024
@geoand
Copy link
Contributor

geoand commented May 16, 2024

This is going to need a better title

@marcosgopen marcosgopen changed the title Node name Ensure the Transaction Manager node name is less than or equal to 28 bytes May 16, 2024

This comment has been minimized.

@geoand geoand requested review from mmusgrov and yrodiere and removed request for mmusgrov May 16, 2024 11:07
Copy link
Member

@yrodiere yrodiere left a 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.

@marcosgopen marcosgopen force-pushed the node-name branch 2 times, most recently from 0a2ce53 to a595636 Compare May 17, 2024 11:58
@graben
Copy link

graben commented Jun 25, 2024

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

@mmusgrov
Copy link
Contributor

mmusgrov commented Jun 25, 2024

@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.

@graben
Copy link

graben commented Jun 25, 2024

Hi @mmusgrov, thanks for the info. Does exist a timeline for the new narayana release containing this patch?

@mmusgrov
Copy link
Contributor

mmusgrov commented Jun 25, 2024

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 :-)

@mmusgrov
Copy link
Contributor

I'd recommend leaving this PR open until the new patch has been tested against Quarkus.

This comment has been minimized.

This comment has been minimized.

This comment has been minimized.

This comment has been minimized.

This comment has been minimized.

This comment has been minimized.

Copy link
Contributor

@tomjenkinson tomjenkinson left a 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.

Copy link
Member

@yrodiere yrodiere left a 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.

@marcosgopen
Copy link
Contributor Author

marcosgopen commented Oct 22, 2024

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.

Thank you very much @yrodiere , updated and rebased.

@yrodiere
Copy link
Member

Tom approved from the Narayana side, and the Quarkus side LGTM: let's merge once CI passes. Thanks!

@yrodiere yrodiere added the triage/waiting-for-ci Ready to merge when CI successfully finishes label Oct 22, 2024
Copy link

quarkus-bot bot commented Oct 22, 2024

Status for workflow Quarkus Documentation CI

This is the status report for running Quarkus Documentation CI on commit e14067b.

✅ The latest workflow run for the pull request has completed successfully.

It should be safe to merge provided you have a look at the other checks in the summary.

Warning

There are other workflow runs running, you probably need to wait for their status before merging.

This comment has been minimized.

@yrodiere
Copy link
Member

Failures

⚙️ JVM Tests - JDK 17 #

- Failing: extensions/hibernate-reactive/deployment 
! Skipped: extensions/panache/hibernate-reactive-panache-common/deployment extensions/panache/hibernate-reactive-panache-kotlin/deployment extensions/panache/hibernate-reactive-panache/deployment and 21 more

📦 extensions/hibernate-reactive/deployment

Failed to execute goal io.fabric8:docker-maven-plugin:0.45.1:start (docker-start) on project quarkus-hibernate-reactive-deployment: I/O Error

This looks like an infra issue/flake, I restarted that build.

Copy link

quarkus-bot bot commented Oct 22, 2024

Status for workflow Quarkus CI

This is the status report for running Quarkus CI on commit e14067b.

✅ The latest workflow run for the pull request has completed successfully.

It should be safe to merge provided you have a look at the other checks in the summary.

You can consult the Develocity build scans.


Flaky tests - Develocity

⚙️ JVM Tests - JDK 17

📦 integration-tests/mongodb-panache

io.quarkus.it.mongodb.panache.ReflectionFreeSerializationTest.testReactiveBookEntity - History

  • com.fasterxml.jackson.databind.exc.MismatchedInputException: No content to map due to end-of-input at [Source: REDACTED (\StreamReadFeature.INCLUDE_SOURCE_IN_LOCATION` disabled); line: 1]-java.lang.RuntimeException`
java.lang.RuntimeException: 
com.fasterxml.jackson.databind.exc.MismatchedInputException: No content to map due to end-of-input
 at [Source: REDACTED (`StreamReadFeature.INCLUDE_SOURCE_IN_LOCATION` disabled); line: 1]
	at io.restassured.internal.path.json.mapping.JsonPathJackson2ObjectDeserializer.deserialize(JsonPathJackson2ObjectDeserializer.java:30)
	at io.restassured.path.json.mapping.JsonPathObjectDeserializer$deserialize.call(Unknown Source)
	at io.restassured.internal.mapping.Jackson2Mapper.deserialize(Jackson2Mapper.groovy:58)
	at io.restassured.mapper.ObjectMapper$deserialize.call(Unknown Source)
	at io.restassured.internal.mapping.ObjectMapping.parseWithJackson2(ObjectMapping.groovy:254)

@yrodiere yrodiere merged commit 4a56283 into quarkusio:main Oct 22, 2024
46 checks passed
@quarkus-bot quarkus-bot bot added kind/bugfix and removed triage/waiting-for-ci Ready to merge when CI successfully finishes labels Oct 22, 2024
@quarkus-bot quarkus-bot bot added this to the 3.17 - main milestone Oct 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Patch from #30491 "Generate right-length node name" seems invalid
8 participants