Skip to content

Get correct gitlab_schema_from_context in BBM ensure

What does this MR do and why?

Get correct gitlab_schema_from_context in BBM ensure

This is related to an issue we discovered in !139353 (merged) in which we noticed that the ensure_batched_background_migration_is_finished method is getting the gitlab_schema by using Gitlab::Database.gitlab_schemas_for_connection(connection) but it then calls finalize_batched_background_migration which uses gitlab_schema_from_context.

The gitlab_schema_from_context is the right way to do this and is what is used in the rest of the file. Deriving the schema from the connection may work sometimes but it's going to cause problems as we start adding more gitlab_schema: gitlab_main_cell because these will be using the same connection as gitlab_main but the schema is not the same.

This is also related to a documentation clarification in !139873 (merged)

Screenshots or screen recordings

Screenshots are required for UI changes, and strongly recommended for all other merge requests.

Before After

How to set up and validate locally

Numbered steps to set up and validate the change are strongly suggested.

MR acceptance checklist

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

Edited by Hordur Freyr Yngvason

Merge request reports