Skip to content

fix(propagator): Improve lock behavior of propagator#58134

Merged
AndyScherzinger merged 2 commits intomasterfrom
carl/lock-propagator-order
Feb 9, 2026
Merged

fix(propagator): Improve lock behavior of propagator#58134
AndyScherzinger merged 2 commits intomasterfrom
carl/lock-propagator-order

Conversation

@CarlSchwan
Copy link
Member

@CarlSchwan CarlSchwan commented Feb 6, 2026

Fix possible dead locks when running the propagator caused by two requests updating the same amount rows in transactions.

  • Lock rows always in the same deterministic order by sorting the path_hash first

  • On all database outside of sqlite, also do first a SELECT FOR UPDATE to lock all the rows used in batch UPDATE calls, afterward to decrease the risk of two requests trying to lock the same rows

  • Resolves: #

Summary

TODO

  • ...

Checklist

@CarlSchwan CarlSchwan self-assigned this Feb 6, 2026
@CarlSchwan CarlSchwan requested a review from a team as a code owner February 6, 2026 11:45
@CarlSchwan CarlSchwan added 3. to review Waiting for reviews feature: database Database related DB labels Feb 6, 2026
@CarlSchwan CarlSchwan requested review from Altahrim, ArtificialOwl, come-nc and icewind1991 and removed request for a team February 6, 2026 11:45
@CarlSchwan CarlSchwan force-pushed the carl/lock-propagator-order branch from bb7bf2a to 3025dca Compare February 6, 2026 13:10
@CarlSchwan CarlSchwan force-pushed the carl/lock-propagator-order branch from 4004141 to 4240de3 Compare February 9, 2026 10:56
Fix possible dead locks when running the propagator caused by two
requests updating the same amount rows in transactions.

- Lock rows always in the same deterministic order by sorting the
  path_hash first

- On all database outside of sqlite, also do first a SELECT FOR UPDATE
  to lock all the rows used in batch UPDATE calls, afterward to decrease
  the risk of two requests trying to lock the same rows

Signed-off-by: Carl Schwan <carlschwan@kde.org>
Signed-off-by: Carl Schwan <carlschwan@kde.org>
@CarlSchwan CarlSchwan force-pushed the carl/lock-propagator-order branch from 4240de3 to 95b3bd9 Compare February 9, 2026 11:11
Copy link
Member

@AndyScherzinger AndyScherzinger left a comment

Choose a reason for hiding this comment

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

🐘

@AndyScherzinger AndyScherzinger merged commit 39ff32a into master Feb 9, 2026
193 checks passed
@AndyScherzinger AndyScherzinger deleted the carl/lock-propagator-order branch February 9, 2026 15:04
@AndyScherzinger AndyScherzinger added this to the Nextcloud 34 milestone Feb 9, 2026
@CarlSchwan
Copy link
Member Author

/backport to stable33

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

3. to review Waiting for reviews feature: database Database related DB

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants