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

(fix) Set ebean transaction level to be repeatable read #3285

Merged

Conversation

xdl
Copy link
Contributor

@xdl xdl commented Sep 22, 2021

The current implementation of aspect versioning relies on the transactions to be with the isolation level of repeatable read in order to avoid lost updates (as discussed in https://datahubproject.io/docs/advanced/aspect-versioning/#transaction-isolation-1 and illustrated in #3231).

Although the default isolation level is repeatable read for MySQL, ebean sets the default transaction isolation to be read committed (https://github.com/ebean-orm/ebean-datasource/blob/master/ebean-datasource-api/src/main/java/io/ebean/datasource/DataSourceConfig.java#L38); this PR ensures that the transactions use the repeatable read isolation level.

Another option would be to set it as the default/make it configurable (e.g. in https://github.com/linkedin/datahub/blob/master/metadata-service/factories/src/main/java/com/linkedin/gms/factory/common/LocalEbeanServerConfigFactory.java) - regardless, @dexter-mh-lee should run some performance regression testing before merging in.

@jjoyce0510
Copy link
Collaborator

Overall this looks good to me, but I haven't done any performance testing. My expectation is that this doesn't change MySQL performance.

Copy link
Contributor

@shirshanka shirshanka left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

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.

3 participants