Commit f18c75c0 authored by Stan Hu's avatar Stan Hu

Merge branch '4773-replication-slots-max-retained-wal-bytes-too-small' into 'master'

Resolve "Error 500 loading status of Geo primary node when replication lag is high"

Closes #4773

See merge request gitlab-org/gitlab-ee!4347
parents 9562cd14 0065a254
---
title: Fix 500 errors caused by large replication slot wal retention
merge_request: 4347
author:
type: fixed
class ChangeGeoNodeStatusColumnSize < ActiveRecord::Migration
include Gitlab::Database::MigrationHelpers
# Set this constant to true if this migration requires downtime.
DOWNTIME = false
def up
change_column :geo_node_statuses, :replication_slots_max_retained_wal_bytes, :integer, limit: 8
end
def down
change_column :geo_node_statuses, :replication_slots_max_retained_wal_bytes, :integer, limit: 4
end
end
......@@ -11,7 +11,7 @@
#
# It's strongly recommended that you check this file into your version control system.
ActiveRecord::Schema.define(version: 20180131104538) do
ActiveRecord::Schema.define(version: 20180201101405) do
# These are extensions that must be enabled in order to support this database
enable_extension "plpgsql"
......@@ -992,7 +992,7 @@ ActiveRecord::Schema.define(version: 20180131104538) do
t.string "status_message"
t.integer "replication_slots_count"
t.integer "replication_slots_used_count"
t.integer "replication_slots_max_retained_wal_bytes"
t.integer "replication_slots_max_retained_wal_bytes", limit: 8
t.integer "wikis_count"
t.integer "wikis_synced_count"
t.integer "wikis_failed_count"
......
......@@ -379,6 +379,13 @@ describe GeoNodeStatus, :geo do
expect(subject.replication_slots_max_retained_wal_bytes).to eq(2.megabytes)
end
it 'handles large values' do
stub_current_geo_node(primary)
allow(primary).to receive(:replication_slots_max_retained_wal_bytes).and_return(900.gigabytes)
expect(subject.replication_slots_max_retained_wal_bytes).to eq(900.gigabytes)
end
end
describe '#last_event_id and #last_event_date' do
......
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