- 07 Nov, 2017 1 commit
-
-
Yorick Peterse authored
This adds the keyword argument "return_ids" to Gitlab::Database.bulk_insert. When set to `true` (and PostgreSQL is used) this method will return an Array of the IDs of the inserted rows, otherwise it will return an empty Array.
-
- 31 Oct, 2017 1 commit
-
-
Alejandro Rodríguez authored
-
- 06 Oct, 2017 1 commit
-
-
Toon Claes authored
In GitLab EE, a GitLab instance can be read-only (e.g. when it's a Geo secondary node). But in GitLab CE it also might be useful to have the "read-only" idea around. So port it back to GitLab CE. Also having the principle of read-only in GitLab CE would hopefully lead to less errors introduced, doing write operations when there aren't allowed for read-only calls. Closes gitlab-org/gitlab-ce#37534.
-
- 29 Aug, 2017 1 commit
-
-
Yorick Peterse authored
This adds a bunch of checks to migrations that may create or drop triggers. Dropping triggers/functions is done using "IF EXISTS" so we don't throw an error if the object in question has already been dropped. We now also raise a custom error (message) when the user does not have TRIGGER privileges. This should prevent the schema from entering an inconsistent state while also providing the user with enough information on how to solve the problem. The recommendation of using SUPERUSER permissions is a bit extreme but we require this anyway (Omnibus also configures users with this permission). Fixes https://gitlab.com/gitlab-org/gitlab-ce/issues/36633
-
- 10 Aug, 2017 1 commit
-
-
Yorick Peterse authored
This changes various controllers to use the new EventCollection class for retrieving events. This class uses a JOIN LATERAL query on PostgreSQL to retrieve queries in a more efficient way, while falling back to a simpler / less efficient query for MySQL. The EventCollection class also includes a limit on the number of events to display to prevent malicious users from cycling through all events, as doing so could put a lot of pressure on the database. JOIN LATERAL is only supported on PostgreSQL starting with version 9.3.0 and as such this optimisation is only used when using PostgreSQL 9.3 or newer.
-
- 26 Jun, 2017 1 commit
-
-
Sean McGivern authored
-
- 16 Jun, 2017 1 commit
-
-
Sean McGivern authored
This adds an ID-less table containing one row per file, per merge request diff. It has a column for each attribute on Gitlab::Git::Diff that is serialised currently, with the advantage that we can easily query the attributes of this new table. It does not migrate existing data, so we have fallback code when the legacy st_diffs column is present instead. For a merge request diff to be valid, it should have at most one of: * Rows in this new table, with the correct merge_request_diff_id. * A non-NULL st_diffs column. It may have neither, if the diff is empty.
-
- 11 Apr, 2017 1 commit
-
-
Tiago Botelho authored
-
- 17 Mar, 2017 1 commit
-
-
Yorick Peterse authored
This returns the ActiveRecord configuration for the current environment. While CE doesn't use this very often, EE will use it in a few places for the database load balancing code. I'm adding this to CE so we don't end up with merge conflicts in this file.
-
- 02 Mar, 2017 1 commit
-
-
Tiago Botelho authored
-
- 22 Feb, 2017 1 commit
-
-
Yorick Peterse authored
This allows you to set a custom host when calling Gitlab::Database.create_connection_pool. This is necessary for load balancing as in this case we want to inherit all settings except for the hostname.
-
- 14 Feb, 2017 1 commit
-
- 13 Feb, 2017 2 commits
-
-
Lin Jen-Shin authored
-
Yorick Peterse authored
We don't need to connect when requesting the name of the database adapter. This in turn should prevent us from requesting/leaking connections just by asking whether we're using PostgreSQL or MySQL.
-
- 06 Feb, 2017 1 commit
-
-
Douwe Maan authored
-
- 25 Nov, 2016 1 commit
-
-
Yorick Peterse authored
When I proposed using serializable transactions I was hoping we would be able to refresh data of individual users concurrently. Unfortunately upon closer inspection it was revealed this was not the case. This could result in a lot of queries failing due to serialization errors, overloading the database in the process (given enough workers trying to update the target table). To work around this we're now using a Redis lease that is cancelled upon completion. This ensures we can update the data of different users concurrently without overloading the database. The code will try to obtain the lease until it succeeds, waiting at least 1 second between retries. This is necessary as we may otherwise end up _not_ updating the data which is not an option.
-
- 18 Nov, 2016 1 commit
-
-
Ahmad Sherif authored
Closes #23150
-
- 19 Jul, 2016 1 commit
-
-
Grzegorz Bizon authored
-
- 18 Jun, 2016 1 commit
-
-
Stan Hu authored
When using #XYZ in Markdown text, if XYZ exceeds the maximum value of a signed 32-bit integer, we get an exception when the Markdown render attempts to run `where(iids: XYZ)`. Introduce a method that will throw out out-of-bounds values. Closes #18777
-
- 16 Jun, 2016 2 commits
-
-
James Lopez authored
This reverts commit 13e37a3e.
-
James Lopez authored
-
- 15 Jun, 2016 1 commit
-
-
Z.J. van de Weg authored
-
- 06 Jun, 2016 1 commit
-
-
Rémy Coutable authored
Signed-off-by: Rémy Coutable <remy@rymai.me>
-
- 03 Jun, 2016 2 commits
-
-
James Lopez authored
This reverts commit 3e991230.
-
James Lopez authored
# Conflicts: # app/models/project.rb
-
- 11 May, 2016 1 commit
-
-
Connor Shea authored
Also fixes the errors caused by enabling the cop. casecmp is more performant than `.downcase` and `==`.
-
- 15 Feb, 2016 1 commit
-
-
Robert Speicher authored
-
- 02 Feb, 2016 1 commit
-
-
Robert Speicher authored
Closes #12900
-
- 10 Dec, 2015 1 commit
-
-
Kamil Trzcinski authored
-
- 22 Oct, 2015 1 commit
-
-
Douwe Maan authored
-
- 07 Oct, 2015 1 commit
-
-
Yorick Peterse authored
These two methods remove the need for manually going into ActiveRecord::Base.connection all over the place.
-