Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitaly.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPatrick Steinhardt <psteinhardt@gitlab.com>2021-11-22 14:02:47 +0300
committerPatrick Steinhardt <psteinhardt@gitlab.com>2021-11-22 14:50:17 +0300
commit7d792f5faf5aa5d46a112ab08197242d83f5ccba (patch)
treed9121235805ceb2f10304dd90cb8f4db3d6f6ef6
parent650cb6e64c077ac89f8e8c4f175f602b504ef143 (diff)
datastore: Revert use of materialized views
Revert the introduction of materialized views for `valid_primaries`. As it turns out, the changes cause incompatibilities with Postgres 11, which is still actively in use. Furthermore, the performance issues we have seen have not been fully fixed with this change, and we do not yet fully understand the root cause for this. Changelog: fixed
-rw-r--r--internal/praefect/datastore/collector.go5
-rw-r--r--internal/praefect/datastore/repository_store.go4
2 files changed, 0 insertions, 9 deletions
diff --git a/internal/praefect/datastore/collector.go b/internal/praefect/datastore/collector.go
index 40390b47a..c0184d17f 100644
--- a/internal/praefect/datastore/collector.go
+++ b/internal/praefect/datastore/collector.go
@@ -78,11 +78,6 @@ func (c *RepositoryStoreCollector) Collect(ch chan<- prometheus.Metric) {
// they are either unhealthy or out of date.
func (c *RepositoryStoreCollector) queryMetrics(ctx context.Context) (map[string]int, error) {
rows, err := c.db.QueryContext(ctx, `
-WITH valid_primaries AS MATERIALIZED (
- SELECT virtual_storage, relative_path
- FROM valid_primaries
-)
-
SELECT virtual_storage, COUNT(*)
FROM repositories
WHERE NOT EXISTS (
diff --git a/internal/praefect/datastore/repository_store.go b/internal/praefect/datastore/repository_store.go
index 3d68ea7de..556cc0108 100644
--- a/internal/praefect/datastore/repository_store.go
+++ b/internal/praefect/datastore/repository_store.go
@@ -651,10 +651,6 @@ func (rs *PostgresRepositoryStore) GetPartiallyAvailableRepositories(ctx context
// than the assigned ones.
//
rows, err := rs.db.QueryContext(ctx, `
-WITH valid_primaries AS MATERIALIZED (
- SELECT * FROM valid_primaries
-)
-
SELECT
json_build_object (
'RelativePath', relative_path,