Class: Pcrd::Commands::Cleanup
- Inherits:
-
Object
- Object
- Pcrd::Commands::Cleanup
- Defined in:
- lib/pcrd/commands/cleanup.rb
Overview
Drops the replication publication and slot on source, and deletes the local checkpoint database.
Run this after the application has been successfully migrated to the target cluster and you’re confident you won’t need to roll back. The source tables themselves are NOT touched unless –drop-source is passed.
Timeline recommendation:
- Verify the app is healthy on the target cluster
- Wait a few days (or a week) as a rollback window
- Then run `pcrd cleanup`
- Optionally run `pcrd cleanup --drop-source` weeks later
Constant Summary collapse
- PASTEL =
Pastel.new
Instance Method Summary collapse
-
#initialize(config, options = {}) ⇒ Cleanup
constructor
A new instance of Cleanup.
- #run(output: $stdout) ⇒ Object
Constructor Details
Instance Method Details
#run(output: $stdout) ⇒ Object
27 28 29 30 31 32 33 34 35 36 37 38 39 40 |
# File 'lib/pcrd/commands/cleanup.rb', line 27 def run(output: $stdout) output.puts output.puts PASTEL.bold("Cleanup") output.puts PASTEL.dim("─" * 60) output.puts drop_slot_and_pub(output) drop_checkpoint(output) drop_source_tables(output) if @options[:"drop-source"] output.puts output.puts " #{PASTEL.green("✓")} Cleanup complete." output.puts end |