-
Dylan Griffith authored
Read more at https://gitlab.com/gitlab-org/gitlab/-/issues/343394 . We are regularly seeing CrossDatabaseModificationAcrossUnsupportedTablesError failures when we call [`Plan.default`](https://gitlab.com/gitlab-org/gitlab/-/blob/ad0085ce21be8d39b7598cb124adee7c75405922/app/models/plan.rb#L13) and/or [`Namespace#actual_plan`](https://gitlab.com/gitlab-org/gitlab/blob/master/ee/app/models/ee/namespace.rb#L180) because both of these methods are lazily creating records. At present we believe this is not strictly a problem that we need to solve since it will is likely totally OK that creating a `plans` record in the middle of a transaction related to `ci_pipelines` is not important to rollback. Even more these lazy creations likely never need to be rolled back anyway so we probably don't need to push these outside the transactions.
e828ba69