@@ -67,6 +67,7 @@ type Migrator struct {
67
67
allEventsUpToLockProcessedInjectedFlag int64
68
68
inCutOverCriticalActionFlag int64
69
69
cleanupImminentFlag int64
70
+ userCommandedUnpostponeFlag int64
70
71
// copyRowsQueue should not be buffered; if buffered some non-damaging but
71
72
// excessive work happens at the end of the iteration as new copy-jobs arrive befroe realizing the copy is complete
72
73
copyRowsQueue chan tableWriteFunc
@@ -447,6 +448,9 @@ func (this *Migrator) cutOver() (err error) {
447
448
if this .migrationContext .PostponeCutOverFlagFile == "" {
448
449
return false , nil
449
450
}
451
+ if atomic .LoadInt64 (& this .userCommandedUnpostponeFlag ) > 0 {
452
+ return false , nil
453
+ }
450
454
if base .FileExists (this .migrationContext .PostponeCutOverFlagFile ) {
451
455
// Throttle file defined and exists!
452
456
atomic .StoreInt64 (& this .migrationContext .IsPostponingCutOver , 1 )
@@ -792,6 +796,7 @@ throttle-query=<query> # Set a new throttle-query
792
796
throttle-control-replicas=<replicas> #
793
797
throttle # Force throttling
794
798
no-throttle # End forced throttling (other throttling may still apply)
799
+ unpostpone # Bail out a cut-over postpone; proceed to cut-over
795
800
panic # panic and quit without cleanup
796
801
help # This message
797
802
` )
@@ -846,6 +851,15 @@ help # This message
846
851
{
847
852
atomic .StoreInt64 (& this .migrationContext .ThrottleCommandedByUser , 0 )
848
853
}
854
+ case "unpostpone" , "no-postpone" , "cut-over" :
855
+ {
856
+ if atomic .LoadInt64 (& this .migrationContext .IsPostponingCutOver ) > 0 {
857
+ atomic .StoreInt64 (& this .userCommandedUnpostponeFlag , 1 )
858
+ fmt .Fprintf (writer , "Unpostponed\n " )
859
+ } else {
860
+ fmt .Fprintf (writer , "You may only invoke this when gh-ost is actively postponing migration. At this time it is not.\n " )
861
+ }
862
+ }
849
863
case "panic" :
850
864
{
851
865
err := fmt .Errorf ("User commanded 'panic'. I will now panic, without cleanup. PANIC!" )
0 commit comments