Commit a2475b60 authored by Catalin Irimie's avatar Catalin Irimie

Consolidates duplicate promote error in Geo troubleshooting docs

There are two duplicate sections in the troubleshooting docs for
the same error when promoting a paused secondary, this converges
the two in a single section and a single solution.
parent 594b072d
......@@ -100,7 +100,7 @@ Note the following when promoting a secondary:
- If replication was paused on the secondary node, for example as a part of upgrading,
while you were running a version of GitLab lower than 13.4, you _must_
[enable the node via the database](../replication/troubleshooting.md#while-promoting-the-secondary-i-got-an-error-activerecordrecordinvalid)
[enable the node via the database](../replication/troubleshooting.md#message-activerecordrecordinvalid-validation-failed-enabled-geo-primary-node-cannot-be-disabled)
before proceeding.
- A new **secondary** should not be added at this time. If you want to add a new
**secondary**, do this after you have completed the entire process of promoting
......
......@@ -614,46 +614,17 @@ or `gitlab-ctl promote-to-primary-node`, either:
### Message: ActiveRecord::RecordInvalid: Validation failed: Enabled Geo primary node cannot be disabled
This error may occur if you have paused replication from the original primary node before attempting to promote this node.
To double check this, you can do the following:
- Get the current secondary node's ID using:
```shell
sudo gitlab-rails runner 'puts GeoNode.current_node.id'
```
- Double check that the node is active through the database by running the following
on the secondary node, replacing `ID_FROM_ABOVE`:
```shell
sudo gitlab-rails dbconsole
SELECT enabled FROM geo_nodes WHERE id = ID_FROM_ABOVE;
```
- If the above returned `f` it means that the replication was paused.
You can re-enable it through an `UPDATE` statement in the database:
```shell
sudo gitlab-rails dbconsole
UPDATE geo_nodes SET enabled = 't' WHERE id = ID_FROM_ABOVE;
```
### While Promoting the secondary, I got an error `ActiveRecord::RecordInvalid`
If you disabled a secondary node, either with the [replication pause task](../index.md#pausing-and-resuming-replication)
(13.2) or via the UI (13.1 and earlier), you must first re-enable the
node before you can continue. This is fixed in 13.4.
From `gitlab-psql`, execute the following, replacing `<your secondary url>`
with the URL for your secondary server starting with `http` or `https` and ending with a `/`.
Execute the following, replacing `<your secondary url>` with the URL for your secondary
server, using `http` or `https` and ending with a `/`.
```shell
SECONDARY_URL="https://<secondary url>/"
DATABASE_NAME="gitlabhq_production"
sudo gitlab-psql -d "$DATABASE_NAME" -c "UPDATE geo_nodes SET enabled = true WHERE url = '$SECONDARY_URL';"
sudo gitlab-rails dbconsole
UPDATE geo_nodes SET enabled = true WHERE url = 'https://<secondary url>/';"
```
This should update 1 row.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment