summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2021-08-25 17:00:55 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2021-08-25 17:00:55 +0000
commitd491b0fdaba302924c554ab04eefe94d11ad66bd (patch)
tree1366bd8c4f2355e569084d15ece220f41fffe530
parentc30da867dfc78c31d298e4942e65e76338798456 (diff)
downloadgitlab-ce-d491b0fdaba302924c554ab04eefe94d11ad66bd.tar.gz
Add latest changes from gitlab-org/gitlab@14-0-stable-ee
-rw-r--r--app/models/namespace/traversal_hierarchy.rb8
-rw-r--r--config.ru6
-rw-r--r--config/initializers/7_prometheus_metrics.rb3
-rw-r--r--db/post_migrate/20210430121542_backfill_ci_build_trace_sections_for_bigint_conversion.rb3
-rw-r--r--db/post_migrate/20210722110515_revert_backfill_ci_build_trace_sections_for_bigint_conversion.rb16
-rw-r--r--db/schema_migrations/202107221105151
-rw-r--r--doc/administration/geo/replication/disable_geo.md1
-rw-r--r--doc/administration/geo/replication/version_specific_updates.md30
-rw-r--r--locale/gitlab.pot5
-rw-r--r--spec/features/groups/import_export/connect_instance_spec.rb4
10 files changed, 65 insertions, 12 deletions
diff --git a/app/models/namespace/traversal_hierarchy.rb b/app/models/namespace/traversal_hierarchy.rb
index 093b7dae246..34086a8af5d 100644
--- a/app/models/namespace/traversal_hierarchy.rb
+++ b/app/models/namespace/traversal_hierarchy.rb
@@ -36,7 +36,7 @@ class Namespace
SET traversal_ids = cte.traversal_ids
FROM (#{recursive_traversal_ids}) as cte
WHERE namespaces.id = cte.id
- AND namespaces.traversal_ids <> cte.traversal_ids
+ AND namespaces.traversal_ids::bigint[] <> cte.traversal_ids
"""
Namespace.transaction do
@root.lock!
@@ -51,7 +51,7 @@ class Namespace
def incorrect_traversal_ids
Namespace
.joins("INNER JOIN (#{recursive_traversal_ids}) as cte ON namespaces.id = cte.id")
- .where('namespaces.traversal_ids <> cte.traversal_ids')
+ .where('namespaces.traversal_ids::bigint[] <> cte.traversal_ids')
end
private
@@ -66,9 +66,9 @@ class Namespace
<<~SQL
WITH RECURSIVE cte(id, traversal_ids, cycle) AS (
- VALUES(#{root_id}, ARRAY[#{root_id}], false)
+ VALUES(#{root_id}::bigint, ARRAY[#{root_id}]::bigint[], false)
UNION ALL
- SELECT n.id, cte.traversal_ids || n.id, n.id = ANY(cte.traversal_ids)
+ SELECT n.id, cte.traversal_ids || n.id::bigint, n.id = ANY(cte.traversal_ids)
FROM namespaces n, cte
WHERE n.parent_id = cte.id AND NOT cycle
)
diff --git a/config.ru b/config.ru
index ed76239ef2e..ebe719d4b0f 100644
--- a/config.ru
+++ b/config.ru
@@ -9,6 +9,12 @@ def master_process?
end
warmup do |app|
+ # The following is necessary to ensure stale Prometheus metrics don't accumulate over time.
+ # It needs to be done as early as here to ensure metrics files aren't deleted.
+ # After we hit our app in `warmup`, first metrics and corresponding files already being created,
+ # for example in `lib/gitlab/metrics/requests_rack_middleware.rb`.
+ Prometheus::CleanupMultiprocDirService.new.execute if master_process?
+
client = Rack::MockRequest.new(app)
client.get('/')
end
diff --git a/config/initializers/7_prometheus_metrics.rb b/config/initializers/7_prometheus_metrics.rb
index 8dee21016f9..0fbcb7af65b 100644
--- a/config/initializers/7_prometheus_metrics.rb
+++ b/config/initializers/7_prometheus_metrics.rb
@@ -42,9 +42,6 @@ if !Rails.env.test? && Gitlab::Metrics.prometheus_metrics_enabled?
# When running Puma in a Single mode, `on_master_start` and `on_worker_start` are the same.
# Thus, we order these events to run `reinitialize_on_pid_change` with `force: true` first.
Gitlab::Cluster::LifecycleEvents.on_master_start do
- # Ensure that stale Prometheus metrics don't accumulate over time
- Prometheus::CleanupMultiprocDirService.new.execute
-
::Prometheus::Client.reinitialize_on_pid_change(force: true)
if Gitlab::Runtime.puma?
diff --git a/db/post_migrate/20210430121542_backfill_ci_build_trace_sections_for_bigint_conversion.rb b/db/post_migrate/20210430121542_backfill_ci_build_trace_sections_for_bigint_conversion.rb
index f832b06d439..979ce5edfeb 100644
--- a/db/post_migrate/20210430121542_backfill_ci_build_trace_sections_for_bigint_conversion.rb
+++ b/db/post_migrate/20210430121542_backfill_ci_build_trace_sections_for_bigint_conversion.rb
@@ -7,7 +7,8 @@ class BackfillCiBuildTraceSectionsForBigintConversion < ActiveRecord::Migration[
COLUMN = :build_id
def up
- backfill_conversion_of_integer_to_bigint TABLE, COLUMN, batch_size: 15000, sub_batch_size: 100, primary_key: COLUMN
+ # No-op to disable the migration:
+ # backfill_conversion_of_integer_to_bigint TABLE, COLUMN, batch_size: 15000, sub_batch_size: 100, primary_key: COLUMN
end
def down
diff --git a/db/post_migrate/20210722110515_revert_backfill_ci_build_trace_sections_for_bigint_conversion.rb b/db/post_migrate/20210722110515_revert_backfill_ci_build_trace_sections_for_bigint_conversion.rb
new file mode 100644
index 00000000000..840540bb0d4
--- /dev/null
+++ b/db/post_migrate/20210722110515_revert_backfill_ci_build_trace_sections_for_bigint_conversion.rb
@@ -0,0 +1,16 @@
+# frozen_string_literal: true
+
+class RevertBackfillCiBuildTraceSectionsForBigintConversion < ActiveRecord::Migration[6.1]
+ include Gitlab::Database::MigrationHelpers
+
+ TABLE = :ci_build_trace_sections
+ COLUMN = :build_id
+
+ def up
+ revert_backfill_conversion_of_integer_to_bigint TABLE, COLUMN, primary_key: COLUMN
+ end
+
+ def down
+ # no-op
+ end
+end
diff --git a/db/schema_migrations/20210722110515 b/db/schema_migrations/20210722110515
new file mode 100644
index 00000000000..1e4791fc2f9
--- /dev/null
+++ b/db/schema_migrations/20210722110515
@@ -0,0 +1 @@
+c9057cb28d2576551eafe78998023742018fa8351f2e550b7e35832a5509d21c \ No newline at end of file
diff --git a/doc/administration/geo/replication/disable_geo.md b/doc/administration/geo/replication/disable_geo.md
index ba01c55a157..485a5ee1950 100644
--- a/doc/administration/geo/replication/disable_geo.md
+++ b/doc/administration/geo/replication/disable_geo.md
@@ -35,6 +35,7 @@ to do that.
To remove the **primary** site:
+1. [Remove all secondary Geo sites](remove_geo_site.md)
1. On the top bar, select **Menu >** **{admin}** **Admin**.
1. On the left sidebar, select **Geo > Nodes**.
1. Select **Remove** for the **primary** node.
diff --git a/doc/administration/geo/replication/version_specific_updates.md b/doc/administration/geo/replication/version_specific_updates.md
index 301be931b29..83a1545b492 100644
--- a/doc/administration/geo/replication/version_specific_updates.md
+++ b/doc/administration/geo/replication/version_specific_updates.md
@@ -11,6 +11,36 @@ Review this page for update instructions for your version. These steps
accompany the [general steps](updating_the_geo_nodes.md#general-update-steps)
for updating Geo nodes.
+## Updating to GitLab 14.0/14.1
+
+We found an issue where [Primary sites can not be removed from the UI](https://gitlab.com/gitlab-org/gitlab/-/issues/338231).
+
+This bug only exists in the UI and does not block the removal of Primary sites using any other method.
+
+### If you have already updated to an affected version and need to remove your Primary site
+
+You can manually remove the Primary site by using the [Geo Nodes API](../../../api/geo_nodes.md#delete-a-geo-node).
+
+## Updating to GitLab 13.12
+
+We found an issue where [secondary nodes re-download all LFS files](https://gitlab.com/gitlab-org/gitlab/-/issues/334550) upon update. This bug:
+
+- Only applies to Geo secondary sites that have replicated LFS objects.
+- Is _not_ a data loss risk.
+- Causes churn and wasted bandwidth re-downloading all LFS objects.
+- May impact performance for GitLab installations with a large number of LFS files.
+
+If you don't have many LFS objects or can stand a bit of churn, then it is safe to let the secondary sites re-download LFS objects.
+If you do have many LFS objects, or many Geo secondary sites, or limited bandwidth, or a combination of them all, then we recommend you skip GitLab 13.12.0 through 13.12.6 and update to GitLab 13.12.7 or newer.
+
+### If you have already updated to an affected version, and the re-sync is ongoing
+
+You can manually migrate the legacy sync state to the new state column by running the following command in a [Rails console](../../operations/rails_console.md). It should take under a minute:
+
+```ruby
+Geo::LfsObjectRegistry.where(state: 0, success: true).update_all(state: 2)
+```
+
## Updating to GitLab 13.11
We found an [issue with Git clone/pull through HTTP(s)](https://gitlab.com/gitlab-org/gitlab/-/issues/330787) on Geo secondaries and on any GitLab instance if maintenance mode is enabled. This was caused by a regression in GitLab Workhorse. This is fixed in the [GitLab 13.11.4 patch release](https://about.gitlab.com/releases/2021/05/14/gitlab-13-11-4-released/). To avoid this issue, upgrade to GitLab 13.11.4 or later.
diff --git a/locale/gitlab.pot b/locale/gitlab.pot
index edbf027a005..5336eacd856 100644
--- a/locale/gitlab.pot
+++ b/locale/gitlab.pot
@@ -14737,13 +14737,10 @@ msgstr ""
msgid "Geo|Remove node"
msgstr ""
-msgid "Geo|Remove secondary node"
-msgstr ""
-
msgid "Geo|Remove tracking database entry"
msgstr ""
-msgid "Geo|Removing a Geo secondary node stops the synchronization to that node. Are you sure?"
+msgid "Geo|Removing a Geo node stops the synchronization to and from that node. Are you sure?"
msgstr ""
msgid "Geo|Replicated data is verified with the secondary node(s) using checksums"
diff --git a/spec/features/groups/import_export/connect_instance_spec.rb b/spec/features/groups/import_export/connect_instance_spec.rb
index 563c8f429f8..a78fef6ed73 100644
--- a/spec/features/groups/import_export/connect_instance_spec.rb
+++ b/spec/features/groups/import_export/connect_instance_spec.rb
@@ -53,6 +53,10 @@ RSpec.describe 'Import/Export - Connect to another instance', :js do
expect(page).to have_content 'Showing 1-1 of %{total} groups from %{url}' % { url: source_url, total: total }
expect(page).to have_content stub_path
+
+ visit '/'
+
+ wait_for_all_requests
end
end