Skip to content

codeintel: Ensure txn is used for bulk inserts

Administrator requested to merge ef/commit-txn into main

Created by: efritz

When we recalculate the commit graph for a repository, we (were supposed to) delete all the existing records for that repository and bulk insert the new rows within a transaction. It turns out only the deletion was in a transaction and the uploads happened outside of the transaction.

This caused an issue at a customer to have 2x the number of records than expected in the lsif_nearest_uploads table. It looks like the deletion got rolled back but the insertions still succeeded at least once.

Not sure if it solves the linked issue completely, but it should help it from recurring.

Merge request reports

Loading