Commit 0065a254 authored by Brett Walker's avatar Brett Walker Committed by Stan Hu

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

parent 9562cd14
---
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 @@ ...@@ -11,7 +11,7 @@
# #
# It's strongly recommended that you check this file into your version control system. # 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 # These are extensions that must be enabled in order to support this database
enable_extension "plpgsql" enable_extension "plpgsql"
...@@ -992,7 +992,7 @@ ActiveRecord::Schema.define(version: 20180131104538) do ...@@ -992,7 +992,7 @@ ActiveRecord::Schema.define(version: 20180131104538) do
t.string "status_message" t.string "status_message"
t.integer "replication_slots_count" t.integer "replication_slots_count"
t.integer "replication_slots_used_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_count"
t.integer "wikis_synced_count" t.integer "wikis_synced_count"
t.integer "wikis_failed_count" t.integer "wikis_failed_count"
......
...@@ -379,6 +379,13 @@ describe GeoNodeStatus, :geo do ...@@ -379,6 +379,13 @@ describe GeoNodeStatus, :geo do
expect(subject.replication_slots_max_retained_wal_bytes).to eq(2.megabytes) expect(subject.replication_slots_max_retained_wal_bytes).to eq(2.megabytes)
end 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 end
describe '#last_event_id and #last_event_date' do 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