Skip to content

[Query engine] Advisory locks shouldn't pin #1263

Description

@levkk

We should come up with a better algorithm to handle advisory locks. Currently, they pin the client to the server connection. That's a bit simplistic. We can do something similar to LISTEN/NOTIFY, e.g., take the lock on dedicated connection, while continuing to multiplex.

Some careful design decisions are needed here:

  1. pg_advisory_lock needs to block until that lock is released, so some synchronization between clients is needed
  2. It also needs to block if that lock is taken by another PgDog process, so synchronization between PgDog's is neeeded

So overall, not a trivial feature, but certainly interesting.

TLDR: build a distributed locking mechanism using Postgres as the broker.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions