Commit Graph

2128 Commits

Author SHA1 Message Date
Valery Sizov a0ac2d932c Merge branch 'master' of gitlab.com:gitlab-org/gitlab-ce into ff_port_from_ee 2017-10-02 13:15:46 +03:00
Valery Sizov bd68e9add1 [Port semi-linear history from EE] Move migration to CE and `merge_method` method 2017-09-29 19:07:27 +03:00
Rémy Coutable 05e9c9f77e Merge branch '36631-activerecord-statementinvalid-pg-querycanceled-error-canceling-statement-due-to-statement-timeout' into 'master'
Insert at most 1,000 rows at once in MR diff background migration

Closes #36631 et #37505

See merge request gitlab-org/gitlab-ce!13661
2017-09-29 13:43:28 +00:00
Lin Jen-Shin (godfat) 8bac6e41ef Fix notes type created from import 2017-09-29 11:18:58 +00:00
Sean McGivern 472be7fe61 Reschedule merge request diff background migration
The first attempt didn't migrate all rows on GitLab.com, due to a couple of
issues:

1. Some rows in merge_request_diffs had truly huge numbers of commits and diffs
   serialised - one in particular had 26,000 commits!
2. The jobs were sometimes on Sidekiq hosts with frequent OOM errors, leading to
   the job being lost.

The previous commit adds more logging, and a more robust insertion method. This
commit reschedules the jobs, with a generous pause between each.
2017-09-29 11:56:08 +01:00
Sean McGivern ccfe686007 Merge branch 'add-composite-index-on-merge-requests-merge-commit-sha' into 'master'
Add index for merge_requests.merge_commit_sha

Closes #38507

See merge request gitlab-org/gitlab-ce!14549
2017-09-29 08:57:52 +00:00
Eric Eastwood 3468ca835d Merge branch 'master' into ff_port_from_ee
Conflicts:
	app/models/project.rb
	db/schema.rb
2017-09-28 16:59:49 -05:00
Douwe Maan ae03a52f09 Merge branch 'hashed-storage-migration-path' into 'master'
Hashed storage migration path

Closes gitlab-ee#3118

See merge request gitlab-org/gitlab-ce!14067
2017-09-28 17:26:16 +00:00
Markus Koller e9eae3eb0d Support custom attributes on users 2017-09-28 16:49:42 +00:00
Gabriel Mazetto 38607b48b6
[Backported from EE] Readonly flag for Projects
This is used in EE for the storage migration, and we want to use this
in CE as well to be able to migrate projects to hashed_storage.
2017-09-28 13:20:11 +01:00
Yorick Peterse abcfdd5c17
Add index for merge_requests.merge_commit_sha
This is a composite index on (target_project_id, merge_commit_sha, id)
that allows queries such as the following to use a full backwards index
scan:

    SELECT "merge_requests".*
    FROM "merge_requests"
    WHERE "merge_requests"."deleted_at" IS NULL
    AND "merge_requests"."target_project_id" = 13083
    AND "merge_requests"."merge_commit_sha" = 'e80a893ff0ea8466099f6478183631af55933db2'
    ORDER BY "merge_requests"."id" DESC
    LIMIT 1;

Fixes https://gitlab.com/gitlab-org/gitlab-ce/issues/38507
2017-09-28 13:31:28 +02:00
Eric Eastwood 6f9a6d37a9 Merge branch 'master' into ff_port_from_ee 2017-09-26 16:24:54 -05:00
Greg Stark 23b58e5468
Remove an unneeded index on ci_builds left in some databases
Migration 20170919211300_remove_temporary_ci_builds_index.rb created a
temporary partial index and tried to drop it at the end of the
migration. In some circumstances apparently it failed to drop the
index and it ended up in our schema.rb.

This accidentally failed to fail due to a bug in the regular
expression for partial indexes which caused the index creation in
schema.rb to be ignored. Now that that's fixed we could be
resurrecting this zombie index from the past in some but not all
databases.

Add a migration to drop this index if it's present to reconcile this
discrepancy.
2017-09-26 11:33:20 +02:00
Stan Hu edb82271ae Fix PG::UniqueViolation external_email migration
Missing parens prevented this migration from working in some cases.

Closes #38246
2017-09-25 06:17:48 -04:00
Stan Hu 2e564ddfc7 Fix duplicate key errors in PostDeployMigrateUserExternalMailData migration
`email_provider` by default is NULL, and if a user had not logged the
value would remain NULL. Upgrading to GitLab 10.0 would lead to a
PG::UniqueViolation because the post-deploy migration would attempt
to reinsert the entry because the NULL comparison between
`users.email_provider` and `user_synced_attributes_metadata.email_provider`
would never match.

Closes #38246
2017-09-22 22:45:25 -04:00
Nick Thomas 3ce81ec67e Index projects on repository storage 2017-09-21 13:29:25 +01:00
Zeger-Jan van de Weg 24768cb096 Remove depreceted and big projects 2017-09-20 07:42:47 +00:00
Valery Sizov dede5f0188 Backport project.merge_requests_ff_only_enabled field from EE 2017-09-19 23:45:31 -05:00
Stan Hu e5b0f2167d Merge branch 'reoganize-deployment-indexes' into 'master'
Reorganize indexes for the "deployments" table

Closes #36877

See merge request gitlab-org/gitlab-ce!14348
2017-09-19 17:11:59 +00:00
Yorick Peterse 7e69f1889b Merge branch 'fix-rails-migrations-for-partial-indexes' into 'master'
Fix regular expression used for opclasses to not be confused by partial index clause

See merge request gitlab-org/gitlab-ce!14343
2017-09-19 14:11:48 +00:00
Greg Stark 46114fca5d Fix regular expression used for opclasses to not be confused by partial index clause 2017-09-19 11:52:14 +01:00
Yorick Peterse 05a8f401c2
Reorganize indexes for the "deployments" table
This removes the need for a default scope that adds a "WHERE project_id
= X" clause. This commit also includes an additional index for
Environment#last_deployment, ensuring this query uses just an index scan
instead of also applying a Filter.

Fixes https://gitlab.com/gitlab-org/gitlab-ce/issues/36877
2017-09-19 00:39:52 +02:00
Grzegorz Bizon 73d31251af Make sure all stages are migrated after a cleanup 2017-09-18 13:47:46 +02:00
Grzegorz Bizon 9106975d3c Steal stages statuses migration 2017-09-18 13:35:13 +02:00
Douwe Maan 36ad91d75a Merge branch 'mk-delete-conflicting-redirects-mysql' into 'master'
Clean up redirect routes that conflict with regular routes

Closes #36229

See merge request gitlab-org/gitlab-ce!13783
2017-09-18 08:24:52 +00:00
Felipe Artur 25c959f94d Merge branch 'master' into 'issue_37640'
# Conflicts:
#   db/schema.rb
2017-09-15 20:14:53 +00:00
Felipe Artur b20595b2bd Add data migration 2017-09-15 14:45:21 -03:00
Michael Kozono 7b7fb75411 Reduce batch size
…to stay within our query timeout of 60s. Also reduce the job interval to keep the same overall migration time of ~3.3 days.
2017-09-14 14:17:23 -07:00
Michael Kozono c923208721 Spread out the work a little 2017-09-14 14:17:23 -07:00
Michael Kozono ee4f73916f Extract helper for queuing background jobs 2017-09-14 14:17:23 -07:00
Michael Kozono f1e963bd89 Add specs for deleting conflicting redirects 2017-09-14 14:17:23 -07:00
Michael Kozono bedcb7f43d Delete conflicting redirects in background 2017-09-14 14:17:22 -07:00
Yorick Peterse 590ed2ae27
Add missing index for getting recent push events
This index is required to allow fast retrieval of recent push events
without merge requests. Without this index in place the query would
lead to PostgreSQL scanning over 150 000 index entries all the time,
easily taking up between 200 and 500 milliseconds. This index
reduces the time spent in this process to around 40 milliseconds on
GitLab.com.
2017-09-14 21:29:46 +02:00
Stan Hu 06b1e8ec9a Merge branch 'ci-environment-status-performance' into 'master'
Constrain environment deployments to project IDs

Closes #36877

See merge request gitlab-org/gitlab-ce!14252
2017-09-14 18:34:59 +00:00
Robert Speicher 652a9324a1 Revert "Merge branch 'rs-remove-bad-foreground-migration' into 'master'"
This reverts merge request !14240
2017-09-13 15:09:51 +00:00
Yorick Peterse 9230caa907
Disallow NULL values for environments.project_id 2017-09-13 15:17:42 +02:00
Robert Speicher faefeac880 Remove db/migrate/20170828135939_migrate_user_external_mail_data.rb
This file is a duplicate of a post-deploy migration and appears to have
been left in by mistake.

Looping through the Users table in a foreground migration would've been
a bad idea.

[ci skip]
2017-09-12 18:23:07 -04:00
Robert Speicher e21c12375a Merge branch 'revert-2f46c3a8' into 'master'
Revert "Merge branch 'revert-f2421b2b' into 'master'"

See merge request !14190
2017-09-12 18:31:54 +00:00
Annabel Dunstone Gray 9b177bb7c9 Revert "Merge branch 'revert-f2421b2b' into 'master'"
This reverts merge request !14148
2017-09-11 15:44:42 +00:00
Yorick Peterse 1e1c075d30
Reset primary keys after swapping events tables
This is required as otherwise newly created events will start with the
wrong ID.
2017-09-11 15:52:30 +02:00
Rubén Dávila 52a2423e37 Revert "Merge branch '35012-navigation-add-option-to-change-navigation-color-palette' into 'master'"
This reverts merge request !13619
2017-09-08 14:48:44 +00:00
Yorick Peterse 293cbdc997 Merge branch 'jk-update-schema' into 'master'
Update db schema to correspond with migrations

See merge request !14115
2017-09-07 22:47:22 +00:00
Jarka Kadlecova 23d8db3922 Update db schema to correspond with migrations 2017-09-07 18:16:47 +02:00
Kamil Trzcinski 12ddc28f84 Merge remote-tracking branch 'origin/master' into zj/gitlab-ce-zj-auto-devops-table 2017-09-07 18:03:20 +02:00
Sean McGivern f2421b2b97 Merge branch '35012-navigation-add-option-to-change-navigation-color-palette' into 'master'
Add option to change navigation color palette

Closes #35012

See merge request !13619
2017-09-07 15:56:00 +00:00
Sean McGivern 4ae8e20c9c Merge branch 'events-migration-cleanup' into 'master'
Finish migration to the new events setup

Closes #37241

See merge request !13932
2017-09-07 15:33:54 +00:00
Yorick Peterse e814e18209 Merge branch 'dz-rebuild-schema' into 'master'
Update schema.rb from db:migrate and fix invalid index check

See merge request !14107
2017-09-07 15:15:09 +00:00
Zeger-Jan van de Weg 62a5cc7134
Merge branch 'master' into zj-auto-devops-table 2017-09-07 15:20:04 +02:00
Zeger-Jan van de Weg 492eaece7e
Fix ordering of columns on new table 2017-09-07 13:53:30 +02:00
Dmitriy Zaporozhets d931cac7a3
Update schema.rb from db:migrate and fix invalid index check
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2017-09-07 14:11:49 +03:00