Skip to content

Expire Snippet#exists? method before proceeding

What does this MR do and why?

This MR aims to fix a DB seeding error that occurs in db/fixtures/development/12_snippets.rb by ensuring the snippet.repository_exists? returns an accurate value (it was always returning true) by first running snippet.repository.expire_exists_cache.

This is a workaround for now while we dig deeper into the root cause. As the workaround applies to DB seeding only I feel it's a reasonable solution for now.

Related: #365321 (moved)

How to set up and validate locally

Using gitlab master branch:

  1. cd <GDK_root>
  2. gdk reset-data

gitlab/db/fixtures/development/12_snippets.rb seeding should fail.

Using gitlab 1527-pg-objectinuse-error-database-gitlabhq_development_ci-is-being-accessed-by-other-users (from this MR):

  1. cd <GDK_root>
  2. gdk reset-data

Seeding should complete without issue.

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Related to #1527

Edited by Ash McKenzie

Merge request reports

Loading