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:49:43 +0300
commitd4d26c44d1372b799946021cb9cbaca9ae84f548 (patch)
tree86072d525a87c6a2a8e2c730c797a02aafcc2862
parent313d9f851237a2236660c9a36a256acda85a2f2f (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 beffaa2af..c8616d348 100644
--- a/internal/praefect/datastore/repository_store.go
+++ b/internal/praefect/datastore/repository_store.go
@@ -615,10 +615,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,