Skip to content

Conversation

@salmart-dev
Copy link
Contributor

@salmart-dev salmart-dev commented Nov 11, 2025

Fix an issue in deleting expired locks, which prevented any expired locks from being deleted as soon as there was more than one expired lock.

The code was building a DELETE ... WHERE id = # AND id = # AND id = # ... which never deletes any row as long as more than one id is provided.

To prevent mass deletion due to the patch for users with many rows in the table, a limit of 1000 rows per-run has been added.

@salmart-dev salmart-dev self-assigned this Nov 11, 2025
@salmart-dev salmart-dev added 3. to review bug Something isn't working labels Nov 11, 2025
@salmart-dev salmart-dev force-pushed the fix/lockDeletion branch 3 times, most recently from 53bd388 to e7063da Compare November 11, 2025 18:23
Signed-off-by: Salvatore Martire <4652631+salmart-dev@users.noreply.github.com>
This commit fixes an issue with the query logic which prevented locks
from being deleted as long as more than one lock is expired.

To prevent a potential mass deletion of data due to the fix, the code
has been adjusted to delete only 1000 locks at every run of the
background job.

Signed-off-by: Salvatore Martire <4652631+salmart-dev@users.noreply.github.com>
@salmart-dev
Copy link
Contributor Author

/backport to stable32

@salmart-dev
Copy link
Contributor Author

/backport to stable31

Copy link
Member

@juliusknorr juliusknorr left a comment

Choose a reason for hiding this comment

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

Thanks, nice catch 👍

@juliusknorr juliusknorr merged commit a525a64 into main Nov 11, 2025
49 checks passed
@juliusknorr juliusknorr deleted the fix/lockDeletion branch November 11, 2025 21:37
@salmart-dev
Copy link
Contributor Author

/backport to stable32

@salmart-dev
Copy link
Contributor Author

/backport to stable31

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

Labels

3. to review bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants