Retried in database
What does this MR do?
This stores latest in the database. We update in transaction information about whether the build is latest. We don't need an index on that column, as we aim for 99% builds to be latest (retry is usually an exception).
This greatly simplifies and fastens a lot of SQL queries and job-stage-related views.
Supersedes https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/10721 as we also need to run MySQL tests.
Are there points in the code the reviewer needs to double check?
Why was this MR needed?
Screenshots (if relevant)
Does this MR meet the acceptance criteria?
-
Changelog entry added, if necessary -
Documentation created/updated -
API support added - Tests
-
Added for this feature/bug -
All builds are passing
-
-
Conform by the merge request performance guides -
Conform by the style guides -
Branch has no merge conflicts with master
(if it does - rebase it please) -
Squashed related commits together
What are the relevant issue numbers?
Closes #25737 (closed)
Merge request reports
Activity
added 80 commits
-
7a1d143d...a5347fe5 - 79 commits from branch
master
- 52ad0782 - Merge remote-tracking branch 'origin/master' into retried-in-database-mysql
-
7a1d143d...a5347fe5 - 79 commits from branch
added 80 commits
-
7a1d143d...a5347fe5 - 79 commits from branch
master
- 52ad0782 - Merge remote-tracking branch 'origin/master' into retried-in-database-mysql
-
7a1d143d...a5347fe5 - 79 commits from branch
mentioned in merge request !10721 (closed)
- Resolved by Kamil Trzcińśki
- Resolved by Kamil Trzcińśki
- Resolved by Kamil Trzcińśki
- Resolved by Kamil Trzcińśki
assigned to @ayufan
added 11 commits
-
4557d08f...729c006f - 8 commits from branch
master
- bcc5a482 - Merge remote-tracking branch 'origin/master' into retried-in-database
- 89f0d0d7 - Update migrations
- 4d6a525a - Merge branch 'retried-in-database' into retried-in-database-mysql
Toggle commit list-
4557d08f...729c006f - 8 commits from branch
assigned to @yorickpeterse
@ayufan Could you rebase the various commits down to a smaller number? This way we get rid of any intermediate commits (e.g. the removal of binding.pry).
added 18 commits
-
4d6a525a...d4733aa0 - 17 commits from branch
master
- e3cb2719 - Store retried in database for CI builds
-
4d6a525a...d4733aa0 - 17 commits from branch
added 69 commits
-
582d137c...1bf9f012 - 68 commits from branch
master
- 12778989 - Merge branch 'master' into 'retried-in-database-mysql'
-
582d137c...1bf9f012 - 68 commits from branch
added 177 commits
-
c608508e...56fb7823 - 176 commits from branch
master
- 852baef8 - Store retried in database for CI builds
-
c608508e...56fb7823 - 176 commits from branch
added 177 commits
-
c608508e...56fb7823 - 176 commits from branch
master
- 852baef8 - Store retried in database for CI builds
-
c608508e...56fb7823 - 176 commits from branch
added 8 commits
-
852baef8...8c911468 - 7 commits from branch
master
- 4713f036 - Store retried in database for CI builds
-
852baef8...8c911468 - 7 commits from branch
added 50 commits
-
4713f036...6ad3814e - 49 commits from branch
master
- f2a4420d - Store retried in database for CI builds
-
4713f036...6ad3814e - 49 commits from branch
mentioned in issue #31934 (closed)
assigned to @smcgivern
- Resolved by Kamil Trzcińśki
- Resolved by Kamil Trzcińśki
assigned to @ayufan
assigned to @smcgivern
mentioned in issue #32015 (moved)
- Resolved by username-removed-443319
@ayufan thanks, one typo.
If this is to be picked into stable, please follow https://gitlab.com/gitlab-org/gitlab-ce/blob/master/PROCESS.md#after-the-7th and ensure the RMs are OK with this!
assigned to @ayufan
What is the status here @ayufan ?
😄 @selfup Fixed.
assigned to @smcgivern
@smcgivern They are.
enabled an automatic merge when the pipeline for 015ea79c succeeds
- Resolved by Kamil Trzcińśki
assigned to @ayufan
enabled an automatic merge when the pipeline for 7eaab72b succeeds
Retrying pipeline. Docker failures :/
Edited by username-removed-642931This requires an EE MR to fix the compact check
Cannot merge until both are passing
🤔 Edited by username-removed-642931mentioned in commit 81df0034
mentioned in commit 0e175cf9
mentioned in issue #32146 (closed)
I believe this is causing the following error when using MySQL
sudo -u git -H bundle exec rake db:migrate RAILS_ENV=production == 20170503004427 UpateRetriedForCiBuild: migrating =========================== -- exec_query("SELECT COUNT(*) AS count FROM `ci_builds` WHERE `ci_builds`.`retried` IS NULL") -> 0.0021s -- exec_query("SELECT `ci_builds`.`id` FROM `ci_builds` WHERE `ci_builds`.`retried` IS NULL ORDER BY `ci_builds`.`id` ASC LIMIT 1") -> 0.0003s -- exec_query("SELECT `ci_builds`.`id` FROM `ci_builds` WHERE `ci_builds`.`id` >= 1 AND `ci_builds`.`retried` IS NULL ORDER BY `ci_builds`.`id` ASC LIMIT 1 OFFSET 230") -> 0.0004s -- execute("UPDATE `ci_builds` SET `retried` = ((SELECT MAX(ci_builds2.id)\n FROM ci_builds ci_builds2\n WHERE ci_builds.commit_id=ci_builds2.commit_id\n AND ci_builds.name=ci_builds2.name\n) != ci_builds.id) WHERE `ci_builds`.`id` >= 1 AND `ci_builds`.`id` < 231 AND `ci_builds`.`retried` IS NULL") rake aborted! StandardError: An error has occurred, all later migrations canceled: Mysql2::Error: You can't specify target table 'ci_builds' for update in FROM clause: UPDATE `ci_builds` SET `retried` = ((SELECT MAX(ci_builds2.id) FROM ci_builds ci_builds2 WHERE ci_builds.commit_id=ci_builds2.commit_id AND ci_builds.name=ci_builds2.name ) != ci_builds.id) WHERE `ci_builds`.`id` >= 1 AND `ci_builds`.`id` < 231 AND `ci_builds`.`retried` IS NULL/home/git/gitlab/vendor/bundle/ruby/2.3.0/gems/activerecord-4.2.8/lib/active_record/connection_adapters/abstract_mysql_adapter.rb:309:in `query'
Happy to provide more information if needed. Thanks
mentioned in issue #32647 (closed)
mentioned in issue #32677 (closed)
mentioned in issue gitlab#9734