Skip to content

Workaround for absence of advisory locks in YugabyteDB #35

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

Merged
merged 1 commit into from
May 10, 2024

Conversation

ashetkar
Copy link
Contributor

Problem:

  • YugabyteDB does not support PG Advisory Locks. The Postgresql plugin used these to enforce locking around Flyway operations, and YugabyteDB plugin, which extends it, had to suppress the failure message.

Solution:

  • Now, the plugin employs the locking based on SELECT...FOR UPDATE through a token row in YB_FLYWAY_LOCK_TABLE.
  • Also, fixing a bug with respect to using the YugabyteDB Smart driver class name when specified url is jdbc:yugabytedb:

Testing:

* Employ locking based on SELECT...FOR UPDATE instead of the PG Advisory Locks.
* Also, fix a bug w.r.t using YugabyteDB Smart driver class name
@ashetkar
Copy link
Contributor Author

This PR addresses the locking mechanism and is the next step to this PR from @Sfurti-yb
cc @Barry-RG

@ashetkar
Copy link
Contributor Author

ashetkar commented Apr 29, 2024

Can someone please take a look at this PR?

@ashetkar
Copy link
Contributor Author

@Barry-RG A gentle reminder. And also please let me know if we need to create a GitHub issue to move forward on this since we would like to have this change published at the earliest.

@CLAassistant
Copy link

CLAassistant commented Apr 30, 2024

CLA assistant check
All committers have signed the CLA.

@ymahajan
Copy link

YugabyteDB PM here - I would appreciate it if you could review and commit this PR, as we have a customer waiting for this change. Thank you.

cc @Barry-RG, @ed-RG, @JasonLuo-Redgate, @sazonov, @madninjaskillz @RedGateAdmin, @edwardcasbon

Copy link
Contributor

@Barry-RG Barry-RG left a comment

Choose a reason for hiding this comment

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

Seems like a good change to me. Will see when we can add it to release

@Barry-RG Barry-RG merged commit 04b08a6 into flyway:main May 10, 2024
2 checks passed
@ashetkar
Copy link
Contributor Author

Thanks @Barry-RG. Is this fix part of this package https://github.com/flyway/flyway-community-db-support/packages/2037431 ?

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.

4 participants