Skip to content
Snippets Groups Projects
  1. Feb 12, 2018
  2. Feb 08, 2018
    • Gregory Stark's avatar
      Add indexes and change SQL for expired artifacts to deal with artifacts migration efficiently · 271e7a32
      Gregory Stark authored
      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.
      271e7a32
    • Bob Van Landuyt's avatar
      Early migrations populating fork-networks: no-op · 7e00adcc
      Bob Van Landuyt authored
      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.
      7e00adcc
  3. Feb 07, 2018
  4. Feb 06, 2018
  5. Feb 05, 2018
  6. Feb 02, 2018
  7. Feb 01, 2018
  8. Jan 26, 2018
  9. Jan 23, 2018
    • Jan Provaznik's avatar
      Use limit for search count queries · 090ca9c3
      Jan Provaznik authored
      Search query is especially slow if a user searches a generic string
      which matches many records, in such case search can take tens of
      seconds or time out. To speed up the search query, we search only for
      first 1000 records, if there is >1000 matching records we just display
      "1000+" instead of precise total count supposing that with such amount
      the exact count is not so important for the user.
      
      Because for issues even limited search was not fast enough, 2-phase
      approach is used for issues: first we use simpler/faster query to get
      all public issues, if this exceeds the limit, we just return the limit.
      If the amount of matching results is lower than limit, we re-run more
      complex search query (which includes also confidential issues).
      Re-running the complex query should be fast enough in such case because the
      amount of matching issues is lower than limit.
      
      Because exact total_count is now limited, this patch also switches to
      to "prev/next" pagination.
      
      Related #40540
      090ca9c3
  10. Jan 22, 2018
  11. Jan 18, 2018
  12. Jan 17, 2018
  13. Jan 15, 2018
  14. Jan 12, 2018
  15. Jan 11, 2018
  16. Jan 10, 2018
    • Jan Provaznik's avatar
      Denormalize commits count for merge request diffs · e6a1db6d
      Jan Provaznik authored
      For each MR diff an extra 'SELECT COUNT()' is executed
      to get number of commits for the diff. Overall time to get counts for
      all MR diffs may be quite expensive. To speed up loading of MR info,
      information about number of commits is stored in a MR diff's extra column.
      
      Closes #38068
      e6a1db6d
  17. Jan 08, 2018
    • Paco Guzman's avatar
      Avoid adding index if already exists · d2f4e8f9
      Paco Guzman authored
      d2f4e8f9
    • Michael Kozono's avatar
      Backport authorized_keys_enabled defaults to true' · 797fe0a6
      Michael Kozono authored
      Originally from branch 'fix-authorized-keys-enabled-default-2738' via merge request https://gitlab.com/gitlab-org/gitlab-ee/merge_requests/2240
      
      Removed background migrations which were intended to fix state after using Gitlab
      without a default having been set
      
      Squashed commits:
      Locally, if Spring was not restarted, `current_application_settings` was still cached, which prevented the migration from editing the file. This will also ensure that any app server somehow hitting old cache data will properly default this setting regardless.
      Retroactively fix migration
        This allows us to identify customers who ran the broken migration. Their `authorized_keys_enabled` column does not have a default at this point.
        We will fix the column after we fix the `authorized_keys` file.
      Fix authorized_keys file if needed
      Add default to authorized_keys_enabled setting
        Reminder: The original migration was fixed retroactively a few commits ago, so people who did not ever run GitLab 9.3.0 already have a column that defaults to true and disallows nulls. I have tested on PostgreSQL and MySQL that it is safe to run this migration regardless.
        Affected customers who did run 9.3.0 are the ones who need this migration to fix the authorized_keys_enabled column.
        The reason for the retroactive fix plus this migration is that it allows us to run a migration in between to fix the authorized_keys file only for those who ran 9.3.0.
      Tweaks to address feedback
      Extract work into background migration
      Move batch-add-logic to background migration
        Do the work synchronously to avoid multiple workers attempting to add batches of keys at the same time.
        Also, make the delete portion wait until after adding is done.
      Do read and delete work in background migration
      Fix Rubocop offenses
      Add changelog entry
      Inform the user of actions taken or not taken
      Prevent unnecessary `select`s and `remove_key`s
      Add logs for action taken
      Fix optimization
      Reuse `Gitlab::ShellAdapter`
      Guarantee the earliest key
      Fix migration spec for MySQL
      797fe0a6
    • Michael Kozono's avatar
      Backport option to disable writing to `authorized_keys` file · 255a0f85
      Michael Kozono authored
      Originally branch 'mk-toggle-writing-to-auth-keys-1631'
      
      See merge request !2004
      
      Squashed commits:
      Add authorized_keys_enabled to Application Settings
      Ensure default settings are exposed in UI
      Without this change, `authorized_keys_enabled` is unchecked when it is nil, even if it should be checked by default.
      Add “Speed up SSH operations” documentation
      Clarify the reasons for disabling writes
      Add "How to go back" section
      Tweak copy
      Update Application Setting screenshot
      255a0f85
    • Pablo Carranza's avatar
      Backport authorized_keys branch 'find-key-by-fingerprint' · ac86b204
      Pablo Carranza authored
      Add find key by base64 key or fingerprint to the internal API
      
      See merge request !250
      
      Squashed changes:
      Add unique index to fingerprint
      Add new index to schema
      Add internal api to get ssh key by fingerprint
      Change API endpoint to authorized_keys
      Add InsecureKeyFingerprint that calculates the fingerprint without shelling out
      Add require for gitlab key fingerprint
      Remove uniqueness of fingerprint index
      Remove unique option from migration
      Fix spec style in fingerprint test
      Fix rubocop complain
      Extract insecure key fingerprint to separate file
      Change migration to support building index concurrently
      Remove those hideous tabs
      ac86b204
  18. Jan 05, 2018
  19. Jan 04, 2018
  20. Jan 02, 2018
  21. Dec 30, 2017
    • Mario de la Ossa's avatar
      User#projects_limit remove DB default and added NOT NULL constraint · 75cf5f5b
      Mario de la Ossa authored
      This change is required because otherwise if a user is created with a
      value for `projects_limit` that matches the DB default, it gets
      overwritten by `current_application_settings.default_projects_limit`. By
      removing the default we once again can allow a user to be created with a
      limit of 10 projects without the risk that it'll change to 10000
      Unverified
      75cf5f5b
Loading