Skip to content

codeintel: Minimize the number of duplicate rows inserted in UpdateCommits

Administrator requested to merge minimize-lsif-commits-insertion into master

Created by: efritz

The new services are causing a periodic deadlock between the api-server and the worker trying to insert records into the lsif_commits table. The worker does this inside of a long transaction, and the api-server does this as a means to discover what dumps it can use to serve the current query.

One way to mitigate this is to shorten the transaction in the worker. This will also be done, but in a separate effort. Another way is to reduce the number of clashing rows that are inserted into a unique index (see this article). That is this PR's focus.

For context, see https://sourcegraph.slack.com/archives/C07KZF47K/p1589231888204200.

Merge request reports

Loading