diff options
author | Michael Kozono <mkozono@gmail.com> | 2019-08-09 00:33:49 +0300 |
---|---|---|
committer | Michael Kozono <mkozono@gmail.com> | 2019-08-09 00:33:49 +0300 |
commit | dd7e932c9bce9872f6d28ad1f08998c9042fbdfd (patch) | |
tree | c493503c360f36e93bc0f9b3a6c63db60638f815 | |
parent | 0e456465d16d23e68096231cf9e45ea1064e9294 (diff) | |
parent | 46441af9b3f6981d3087f505a9de531e1c33fa54 (diff) |
Merge branch '11965-geo-prevent-using-non-empty-tracking-database-ce' into 'master'
CE port of https://gitlab.com/gitlab-org/gitlab-ee/merge_requests/14981
See merge request gitlab-org/gitlab-ce!31493
-rw-r--r-- | db/migrate/20190802195602_add_timestamps_columns_to_geo_nodes.rb | 10 | ||||
-rw-r--r-- | db/schema.rb | 2 | ||||
-rw-r--r-- | doc/administration/geo/replication/troubleshooting.md | 16 |
3 files changed, 27 insertions, 1 deletions
diff --git a/db/migrate/20190802195602_add_timestamps_columns_to_geo_nodes.rb b/db/migrate/20190802195602_add_timestamps_columns_to_geo_nodes.rb new file mode 100644 index 00000000000..b95d9037afe --- /dev/null +++ b/db/migrate/20190802195602_add_timestamps_columns_to_geo_nodes.rb @@ -0,0 +1,10 @@ +# frozen_string_literal: true + +class AddTimestampsColumnsToGeoNodes < ActiveRecord::Migration[5.2] + DOWNTIME = false + + def change + add_column(:geo_nodes, :created_at, :datetime_with_timezone, null: true) + add_column(:geo_nodes, :updated_at, :datetime_with_timezone, null: true) + end +end diff --git a/db/schema.rb b/db/schema.rb index 890f4ab4d8a..0e4a3d07fdd 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -1450,6 +1450,8 @@ ActiveRecord::Schema.define(version: 2019_08_02_235445) do t.string "internal_url" t.string "name", null: false t.integer "container_repositories_max_capacity", default: 10, null: false + t.datetime_with_timezone "created_at" + t.datetime_with_timezone "updated_at" t.index ["access_key"], name: "index_geo_nodes_on_access_key" t.index ["name"], name: "index_geo_nodes_on_name", unique: true t.index ["primary"], name: "index_geo_nodes_on_primary" diff --git a/doc/administration/geo/replication/troubleshooting.md b/doc/administration/geo/replication/troubleshooting.md index 28abfff973d..fe1557fd8b5 100644 --- a/doc/administration/geo/replication/troubleshooting.md +++ b/doc/administration/geo/replication/troubleshooting.md @@ -230,7 +230,7 @@ sudo gitlab-ctl reconfigure This will increase the timeout to three hours (10800 seconds). Choose a time long enough to accommodate a full clone of your largest repositories. -### Reseting Geo **secondary** node replication +### Resetting Geo **secondary** node replication If you get a **secondary** node in a broken state and want to reset the replication state, to start again from scratch, there are a few steps that can help you: @@ -524,6 +524,20 @@ If it doesn't exist or inadvertent changes have been made to it, run `sudo gitla If this path is mounted on a remote volume, please check your volume configuration and that it has correct permissions. +### An existing tracking database cannot be reused + +Geo cannot reuse an existing tracking database. + +It is safest to use a fresh secondary, or reset the whole secondary by following +[Resetting Geo secondary node replication](#resetting-geo-secondary-node-replication). + +If you are not concerned about possible orphaned directories and files, then you +can simply reset the existing tracking database with: + +```sh +sudo gitlab-rake geo:db:reset +``` + ### Geo node has a database that is writable which is an indication it is not configured for replication with the primary node. This error refers to a problem with the database replica on a **secondary** node, |