summaryrefslogtreecommitdiff
path: root/db
Commit message (Collapse)AuthorAgeFilesLines
* Extend Cluster Applications to install GitLab Runner to Kubernetes clusterMayra Cabrera2018-03-012-0/+47
|
* Merge branch '42643-persist-external-ip-of-ingress-controller-gke' into 'master'Kamil Trzciński2018-03-012-0/+10
|\ | | | | | | | | Display ingress IP address in the Kubernetes page See merge request gitlab-org/gitlab-ce!17052
| * Merge branch 'master' into 42643-persist-external-ip-of-ingress-controller-gkeDylan Griffith2018-02-232-1/+23
| |\
| * | Refactor ingress IP address waiting code (#42643)Dylan Griffith2018-02-201-22/+0
| | |
| * | [ci skip] Merge branch 'master' into ↵Filipa Lacerda2018-02-191-1/+0
| |\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 42643-persist-external-ip-of-ingress-controller-gke * master: (114 commits) Fix Error 500 when viewing a commit with a GPG signature in Geo Remember assignee when moving an issue Add changelog entry Allow oxford commas and spaces before commas in MR issue closing pattern. Don't cache a nil repository root ref to prevent caching issues Add back database changes for Ci::Build Revert "Merge branch 'expired-ci-artifacts' into 'master'" Fix order dependencies in some specs migrate admin:users:* to static bundle correct for missing break statement in dispatcher.js alias create and update actions to new and edit migrate projects:merge_requests:edit to static bundle migrate projects:merge_requests:creations:diffs to static bundle migrate projects:merge_requests:creations:new to static bundle migrate projects:issues:new and projects:issues:edit to static bundle migrate projects:branches:index to static bundle migrate projects:branches:new to static bundle migrate projects:compare:show to static bundle migrate projects:environments:metrics to static bundle migrate projects:milestones:* and groups:milestones:* to static bundle ...
| * | | Persist external IP of ingress controller created for GKE (#42643)Dylan Griffith2018-02-152-1/+33
| | | |
* | | | Update schema with latest migrationDmitriy Zaporozhets2018-03-011-2/+2
| | | | | | | | | | | | | | | | Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
* | | | Make project#namespace_id not nulldz-namespace-id-not-nullDmitriy Zaporozhets2018-03-011-0/+29
| | | | | | | | | | | | | | | | Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
* | | | Persist runner IP address on contact (#43489)Dylan Griffith2018-02-282-1/+11
| | | |
* | | | Merge branch 'backstage/gb/build-stages-catch-up-migration' into 'master'Kamil Trzciński2018-02-273-0/+57
|\ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fully migrate build stages again Closes #38756 See merge request gitlab-org/gitlab-ce!15741
| * \ \ \ Merge branch 'master' into 'backstage/gb/build-stages-catch-up-migration'Grzegorz Bizon2018-02-222-1/+23
| |\ \ \ \ | | | |_|/ | | |/| | | | | | | # Conflicts: # db/schema.rb
| * | | | Create index on id instead of stage_id in migrationGrzegorz Bizon2018-02-212-6/+6
| | | | |
| * | | | Separate adding and removing index from stages migrationGrzegorz Bizon2018-02-204-6/+29
| | | | |
| * | | | Add index before going through builds in a migrationGrzegorz Bizon2018-02-201-0/+5
| | | | |
| * | | | Use a helper to schedule pipeline stages migrationGrzegorz Bizon2018-02-161-5/+6
| | | | |
| * | | | Merge branch 'master' into 'backstage/gb/build-stages-catch-up-migration'Grzegorz Bizon2018-02-155-2/+73
| |\ \ \ \ | | | |_|/ | | |/| | | | | | | Conflicts: db/schema.rb
| * | | | Recover from unique constraint violation in stages migrationGrzegorz Bizon2018-02-151-1/+1
| | | | |
| * | | | Schedule pipeline stages migration every 5 minutesGrzegorz Bizon2018-02-131-5/+13
| | | | | | | | | | | | | | | | | | | | [ci skip]
| * | | | Move pipeline stages background migration in timeGrzegorz Bizon2018-02-122-1/+1
| | | | |
| * | | | Merge branch 'master' into backstage/gb/build-stages-catch-up-migrationGrzegorz Bizon2018-02-0937-78/+1165
| |\ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * master: (1480 commits) Conflicts: db/schema.rb
| * | | | | Reduce batch size of stages we schedule for a migrationGrzegorz Bizon2018-01-061-1/+1
| | | | | |
| * | | | | Update background stages migration timestampGrzegorz Bizon2018-01-062-2/+2
| | | | | |
| * | | | | Schedule full build stage migration in the backgroundGrzegorz Bizon2018-01-061-0/+20
| | | | | | | | | | | | | | | | | | | | | | | | For builds that are still missing `stage_id`.
* | | | | | Merge branch 'master' into '29497-pages-custom-domain-dns-verification'Robert Speicher2018-02-231-0/+29
|\ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | # Conflicts: # db/schema.rb
| * | | | | | Optimise searching for users using short queriesYorick Peterse2018-02-222-1/+30
| | |_|_|/ / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This optimises searching for users when using queries consisting out of one or two characters such as "ab". We optimise such cases by searching for `LOWER(name)` and `LOWER(username)` instead of using `ILIKE`. Using `LOWER` produces a _much_ better performing query. For example, when searching for all users matching the term "a" we'd produce the following plan: Limit (cost=637.69..637.74 rows=20 width=805) (actual time=41.983..41.995 rows=20 loops=1) Buffers: shared hit=8330 -> Sort (cost=637.69..638.61 rows=368 width=805) (actual time=41.982..41.990 rows=20 loops=1) Sort Key: (CASE WHEN ((name)::text = 'a'::text) THEN 0 WHEN ((username)::text = 'a'::text) THEN 1 WHEN ((email)::text = 'a'::text) THEN 2 ELSE 3 END), name Sort Method: top-N heapsort Memory: 35kB Buffers: shared hit=8330 -> Bitmap Heap Scan on users (cost=75.47..627.89 rows=368 width=805) (actual time=9.452..41.305 rows=277 loops=1) Recheck Cond: (((name)::text ~~* 'a'::text) OR ((username)::text ~~* 'a'::text) OR ((email)::text = 'a'::text)) Rows Removed by Index Recheck: 7601 Heap Blocks: exact=7636 Buffers: shared hit=8327 -> BitmapOr (cost=75.47..75.47 rows=368 width=0) (actual time=8.290..8.290 rows=0 loops=1) Buffers: shared hit=691 -> Bitmap Index Scan on index_users_on_name_trigram (cost=0.00..38.85 rows=180 width=0) (actual time=4.369..4.369 rows=4071 loops=1) Index Cond: ((name)::text ~~* 'a'::text) Buffers: shared hit=360 -> Bitmap Index Scan on index_users_on_username_trigram (cost=0.00..34.41 rows=188 width=0) (actual time=3.896..3.896 rows=4140 loops=1) Index Cond: ((username)::text ~~* 'a'::text) Buffers: shared hit=328 -> Bitmap Index Scan on users_email_key (cost=0.00..1.94 rows=1 width=0) (actual time=0.022..0.022 rows=0 loops=1) Index Cond: ((email)::text = 'a'::text) Buffers: shared hit=3 Planning time: 3.912 ms Execution time: 42.171 ms With the changes in this commit we now produce the following plan instead: Limit (cost=13257.48..13257.53 rows=20 width=805) (actual time=1.567..1.579 rows=20 loops=1) Buffers: shared hit=287 -> Sort (cost=13257.48..13280.93 rows=9379 width=805) (actual time=1.567..1.572 rows=20 loops=1) Sort Key: (CASE WHEN ((name)::text = 'a'::text) THEN 0 WHEN ((username)::text = 'a'::text) THEN 1 WHEN ((email)::text = 'a'::text) THEN 2 ELSE 3 END), name Sort Method: top-N heapsort Memory: 35kB Buffers: shared hit=287 -> Bitmap Heap Scan on users (cost=135.66..13007.91 rows=9379 width=805) (actual time=0.194..1.107 rows=277 loops=1) Recheck Cond: ((lower((name)::text) = 'a'::text) OR (lower((username)::text) = 'a'::text) OR ((email)::text = 'a'::text)) Heap Blocks: exact=277 Buffers: shared hit=287 -> BitmapOr (cost=135.66..135.66 rows=9379 width=0) (actual time=0.152..0.152 rows=0 loops=1) Buffers: shared hit=10 -> Bitmap Index Scan on yorick_test_users (cost=0.00..124.75 rows=9377 width=0) (actual time=0.101..0.101 rows=277 loops=1) Index Cond: (lower((name)::text) = 'a'::text) Buffers: shared hit=4 -> Bitmap Index Scan on index_on_users_lower_username (cost=0.00..1.94 rows=1 width=0) (actual time=0.035..0.035 rows=1 loops=1) Index Cond: (lower((username)::text) = 'a'::text) Buffers: shared hit=3 -> Bitmap Index Scan on users_email_key (cost=0.00..1.94 rows=1 width=0) (actual time=0.014..0.014 rows=0 loops=1) Index Cond: ((email)::text = 'a'::text) Buffers: shared hit=3 Planning time: 0.303 ms Execution time: 1.687 ms Here we can see the new query is 25 times faster compared to the old query.
* | | | | | Add DNS verification to Pages custom domainsNick Thomas2018-02-239-1/+145
|/ / / / /
* | | | | Simplify down migration.Andreas Brandl2018-02-201-1/+1
| | | | |
* | | | | Add partial index on projects for index-only scans.Andreas Brandl2018-02-202-1/+23
| |_|/ / |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This helps with queries that get project ids based on the - comparably rare - visibility levels 10 and 20. For these, postgres can now leverage the partial index for a index-only scan to improve performance. Example queries: SELECT id FROM projects WHERE visibility_level IN (10,20) SELECT id FROM projects WHERE visibility_level IN (10) For MySQL, this results in a full index on id because MySQL omits the WHERE clause. That is, the index is a duplicate of the primary key basically.
* | | | Remove root user 100 project limit to rely on default 100,00043271-remove-seeded-root-user-project-limitEric Eastwood2018-02-141-1/+0
| |_|/ |/| | | | | | | | See https://gitlab.com/gitlab-org/gitlab-ce/issues/43271
* | | Merge branch 'expired-ci-artifacts' into 'master'Grzegorz Bizon2018-02-142-0/+25
|\ \ \ | | | | | | | | | | | | | | | | Change SQL for expired artifacts to use new ci_job_artifacts.expire_at See merge request gitlab-org/gitlab-ce!16578
| * | | Add indexes and change SQL for expired artifacts to deal with artifacts ↵Greg Stark2018-02-082-0/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | migration efficiently Artifacts are in the middle of being migrated from ci_builds to ci_job_artifacts. The expiration date is currently visible in both of these tables and the test for whether an expired artifact is present for a job is complex as it requires checking both the of the tables. Add two new indexes, one on ci_builds.artifacts_expire_at and one on ci_job_artifacts.expire_at to enable finding expired artifacts efficiently. And until the migration is finished, replace the SQL for finding expired and non-expired artifacts with a hand-crafted UNION ALL based query instead of using OR. This overcomes a database optimizer limitation that prevents it from using these indexes. When the migration is finished the next version should remove this query and replace it with a much simpler query on just ci_job_artifacts. See https://gitlab.com/gitlab-org/gitlab-ce/issues/42561 for followup.
* | | | Merge branch 'mk-fix-no-untracked-upload-files-error' into 'master'Douwe Maan2018-02-132-1/+48
|\ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Resolve "PrepareUntrackedUploads PostgreSQL syntax error" Closes #42881 See merge request gitlab-org/gitlab-ce!17019
| * | | | Schedule PopulateUntrackedUploads if neededMichael Kozono2018-02-122-1/+48
| | |_|/ | |/| | | | | | | | | | | | | | | | | | To finish migrating untracked files to uploads for installations that were affected by https://gitlab.com/gitlab-org/gitlab-ce/issues/42881 Or just to delete the temp table if it is empty and left behind.
* | | | Fix a transient failure in ↵sh-no-cache-populate-migrationRémy Coutable2018-02-121-1/+1
|/ / / | | | | | | | | | | | | | | | db/post_migrate/20170717111152_cleanup_move_system_upload_folder_symlink.rb where symlink already exists Signed-off-by: Rémy Coutable <remy@rymai.me>
* | | Early migrations populating fork-networks: no-opBob Van Landuyt2018-02-082-30/+2
|/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Since populating the fork networks was scheduled multiple times because of bugs that needed to be fixed: - https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/15595/ Creating fork networks for projects that were missing the root of the fork network. - https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/15709 The API allowed creating forked_project_links without fork_network_members. Scheduling this migration multiple times would case it to run concurrently. Which in turn would try to insert the same data into `fork_network_members` causing duplicate key errors. This avoids running the migration multiple times.
* | Backport of LFS File Locking APIrd-35856-backport-lfs-file-locking-apiRubén Dávila2018-02-072-0/+42
| |
* | Merge branch 'fix/gb/fix-redundant-pipeline-stages' into 'master'Kamil Trzciński2018-02-072-1/+67
|\ \ | | | | | | | | | | | | | | | | | | Remove redundant pipeline stages from the database Closes #41769 See merge request gitlab-org/gitlab-ce!16580
| * | Disable statement timeout when removing redundant stagesGrzegorz Bizon2018-02-071-0/+2
| | |
| * | Merge commit '4457cf9d178dc9912fd9c16427ad81b389179d00' into ↵fix/gb/fix-redundant-pipeline-stagesGrzegorz Bizon2018-02-072-1/+36
| |\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | fix/gb/fix-redundant-pipeline-stages * commit '4457cf9d178dc9912fd9c16427ad81b389179d00': (76 commits) Conflicts: spec/services/ci/retry_build_service_spec.rb
| * | | Remove old index after executing a query in stages migrationGrzegorz Bizon2018-02-071-1/+1
| | | | | | | | | | | | | | | | | | | | This makes it possible to heavily optimize this migration, because we need an outdated index to remove redundant stages faster.
| * | | Improve exceptions messages in code creating stagesGrzegorz Bizon2018-02-061-1/+4
| | | |
| * | | Add more specs for unique stages index migrationGrzegorz Bizon2018-02-061-1/+4
| | | |
| * | | Merge branch 'master' into fix/gb/fix-redundant-pipeline-stagesGrzegorz Bizon2018-02-0611-4/+262
| |\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * master: (441 commits) Conflicts: db/schema.rb
| * | | | Fix database schema version to match latest migrationGrzegorz Bizon2018-02-061-1/+1
| | | | |
| * | | | Retry migration removing stages in case of duplicatesGrzegorz Bizon2018-02-051-4/+17
| | | | |
| * | | | Revert create job service because of load balancingGrzegorz Bizon2018-02-052-21/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently we still need to run EnsureStageService within a transaction, because when it runs within in a transaction we are going to stick to the primary database when using database load balancing. Extracting this out of the transaction makes it possible to hit into problems with replication lag in pipeline commit status API, which can cause a lot of trouble.
| * | | | Remove unique index not added in a migration from schemaGrzegorz Bizon2018-01-251-1/+0
| | | | |
| * | | | Fix indentation in migration removing duplicated stagesGrzegorz Bizon2018-01-251-1/+1
| | | | |
| * | | | Fix migration removing duplicate stages on MySQL againGrzegorz Bizon2018-01-251-0/+1
| | | | |
| * | | | Add an unique index on pipeline stage nameGrzegorz Bizon2018-01-252-2/+20
| | | | |