Skip to content

Make snippet creation resilient to replication lag

Igor Drozdov requested to merge id-fix-snippet-creation-on-replication-lag into master

What

Make snippet creation resilient to replication lag

Why

When a snippet is being created, it inserts a record in the database and then performs a Gitaly call to create Git data. The Gitaly call performs HTTP request for permission check and if replication lag takes place, those HTTP calls may try fetching data from a replica that is not up-to-date yet.

This MR:

  • Sticks to primary before performing the Gitaly call
  • Makes the internal API requests aware of the sticking

Related issue: Snippet creation not resilient to Postgres repl... (#413908 - closed)

Edited by Igor Drozdov

Merge request reports