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

Support JDBC ObjectStore in narayana-jta extension #31729

Merged
merged 1 commit into from
May 30, 2023

Conversation

zhfeng
Copy link
Contributor

@zhfeng zhfeng commented Mar 9, 2023

These changes could fix

But we still need

  • Upgrade narayana to 6.0.1.Final which includes the fix of JBTM-3754
  • Add some test cases with JDBC ObjectStore
  • Support table prefix

@zhfeng zhfeng marked this pull request as draft March 9, 2023 12:35
@quarkus-bot quarkus-bot bot added the area/narayana Transactions / Narayana label Mar 9, 2023
@zhfeng zhfeng force-pushed the issue_31066_narayana_jdbc_store branch from 60e2908 to a0efc85 Compare March 9, 2023 12:48
@rsvoboda
Copy link
Member

rsvoboda commented Mar 9, 2023

@zhfeng please add documentation too

Are there any specifics per various DB vendors?

CC @pjgg

@zhfeng zhfeng force-pushed the issue_31066_narayana_jdbc_store branch from a0efc85 to 47528d1 Compare March 20, 2023 02:56
@quarkus-bot quarkus-bot bot added the area/dependencies Pull requests that update a dependency file label Mar 20, 2023
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.

There is a requirement to disable the automatic creation of the schema for the JDBCStore so we need to expose the following Narayana config properties (with false as the default for createTable):

ObjectStoreEnvironmentBean.createTable
ObjectStoreEnvironmentBean.dropTable
and we should also have
ObjectStoreEnvironmentBean.tablePrefix

and we also need to wait for the release of 6.0.1.Final

@zhfeng zhfeng marked this pull request as ready for review March 22, 2023 23:58
@zhfeng zhfeng force-pushed the issue_31066_narayana_jdbc_store branch from 47528d1 to fabcb03 Compare March 23, 2023 00:18
@quarkus-bot

This comment has been minimized.

@quarkus-bot

This comment has been minimized.

@zhfeng
Copy link
Contributor Author

zhfeng commented Mar 23, 2023

@mmusgrov The narayana-lra tests are failing, and I run them locally then find the following WARN messages

21:09:47 WARN  [io.na.lra] (executor-thread-1) LRA025014: reason 'WebApplicationException null: LRA025001: LRA created with an unexpected status code: 417, coordinator response 'LRA025028: Demanded API version '1.1' is not in the list of the supported versions '[Ljava.lang.String;@4797d38c'. Please, provide the right version for the API.'': container request for method 'org.acme.quickstart.lra.coordinator.TransactionalResource#startTx': lra: 'context'
21:09:47 WARN  [io.na.lra] (executor-thread-1) LRA025025: Unable to process LRA annotations: -3: StartFailed (null: LRA025001: LRA created with an unexpected status code: 417, coordinator response 'LRA025028: Demanded API version '1.1' is not in the list of the supported versions '[Ljava.lang.String;@4797d38c'. Please, provide the right version for the API.') ()'

narayana-lra 6.0.1.Final does not support LRA 1.1? I revert to 6.0.0.Final and tests are OK.

@zhfeng zhfeng force-pushed the issue_31066_narayana_jdbc_store branch from 56647f1 to 40b82ff Compare March 23, 2023 14:46
@quarkus-bot

This comment has been minimized.

@mmusgrov
Copy link
Contributor

@mmusgrov The narayana-lra tests are failing, and I run them locally then find the following WARN messages

21:09:47 WARN  [io.na.lra] (executor-thread-1) LRA025014: reason 'WebApplicationException null: LRA025001: LRA created with an unexpected status code: 417, coordinator response 'LRA025028: Demanded API version '1.1' is not in the list of the supported versions '[Ljava.lang.String;@4797d38c'. Please, provide the right version for the API.'': container request for method 'org.acme.quickstart.lra.coordinator.TransactionalResource#startTx': lra: 'context'
21:09:47 WARN  [io.na.lra] (executor-thread-1) LRA025025: Unable to process LRA annotations: -3: StartFailed (null: LRA025001: LRA created with an unexpected status code: 417, coordinator response 'LRA025028: Demanded API version '1.1' is not in the list of the supported versions '[Ljava.lang.String;@4797d38c'. Please, provide the right version for the API.') ()'

narayana-lra 6.0.1.Final does not support LRA 1.1? I revert to 6.0.0.Final and tests are OK.

The 6.0.0.Final version of the coordinator does not support later versions of the client due to JBTM-3767 (LRA API versioning scheme is too restrictive). We've got a PR to fix it so the next version of the coordinator will be more permissive with regards to API versioning.

@zhfeng zhfeng force-pushed the issue_31066_narayana_jdbc_store branch from 40b82ff to ba7801f Compare March 27, 2023 15:01
@quarkus-bot

This comment has been minimized.

@zhfeng zhfeng force-pushed the issue_31066_narayana_jdbc_store branch from ba7801f to 6e5f35b Compare March 28, 2023 12:50
@quarkus-bot

This comment has been minimized.

@michalvavrik
Copy link
Member

@zhfeng please can you update me on your plans considering Naryana 6.0.1.Final is out now? Also please kindly:

  • document how to use the JDBCStore transaction log in Quarkus and in particular how to achieve recovery of inflight transactions
  • add testes that comprehensively test feature as far as Quarkus is concerned, status request you have there seems insufficient. I this this is WIP, so if that's your plan anyway, please ignore this, thanks

@mmusgrov
Copy link
Contributor

@michalvavrik @zhfeng I have delayed the announcement of 6.0.1.Final while I investigate what looks like a performance regression, when I have a better understanding of the issue I shall provide an update

@michalvavrik
Copy link
Member

ok, thanks @mmusgrov

@zhfeng
Copy link
Contributor Author

zhfeng commented Apr 25, 2023

@michalvavrik I think we also need a new release of lra-coordinator-quarkus to make the lra tck tests work again with Narayana 6.0.1.Final. I've opened

And there is a test plan for this feature https://github.com/quarkus-qe/quarkus-test-plans/blob/main/QUARKUS-2739.md

@mmusgrov
Copy link
Contributor

I have raised quarkus pr #32922 for the upgrade to 6.0.1.Final

@zhfeng zhfeng force-pushed the issue_31066_narayana_jdbc_store branch from 6e5f35b to c9a7be6 Compare May 4, 2023 05:21
@zhfeng
Copy link
Contributor Author

zhfeng commented May 4, 2023

Thanks @mmusgrov and I just rebase this PR to see how CI is working.

@mmusgrov
Copy link
Contributor

mmusgrov commented May 4, 2023

Thanks @zhfeng it is looking good so far.
I guess you will be updating the title of the PR if it passes.

@quarkus-bot

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.

LGTM, though I added a few suggestions below. You'll probably want to clear up whether transactions can be enabled on the datasource used to store the transaction log, in particular.

@quarkus-bot

This comment has been minimized.

@zhfeng zhfeng force-pushed the issue_31066_narayana_jdbc_store branch from 487ae38 to 6fc8350 Compare May 11, 2023 08:28
@quarkus-bot
Copy link

quarkus-bot bot commented May 11, 2023

✔️ 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.

@zhfeng
Copy link
Contributor Author

zhfeng commented May 16, 2023

@mmusgrov is there anything you need to add to documentation?

@yrodiere I'd like to open a follow up issue for

  • Checking datasource used for jdbc object store is not with transactions = XA
  • Enable reflection only on the driver that will actually get used, and only if actually using JDBC for the transaction log

@geoand I think this PR is good for merging. Is it possible to target for quarkus 3.1?

@geoand
Copy link
Contributor

geoand commented May 16, 2023

Is it possible to target for quarkus 3.1?

If it gets merged soon, that will happen automatically

@mmusgrov
Copy link
Contributor

@mmusgrov is there anything you need to add to documentation?

@zhfeng Ah, I assumed that your PR is already including it: https://github.com/quarkusio/quarkus/pull/31729/files#diff-b86c4389d1f3659cbf608fadee4fbad6863020687d3f102c24b44dd00028c10b

What more do you think we need to add?

@zhfeng
Copy link
Contributor Author

zhfeng commented May 17, 2023

@mmusgrov the documentation looks good to me right now.

Is there anyone can approve and merge it? Thanks!

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.

@yrodiere I'd like to open a follow up issue for

* Checking datasource used for jdbc object store is not with `transactions = XA`

* Enable reflection only on the driver that will actually get used, and only if actually using JDBC for the transaction log

Ok, but please do open that issue now, otherwise we'll just forget :)

@geoand I think this PR is good for merging. Is it possible to target for quarkus 3.1?

It's good to merge as far as I'm concerned, but I don't know a thing about Narayana, so really my approval is not worth much. I'll defer to @mmusgrov on that front, and it seems he already approved, so... let's merge :)

@yrodiere yrodiere merged commit c2546e7 into quarkusio:main May 30, 2023
@quarkus-bot quarkus-bot bot added this to the 3.2 - main milestone May 30, 2023
@Sanne
Copy link
Member

Sanne commented May 30, 2023

  • Enable reflection only on the driver that will actually get used, and only if actually using JDBC for the transaction log

Just curious, what is this used for?

  • JDBC driver extensions already do register the driver for reflective instantiation
  • I thought we agreed the ObjectStore would use exclusively the connection pool (Datasource) ?

@yrodiere
Copy link
Member

  • Enable reflection only on the driver that will actually get used, and only if actually using JDBC for the transaction log

Just curious, what is this used for?

* JDBC driver extensions already do register the driver for reflective instantiation

* I thought we agreed the ObjectStore would use exclusively the connection pool (Datasource) ?

This is not a JDBC Driver, but a native concept of driver within Narayana. From what I understand it's the equivalent of Hibernate ORM's dialects.

@Sanne
Copy link
Member

Sanne commented May 30, 2023

This is not a JDBC Driver, but a native concept of driver within Narayana. From what I understand it's the equivalent of Hibernate ORM's dialects.

Thanks, thas makes sense. Wondering now if we could get such things initialized at buid time, but that's most certainly an optimisation for another day :)

@zhfeng
Copy link
Contributor Author

zhfeng commented May 31, 2023

Thanks @yrodiere and I raise two follow up issues.

@ahus1
Copy link
Contributor

ahus1 commented Jul 5, 2023

I just found out the hard way that some properties changed. Instead in Quarkus 3.1 of

quarkus.transaction-manager.object-store-directory

it is now in Quarkus 3.2

quarkus.transaction-manager.object-store.directory

where the last - changed to a .. Might be a candidate for some release notes?

@geoand
Copy link
Contributor

geoand commented Jul 5, 2023

Indeed, that is a breaking change!

@geoand
Copy link
Contributor

geoand commented Jul 5, 2023

@yrodiere mind adding an entry to the wiki?

@yrodiere
Copy link
Member

yrodiere commented Jul 5, 2023

@geoand
Copy link
Contributor

geoand commented Jul 5, 2023

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

9 participants