Add Geo replication for Pages (no verification) [RUN ALL RSPEC] [RUN AS-IF-FOSS]
What does this MR do?
Adds Geo replication for GitLab Pages deployments via the Geo self-service framework.
Closes #331931 (closed)
Screenshots or Screencasts (strongly suggested)
How to setup and validate locally (strongly suggested)
- Set up GDK with Runner and Pages enabled and configured.
- Set up a second GDK Geo instance
- Enable feature flag with
Feature.enable(:geo_pages_deployment_replication)
in Rails console - Create a GitLab Pages project and deploy a Pages site.
- Visit the Geo Sites Dashboard and validate that the Pages deployment was replicated.
- If you configure the secondary to serve Pages sites, you should also be able to view the site from the secondary.
Does this MR meet the acceptance criteria?
Conformity
-
I have included changelog trailers, or none are needed. (Does this MR need a changelog?) -
I have added/updated documentation, or it's not needed. (Is documentation required?) -
I have properly separated EE content from FOSS, or this MR is FOSS only. (Where should EE code go?) -
I have added information for database reviewers in the MR description, or it's not needed. (Does this MR have database related changes?) -
I have self-reviewed this MR per code review guidelines. -
This MR does not harm performance, or I have asked a reviewer to help assess the performance impact. (Merge request performance guidelines) -
I have followed the style guides. -
This change is backwards compatible across updates, or this does not apply.
Availability and Testing
-
I have added/updated tests following the Testing Guide, or it's not needed. (Consider all test levels. See the Test Planning Process.) -
I have tested this MR in all supported browsers, or it's not needed. -
I have informed the Infrastructure department of a default or new setting change per definition of done, or it's not needed.
Security
Does this MR contain changes to processing or storing of credentials or tokens, authorization and authentication methods or other items described in the security review guidelines? If not, then delete this Security section.
-
Label as security and @ mention @gitlab-com/gl-security/appsec
-
The MR includes necessary changes to maintain consistency between UI, API, email, or other methods -
Security reports checked/validated by a reviewer from the AppSec team
Database Review
`rake geo:db:migrate`
```shell == 20210709162057 CreatePagesDeploymentRegistry: migrating ==================== -- table_exists?(:pages_deployment_registry) -> 0.0004s -- create_table(:pages_deployment_registry, {:id=>:bigserial, :force=>:cascade}) -> 0.0268s == 20210709162057 CreatePagesDeploymentRegistry: migrated (0.0284s) =========== ````rake geo:db:rollback`
```shell == 20210709162057 CreatePagesDeploymentRegistry: reverting ==================== -- drop_table(:pages_deployment_registry) -> 0.0181s == 20210709162057 CreatePagesDeploymentRegistry: reverted (0.0182s) =========== ````PagesDeployment.replicables_for_current_secondary`
Query:
SELECT
"pages_deployments".*
FROM
"pages_deployments"
WHERE
"pages_deployments"."id" BETWEEN 1 AND 1000
AND "pages_deployments"."file_store" = 1
Plan:
Index Scan using index_pages_deployments_on_file_store_and_id on public.pages_deployments (cost=0.42..2.60 rows=1 width=133) (actual time=10.949..10.950 rows=0 loops=1)
Index Cond: ((pages_deployments.file_store = 1) AND (pages_deployments.id >= 1) AND (pages_deployments.id <= 1000))
Buffers: shared hit=6 read=3
I/O Timings: read=10.815 write=0.000
`PagesDeploymentRegistryFinder`
Query:
SELECT
"pages_deployment_registry".*
FROM
"pages_deployment_registry"
ORDER BY
"pages_deployment_registry"."id" ASC
Plan:
QUERY PLAN
----------------------------------------------------------------------------------
Sort (cost=1.05..1.06 rows=3 width=1170)
Sort Key: id
-> Seq Scan on pages_deployment_registry (cost=0.00..1.03 rows=3 width=1170)
(3 rows)
Edited by Nick Nguyen