Skip to content

Draft: Use `gitlab_schema` to parse each query and track failures

What does this MR do and why?

This is based on top of !74076 (merged), which needs to be merged first.

Implements gitlab_schema semantic of config/database.yml as described in #342378 (closed).

This allows to enable and detect if a given connection used uses tables outside of defined schemas.

The idea here is that we hook into ActiveRecord SQL notification and depending on a connection in use we apply a filter on allowed schemas. There's a separate filter for gitlab_primary_schemas and gitlab_replica_schemas allowing to fine tune filtering. How it will be exactly used with #342378 (closed) is yet to define in a next MRs.

Related to:

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 Kamil Trzciński (Back 2025-01-01)

Merge request reports

Loading