Skip to content
Snippets Groups Projects
Commit c8f5d0ab authored by Valery Sizov's avatar Valery Sizov
Browse files

Merge remote-tracking branch 'origin/master' into pitr

parents 39b2465d 95190f59
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -124,11 +124,11 @@ module Geo
settings = built_recovery_setting_for_pitr(lsn)
 
if postgresql_version >= 12
puts "* PostgreSQL 12 or newer. Writing settings to postgresql.conf".color(:green)
puts "PostgreSQL 12 or newer. Writing settings to postgresql.conf...".color(:green)
 
write_geo_config_file(settings)
else
puts "* Writing recovery.conf".color(:green)
puts "Writing recovery.conf...".color(:green)
 
write_recovery_conf(settings)
end
Loading
Loading
Loading
Loading
@@ -19,26 +19,26 @@ require "#{base_path}/embedded/service/omnibus-ctl-ee/lib/geo/promote_to_primary
#
 
add_command_under_category('promote-to-primary-node', 'gitlab-geo', 'Promote to primary node', 2) do |cmd_name, *args|
Geo::PromoteToPrimaryNode.new(self, get_ctl_options).execute
end
def get_ctl_options
options = {}
OptionParser.new do |opts|
opts.banner = "Usage: gitlab-ctl promote-to-primary-node [options]"
 
def get_ctl_options
options = {}
OptionParser.new do |opts|
opts.banner = "Usage: gitlab-ctl promote-to-primary-node [options]"
opts.on('-p', '--[no-]confirm-primary-is-down', 'Do not ask for confirmation that primary is down') do |p|
options[:confirm_primary_is_down] = p
end
 
opts.on('-p', '--[no-]confirm-primary-is-down', 'Do not ask for confirmation that primary is down') do |p|
options[:confirm_primary_is_down] = p
end
opts.on('-m', '--skip-preflight-checks', 'Perform promotion without running any preflight checks') do |m|
options[:skip_preflight_checks] = m
end
 
opts.on('-m', '--skip-preflight-checks', 'Perform promotion without running any preflight checks') do |m|
options[:skip_preflight_checks] = m
end
opts.on('-f', '--force', 'Proceed even if preflight checks fail') do |f|
options[:force] = f
end
end.parse!(ARGV.dup)
 
opts.on('-f', '--force', 'Proceed even if preflight checks fail') do |f|
options[:force] = f
end
end.parse!(ARGV.dup)
options
end
 
options
Geo::PromoteToPrimaryNode.new(self, get_ctl_options).execute
end
require "#{base_path}/embedded/service/omnibus-ctl-ee/lib/geo/promotion_preflight_checks"
 
add_command_under_category('promotion-preflight-checks', 'gitlab-geo', 'Run preflight checks for promotion to primary node', 2) do |cmd_name, *args|
Geo::PromotionPreflightChecks.new(base_path, get_ctl_options).execute
end
def get_ctl_options
options = {}
OptionParser.new do |opts|
opts.banner = "Usage: gitlab-ctl promotion-preflight-checks [options]"
 
def get_ctl_options
options = {}
OptionParser.new do |opts|
opts.banner = "Usage: gitlab-ctl promotion-preflight-checks [options]"
opts.on('-p', '--[no-]confirm-primary-is-down', 'Do not ask for confirmation that primary is down') do |p|
options[:confirm_primary_is_down] = p
end
end.parse!(ARGV.dup)
 
opts.on('-p', '--[no-]confirm-primary-is-down', 'Do not ask for confirmation that primary is down') do |p|
options[:confirm_primary_is_down] = p
end
end.parse!(ARGV.dup)
options
end
 
options
Geo::PromotionPreflightChecks.new(base_path, get_ctl_options).execute
end
Loading
Loading
@@ -65,7 +65,7 @@ RSpec.describe Geo::PromoteToPrimaryNode, '#execute' do
expect(command).to receive(:write_recovery_conf)
 
expect { command.execute }.to output(
/\* Writing recovery.conf/).to_stdout
/Writing recovery.conf/).to_stdout
end
end
 
Loading
Loading
@@ -75,7 +75,7 @@ RSpec.describe Geo::PromoteToPrimaryNode, '#execute' do
expect(command).to receive(:write_geo_config_file)
 
expect { command.execute }.to output(
/\* PostgreSQL 12 or newer. Writing settings to postgresql.conf/).to_stdout
/PostgreSQL 12 or newer. Writing settings to postgresql.conf/).to_stdout
end
end
end
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment