Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(server): fix person pagination when deleting #6707

Merged
merged 1 commit into from
Jan 28, 2024

Conversation

mertalev
Copy link
Contributor

@mertalev mertalev commented Jan 28, 2024

Description

We delete all people when running face detection or facial recognition with "All". This is handled by fetching paginated lists of people and deleting them in batches. The issue is that as we're deleting rows from this table, the SKIP value in the pagination query becomes outdated. Once it exceeds the size of the table - the pagination size (1000), the pagination stops early and half of the table remains.

This PR sets the skip value to 0 since we delete all rows in each fetched page, meaning the next batch begins at row 0.

How Has This Been Tested?

I removed the foreign key constraints to the person table and added 20000 randomly generated rows to it. I then started an "All" job for facial recognition and immediately paused it and observed that it deleted all rows in the table, 1000 at a time.

@mertalev mertalev merged commit 28806d0 into main Jan 28, 2024
26 of 27 checks passed
@mertalev mertalev deleted the fix/server-person-pagination branch January 28, 2024 22:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants