Failback with new file in pre-migrated state on acting primary

This use case describes failing back with new file in pre-migrated state on acting primary.

Fileset: primary
Primary disaster, failover to secondary, Create a new file and pre-migrate, old primary came back up, run failback start
State of the file in the old primary after failback start: File does not exist
Current state of the file on acting primary: Pre-Migrated
State of the file in the old primary after applyUpdates: R with blocks from home

(07:17:40) hs21n30:~ mmafmctl fs2 getstate -j hsmp


Fileset Name Fileset Target Cache State Gateway Node Queue Length Queue numExec
------------ -------------- ------------- ------------ ------------ -------------
hsmp nfs://c41bn3/gpfs/fs2/hsms Active hs22n26 0 1

#Run failoverToSecondary at secondary

(07:19:04) c41bn3:~ mmafmctl fs2 failoverToSecondary -j hsms --restore

mmafmctl: failoverToSecondary restoring from psnap psnap0-rpo-C0A8741A5587A9AB-223
[2016-02-08 07:19:14] Restoring fileset "hsms" from snapshot "psnap0-rpo-C0A8741A5587A9AB-223" of filesystem "/dev/fs2"

[2016-02-08 07:19:16] Scanning inodes, phase 1 ...
[2016-02-08 07:19:16] 2770438144 inodes have been scanned, 100% of total.
[2016-02-08 07:19:16] There's no data changes since the restoring snapshot, skipping restore.
[2016-02-08 07:19:16] Restore completed successfully.
[2016-02-08 07:19:16] Clean up.
Primary Id (afmPrimaryID) 5492471941218300346-C0A82917531DFD53-645
Fileset hsms changed.
Promoted fileset hsms to Primary

Create a new file and pre-migrate

(07:19:16) c41bn3:~ dd if=/dev/urandom of=/gpfs/fs2/hsms/file1 bs=1M count=1

1+0 records in
1+0 records out
1048576 bytes (1.0 MB) copied, 0.115535 s, 9.1 MB/s

(07:20:12) c41bn3:~ dsmmigrate /gpfs/fs2/hsms/file1

Tivoli Storage Manager
Command Line Space Management Client Interface
Client Version 7, Release 1, Level 3.0
Client date/time: 02/08/16 07:20:20
(c) Copyright by IBM Corporation and other(s) 1990, 2016. All Rights Reserved.

(07:20:21) c41bn3:~ dsmls /gpfs/fs2/hsms/file1

Tivoli Storage Manager
Command Line Space Management Client Interface
Client Version 7, Release 1, Level 3.0
Client date/time: 02/08/16 07:20:23
(c) Copyright by IBM Corporation and other(s) 1990, 2016. All Rights Reserved.

ActS ResS ResB FSt FName
1048576 0 0 m file1
(07:20:23) c41bn3:~ dsmrecall /gpfs/fs2/hsms/file1

Tivoli Storage Manager
Command Line Space Management Client Interface
Client Version 7, Release 1, Level 3.0
Client date/time: 02/08/16 07:20:57
(c) Copyright by IBM Corporation and other(s) 1990, 2016. All Rights Reserved.

(07:20:58) c41bn3:~ dsmls /gpfs/fs2/hsms/file1

Tivoli Storage Manager
Command Line Space Management Client Interface
Client Version 7, Release 1, Level 3.0
Client date/time: 02/08/16 07:21:00
(c) Copyright by IBM Corporation and other(s) 1990, 2016. All Rights Reserved.

ActS ResS ResB FSt FName
1048576 1048576 1024 p file1

Start failbackToPrimary at old primary

(07:18:07) hs21n30:~ mmafmctl fs2 failbackToPrimary -j hsmp --start

GPFS: 6027-2763 Unable to start tscr/link/unlink/chfileset on 'fs2' because conflicting program tscr/link/unlink/chfileset is running. Waiting until it completes.
GPFS: 6027-2765 tscr/link/unlink/chfileset on 'fs2' is finished waiting. Processing continues ...
Fileset hsmp changed.
mmafmctl: failbackToPrimary restoring from psnap psnap0-rpo-C0A8741A5587A9AB-223
[2016-02-08 07:21:38] Restoring fileset "hsmp" from snapshot "psnap0-rpo-C0A8741A5587A9AB-223" of filesystem "/dev/fs2"

[2016-02-08 07:21:40] Scanning inodes, phase 1 ...
[2016-02-08 07:21:56] 86083264 inodes have been scanned, 100% of total.
[2016-02-08 07:21:56] There's no data changes since the restoring snapshot, skipping restore.
[2016-02-08 07:21:56] Restore completed successfully.
[2016-02-08 07:21:56] Clean up.

#ApplyUpdates on old primary

(07:21:57) hs21n30:~ mmafmctl fs2 applyUpdates -j hsmp

[2016-02-08 07:22:45] Getting the list of updates from the acting Primary...
[2016-02-08 07:22:52] Applying the 3 updates...
[2016-02-08 07:22:52] 3 updates have been applied, 100% of total.
mmafmctl: Creating the failback psnap locally. failback-psnap-rpo-C0A8741A5587A9AB-223-16-02-08-07-22-44
Flushing dirty data for snapshot hsmp:failback-psnap-rpo-C0A8741A5587A9AB-223-16-02-08-07-22-44...
Quiescing all file system operations.
Snapshot hsmp:failback-psnap-rpo-C0A8741A5587A9AB-223-16-02-08-07-22-44 created with id 10083.

#State of the file in the old primary after applyUpdates

(07:23:02) hs21n30:~ dsmls /gpfs/fs2/hsmp/file1

Tivoli Storage Manager
Command Line Space Management Client Interface
Client Version 7, Release 1, Level 3.0
Client date/time: 02/08/16 07:23:32
(c) Copyright by IBM Corporation and other(s) 1990, 2016. All Rights Reserved.

ActS ResS ResB FSt FName
1048576 1048576 1024 r file1

(07:23:39) hs21n30:~ mmafmctl fs2 failbackToPrimary -j hsmp --stop

Fileset hsmp changed.