summaryrefslogtreecommitdiff
path: root/lib/gitlab/database.rb
Commit message (Collapse)AuthorAgeFilesLines
* removes redundant code from database.rb29056-backport-ee-cleanup-database-fileTiago Botelho2017-04-111-4/+4
|
* Added Gitlab::Database.configYorick Peterse2017-03-171-1/+5
| | | | | | | | 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.
* removes redundant code from gitlab database filegitlab-database-fixTiago Botelho2017-03-021-3/+3
|
* Allow setting of a custom connection pool hostYorick Peterse2017-02-221-1/+6
| | | | | | | 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.
* Merge branch 'create-connection-pool' into 'master' Yorick Peterse2017-02-141-0/+25
|\ | | | | | | | | Introduce Gitlab::Database.with_connection_pool See merge request !9192
| * Only ensure against yield so that pool should be availablecreate-connection-poolLin Jen-Shin2017-02-141-4/+5
| | | | | | | | | | Feedback: https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/9192#note_23293693
| * Have some simple way to create connection poolLin Jen-Shin2017-02-141-0/+24
| |
* | Don't connect in Gitlab::Database.adapter_namefix-ar-connection-leaksYorick Peterse2017-02-131-1/+1
|/ | | | | | 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.
* Improve performance of finding last deployed environmentDouwe Maan2017-02-061-0/+14
|
* Refresh project authorizations using a Redis leaserefresh-authorizations-with-leaseYorick Peterse2016-11-251-7/+0
| | | | | | | | | | | | | | | | | 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.
* Precalculate user's authorized projects in databaseAhmad Sherif2016-11-181-0/+7
| | | | Closes #23150
* Fix methods visibility in gitlab database moduleGrzegorz Bizon2016-07-191-2/+4
|
* Fix RangeError exceptions when referring to issues or merge requests outside ↵Stan Hu2016-06-181-0/+5
| | | | | | | | | | of max database values 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
* Random selection now also works for MySQLseed-fu-award-emojiZ.J. van de Weg2016-06-151-0/+4
|
* Improve Issuable.order_labels_priorityRémy Coutable2016-06-061-0/+14
| | | | Signed-off-by: Rémy Coutable <remy@rymai.me>
* Enable Rubocop Casecmp Performance Cop.Connor Shea2016-05-101-2/+2
| | | | Also fixes the errors caused by enabling the cop. casecmp is more performant than `.downcase` and `==`.
* Fix undefined method `postgresql?` during migrationrs-gitlab-database-moduleRobert Speicher2016-02-151-6/+2
|
* Display database type and version in Administration dashboardrs-database-infoRobert Speicher2016-02-021-6/+32
| | | | Closes #12900
* Migrate CI WebHooks and Emails to new tablesKamil Trzcinski2015-12-101-0/+18
|
* Fix Gitlab::Database#mysql?Douwe Maan2015-10-221-1/+1
|
* Added methods for detecting MySQL/PostgreSQLYorick Peterse2015-10-071-0/+11
These two methods remove the need for manually going into ActiveRecord::Base.connection all over the place.