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: deleting lots of records (track_deletes=true) #1878

Merged
merged 1 commit into from Mar 19, 2024

Conversation

TBonnin
Copy link
Collaborator

@TBonnin TBonnin commented Mar 19, 2024

I am a few days away from removing the records snapshot table but a customer is experiencing a sync failure in prod. so here is a quick fix to unblock the customer.
https://nangohq.slack.com/archives/C06FA6Q90BF/p1710782759958379

Deleting records (track_deletes=true) currently involves copying records from the snapshot table back into the records table. If there is a lot of records to copy, the query fails because the number of parameters goes beyond what's postgres supports, which I believe is 65k
Fixing this issue by inserting in chunks

Issue ticket number and link

https://linear.app/nango/issue/NAN-603/bug-deleting-too-many-records-track-deletes=true-results-in-an-error

Tested?

I have reproduced the issue and tested the fix locally

Copy link

linear bot commented Mar 19, 2024

Deleting records (track_deletes=true) currently involves copying records
from snapshot table back into the records table. If there is a lot of
records to copy, the query fails because the number of parameters goes
beyond what's postgres supports, which I believe is 65k
Fixing this issue by inserting in chunks
@TBonnin TBonnin force-pushed the tbonnin/NAN-603/fix-delete-too-many-records branch from 8a318d3 to ba87248 Compare March 19, 2024 20:02
@TBonnin TBonnin merged commit f1bf2db into master Mar 19, 2024
16 checks passed
@TBonnin TBonnin deleted the tbonnin/NAN-603/fix-delete-too-many-records branch March 19, 2024 20:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants