Skip to content

How does FOR NO KEY UPDATE SKIP LOCKED handle workers running on different machines? #345

@gmhawash

Description

@gmhawash
  1. I am a bit confused about how the queue#lock function works since the switch to the FOR NO KEY UPDATE SKIP LOCKED. When I look at the PostgreSQL manuals, it indicates that the row level locking will happen within a DB transaction; and when a SELECT FOR NO KEY UPDATE SKIP LOCKED finds a row within a DB transaction; any other DB sessions will skip that row when using the same FOR NO KEY ....

I don't see that QC does any DB transactions anywhere; so how does this work?

  1. Why is there no ORDER BY id ASC in the query so that jobs are handled in FIFO manner?

Thanks

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions