conductor icon indicating copy to clipboard operation
conductor copied to clipboard

Postgres locking DAO

Open VerstraeteBert opened this issue 1 year ago • 1 comments

Pull Request type

  • [ ] Bugfix
  • [x] Feature
  • [ ] Refactoring (no functional changes, no api changes)
  • [ ] Build related changes
  • [ ] WHOSUSING.md
  • [ ] Other (please describe):

Changes in this PR

Implement Postgres locking DAO

Fixes the issues observed in https://github.com/conductor-oss/conductor/pull/81

A remaining issue is the fact that lock leases may not cover the full time the thread want to hold the lock is covered (e.g., long GCs, ...), this issue is present in the Redis lock implementation as well and would be solved the alternative outlined below.

Alternatives considered

Postgres has row level and table level locks, in addition to application-defined locks through advisory locking. Both of these are on the transaction level, which does not work with the current architecture of Conductor as transaction are handled at the lowest level (i.e., per database operation). To allow this to work, a larger overhaul is required where transaction are managed at the service level.

VerstraeteBert avatar Mar 07 '24 12:03 VerstraeteBert

@VerstraeteBert Looks like the build is failing because there's already a V9 migration - renaming to V11 should do it

bjpirt avatar Mar 10 '24 15:03 bjpirt