276
276
elsif @instance_type == :patroni_standby_leader
277
277
patroni_standby_leader_upgrade
278
278
end
279
- elsif @roles . include? ( 'geo-primary ' )
279
+ elsif @roles . include? ( 'geo_primary ' )
280
280
log 'Detected a GEO primary node'
281
281
@instance_type = :geo_primary
282
282
general_upgrade
283
- elsif @roles . include? ( 'geo-secondary ' )
283
+ elsif @roles . include? ( 'geo_secondary ' )
284
284
log 'Detected a Geo secondary node'
285
285
@instance_type = :geo_secondary
286
286
geo_secondary_upgrade ( options [ :tmp_dir ] , options [ :timeout ] )
@@ -447,21 +447,22 @@ def geo_secondary_upgrade(tmp_dir, timeout)
447
447
log ( 'Upgrading the postgresql database' )
448
448
begin
449
449
promote_database
450
- rescue GitlabCtl ::Errors ::ExecutionError
451
- die "There was an error promoting the database. Please check the logs"
450
+ rescue GitlabCtl ::Errors ::ExecutionError => e
451
+ log "STDOUT: #{ e . stdout } "
452
+ log "STDERR: #{ e . stderr } "
453
+ die "There was an error promoting the database from standby, please check the logs and output."
452
454
end
453
455
454
456
# Restart the database after promotion, and wait for it to be ready
455
457
restart_database
456
458
GitlabCtl ::PostgreSQL . wait_for_postgresql ( 600 )
457
459
458
460
common_pre_upgrade
459
-
460
- # Only disable maintenance_mode if geo-pg is not enabled
461
- common_post_upgrade ( !@geo_pg_enabled )
461
+ cleanup_data_dir
462
462
end
463
463
464
464
geo_pg_upgrade
465
+ common_post_upgrade
465
466
end
466
467
467
468
def geo_pg_upgrade
@@ -485,7 +486,6 @@ def geo_pg_upgrade
485
486
rescue GitlabCtl ::Errors ::ExecutionError
486
487
die "Error running pg_upgrade on secondary, please check logs"
487
488
end
488
- common_post_upgrade
489
489
end
490
490
491
491
def get_locale_encoding
0 commit comments