Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

replication received_uuid blocker re snap to share promotion #2902 #2911

Conversation

phillxnet
Copy link
Member

When promoting the oldest of the 3 read-only snapshots received & retained by the replication service (btrfs send/receive wrapper), use the force flag during ro-to-rw/snap-to-share transition. At the time of this transition, this received subvol is no longer used for comparison in all future replication (btrfs send/receive) events. It represents an older version of the sending systems associated replication source share. Necessarily older by way of the constraints of the btrfs send/receive architecture, and the safeguards of the replication wrapper: a cascade of ro snapshots.

Fixes #2902


Adds a force option (default False) to the existing btrfs property set mnt_pt property_name property_value wrapper, set_property(); and employs this force option when enacting a repclone (replication clone) snap-to-share promotion.

…#2902

When promoting the oldest of the 3 read-only snapshots received & retained
by the replication service (btrfs send/receive wrapper), use the force flag
during ro-to-rw/snap-to-share transition. At the time of this transition,
this received subvol is no longer used for comparison in all future
replication (btrfs send/receive) events. It represents an older version
of the sending systems associated replication source share. Necessarily
older by way of the constraints of the btrfs send/receive architecture,
and the safeguards of the replication wrapper: a cascade of ro snapshots.
@phillxnet
Copy link
Member Author

Testing

Although the indicated issue only occurs on the 4th replication event, and at the receiver system, we have insufficient docs (dev & end-user) so the following is to assist in filling in the in-code only mechanism used by Rockstor's replication wrapper.

Please avoid commenting on this PR until this synopsis is completed: i.e. the entire replication life-cycle has been covered (5 replication events).

Test setup is Leap 15.6 based (x86_64) both ends. Trivial data payload (empty) Share, to avoid the suspected cause of another recent replication blocker #2901 .

  • Sender (hostname installer) running 5.0.14-0
  • Receiver (hostname rleap15-6) running 5.0.14-2911
  • A reflected Appliance configuration is established, i.e.:
    -- System -> Appliances re other systems IP & cliapp credentials (System - > Access Keys)
  • Both systems have System -> Services: Replication (spanner icon) Network Interface option configured (default port).
  • Send & Receive parent pools have had Quotas disabled and re-enabled before repshare's creation and before any replication event have been configured/enacted. This shortens qgroup output to simplify logging here.
  • Receiver (rleap15-6 5.0.14-2911) has replication enabled first to avoid incidental false starts: the replication is driven by the sender. The receive service reacts to send events only via a zmq communication channel over which we communicate a basic co-ordinating protocol to orchestrate btrfs send/receive events and our cascading ro snapshot arrangement.

Initial state

Before the first send and receive there exists only the original share to be replicated: no incidental or replication related snapshots.

installer:~ # btrfs subvolume show /mnt2/raid-test/repshare/
repshare
        Name:                   repshare
        UUID:                   bda7f280-1234-7f43-94b2-a3f523c5bbe8
        Parent UUID:            -
        Received UUID:          -
        Creation time:          2024-10-02 11:40:37 +0100
        Subvolume ID:           262
        Generation:             70
        Gen at creation:        70
        Parent ID:              5
        Top level ID:           5
        Flags:                  -
        Send transid:           0
        Send time:              2024-10-02 11:40:37 +0100
        Receive transid:        0
        Receive time:           -
        Snapshot(s):
        Quota group:            0/262
          Limit referenced:     -
          Limit exclusive:      -
          Usage referenced:     16.00KiB
          Usage exclusive:      16.00KiB

Quotas:
Default (0/*) and the additional Rockstor appliance parent/share Qgroup (2015/1)

installer:~ # btrfs qgroup show /mnt2/raid-test/
Qgroupid    Referenced    Exclusive   Path 
--------    ----------    ---------   ---- 
0/5           16.00KiB     16.00KiB   <toplevel>
0/262         16.00KiB     16.00KiB   repshare
2015/1        16.00KiB     16.00KiB   <0 member qgroups>

@phillxnet
Copy link
Member Author

1st Replication event

Sender

rockstor.log:

[02/Oct/2024 12:45:03] INFO [smart_manager.replication.sender:341] Id: 67bdf5bd-2c16-41d7-8224-ca864f2c0a68-2. Sending full replica: /mnt2/raid-test/.snapshots/repshare/repshare_2_replication_1

journalctl: (note "2" is second replication tasks (not event) on this system)

Oct 02 12:45:01 installer CRON[32520]: (root) CMD (/opt/rockstor/.venv/bin/send-replica 2)
Oct 02 12:45:02 installer CRON[32518]: (root) CMDEND (/opt/rockstor/.venv/bin/send-replica 2)

installer:~ # btrfs subvolume show /mnt2/raid-test/repshare/
repshare
        Name:                   repshare
        UUID:                   bda7f280-1234-7f43-94b2-a3f523c5bbe8
        Parent UUID:            -
        Received UUID:          -
        Creation time:          2024-10-02 11:40:37 +0100
        Subvolume ID:           262
        Generation:             73
        Gen at creation:        70
        Parent ID:              5
        Top level ID:           5
        Flags:                  -
        Send transid:           0
        Send time:              2024-10-02 11:40:37 +0100
        Receive transid:        0
        Receive time:           -
        Snapshot(s):
                                .snapshots/repshare/repshare_2_replication_1
        Quota group:            0/262
          Limit referenced:     -
          Limit exclusive:      -
          Usage referenced:     16.00KiB
          Usage exclusive:      16.00KiB

We create the initial ro sender snapshot (subvol) .snapshots/repshare/repshare_2_replication_1

installer:~ # btrfs subvolume show /mnt2/raid-test/.snapshots/repshare/repshare_2_replication_1
.snapshots/repshare/repshare_2_replication_1
        Name:                   repshare_2_replication_1
        UUID:                   4ee3f083-8dc0-7846-aee6-8517722a0446
        Parent UUID:            bda7f280-1234-7f43-94b2-a3f523c5bbe8
        Received UUID:          -
        Creation time:          2024-10-02 12:45:03 +0100
        Subvolume ID:           263
        Generation:             73
        Gen at creation:        73
        Parent ID:              5
        Top level ID:           5
        Flags:                  readonly
        Send transid:           0
        Send time:              2024-10-02 12:45:03 +0100
        Receive transid:        0
        Receive time:           -
        Snapshot(s):
        Quota group:            0/263
          Limit referenced:     -
          Limit exclusive:      -
          Usage referenced:     16.00KiB
          Usage exclusive:      16.00KiB

Qgroups:

installer:~ # btrfs qgroup show /mnt2/raid-test/
Qgroupid    Referenced    Exclusive   Path 
--------    ----------    ---------   ---- 
0/5           16.00KiB     16.00KiB   <toplevel>
0/262         16.00KiB     16.00KiB   repshare
0/263         16.00KiB     16.00KiB   .snapshots/repshare/repshare_2_replication_1
2015/1        32.00KiB     32.00KiB   <0 member qgroups>

which is then sent, in full, to receiver:

Receiver

Shows two shares in Web-UI, one starting with .snapshot is inadvertent and a known Web-UI bug re initial replication stages.

  • 67bdf5bd-2c16-41d7-8224-ca864f2c0a68_repshare
  • .snapshots/67bdf5bd-2c16-41d7-8224-ca864f2c0a68_repshare/repshare_2_replication_1
rleap15-6:~ # btrfs subvol show /mnt2/rock-pool/67bdf5bd-2c16-41d7-8224-ca864f2c0a68_repshare
67bdf5bd-2c16-41d7-8224-ca864f2c0a68_repshare
        Name:                   67bdf5bd-2c16-41d7-8224-ca864f2c0a68_repshare
        UUID:                   92d2a941-fa80-be4e-bce1-1f780298a6d8
        Parent UUID:            -
        Received UUID:          -
        Creation time:          2024-10-02 12:45:03 +0100
        Subvolume ID:           256
        Generation:             4948
        Gen at creation:        4948
        Parent ID:              5
        Top level ID:           5
        Flags:                  -
        Send transid:           0
        Send time:              2024-10-02 12:45:03 +0100
        Receive transid:        0
        Receive time:           -
        Snapshot(s):
        Quota group:            0/256
          Limit referenced:     -
          Limit exclusive:      -
          Usage referenced:     16.00KiB
          Usage exclusive:      16.00KiB

and

rleap15-6:~ # btrfs subvol show /mnt2/rock-pool/.snapshots/67bdf5bd-2c16-41d7-8224-ca864f2c0a68_repshare/repshare_2_replication_1
.snapshots/67bdf5bd-2c16-41d7-8224-ca864f2c0a68_repshare/repshare_2_replication_1
        Name:                   repshare_2_replication_1
        UUID:                   6678dbc9-64a0-bd40-a55d-c93d7bc1e630
        Parent UUID:            -
        Received UUID:          4ee3f083-8dc0-7846-aee6-8517722a0446
        Creation time:          2024-10-02 12:45:03 +0100
        Subvolume ID:           257
        Generation:             4950
        Gen at creation:        4949
        Parent ID:              5
        Top level ID:           5
        Flags:                  readonly
        Send transid:           70
        Send time:              2024-10-02 12:45:03 +0100
        Receive transid:        4950
        Receive time:           2024-10-02 12:45:03 +0100
        Snapshot(s):
        Quota group:            0/257
          Limit referenced:     -
          Limit exclusive:      -
          Usage referenced:     16.00KiB
          Usage exclusive:      16.00KiB

Qgroups

rleap15-6:~ # btrfs qgroup show /mnt2/rock-pool/
Qgroupid    Referenced    Exclusive   Path 
--------    ----------    ---------   ---- 
0/5           16.00KiB     16.00KiB   <toplevel>
0/256         16.00KiB     16.00KiB   67bdf5bd-2c16-41d7-8224-ca864f2c0a68_repshare
0/257         16.00KiB     16.00KiB   .snapshots/67bdf5bd-2c16-41d7-8224-ca864f2c0a68_repshare/repshare_2_replication_1
2015/1        16.00KiB     16.00KiB   <0 member qgroups>
2015/2        16.00KiB     16.00KiB   <0 member qgroups>

@phillxnet
Copy link
Member Author

2nd Replication


Sender

rockstor.log

[02/Oct/2024 13:20:04] INFO [smart_manager.replication.sender:335] Id: 67bdf5bd-2c16-41d7-8224-ca864f2c0a68-2. Sending incremental replica between /mnt2/raid-test/.snapshots/repshare/repshare_2_replication_1 -- /mnt2/raid-test/.snapshots/repshare/repshare_2_replication_6

N.B. 6 in above due to missed replication events caused by disabling & reenabling send side replication service to analyse interim states.

Qgroups

installer:~ # btrfs qgroup show /mnt2/raid-test/
Qgroupid    Referenced    Exclusive   Path 
--------    ----------    ---------   ---- 
0/5           16.00KiB     16.00KiB   <toplevel>
0/262         16.00KiB     16.00KiB   repshare
0/263         16.00KiB     16.00KiB   .snapshots/repshare/repshare_2_replication_1
0/264         16.00KiB     16.00KiB   .snapshots/repshare/repshare_2_replication_6
2015/1        48.00KiB     48.00KiB   <0 member qgroups>

Source share now has 2 snapshots:

installer:~ # btrfs subvolume show /mnt2/raid-test/repshare/
repshare
        Name:                   repshare
        UUID:                   bda7f280-1234-7f43-94b2-a3f523c5bbe8
        Parent UUID:            -
        Received UUID:          -
        Creation time:          2024-10-02 11:40:37 +0100
        Subvolume ID:           262
        Generation:             75
        Gen at creation:        70
        Parent ID:              5
        Top level ID:           5
        Flags:                  -
        Send transid:           0
        Send time:              2024-10-02 11:40:37 +0100
        Receive transid:        0
        Receive time:           -
        Snapshot(s):
                                .snapshots/repshare/repshare_2_replication_1
                                .snapshots/repshare/repshare_2_replication_6
        Quota group:            0/262
          Limit referenced:     -
          Limit exclusive:      -
          Usage referenced:     16.00KiB
          Usage exclusive:      16.00KiB

Second snapshot details:

installer:~ # btrfs subvolume show /mnt2/raid-test/.snapshots/repshare/repshare_2_replication_6
.snapshots/repshare/repshare_2_replication_6
        Name:                   repshare_2_replication_6
        UUID:                   e4dc1724-9589-0444-8b46-5b0b01d4f5d0
        Parent UUID:            bda7f280-1234-7f43-94b2-a3f523c5bbe8
        Received UUID:          -
        Creation time:          2024-10-02 13:20:04 +0100
        Subvolume ID:           264
        Generation:             75
        Gen at creation:        75
        Parent ID:              5
        Top level ID:           5
        Flags:                  readonly
        Send transid:           0
        Send time:              2024-10-02 13:20:04 +0100
        Receive transid:        0
        Receive time:           -
        Snapshot(s):
        Quota group:            0/264
          Limit referenced:     -
          Limit exclusive:      -
          Usage referenced:     16.00KiB
          Usage exclusive:      16.00KiB

Receiver

Web-UI still shows the same shares as in the previous stage.
But new in this stage is the latest (2nd replication event) snapshot entry (confusingly named due to test method employed).

  • Snapshot Name: repshare_2_replication_6
  • Parent Share: /.snapshots/67bdf5bd-2c16-41d7-8224-ca864f2c0a68_repshare/repshare_2_replication_1

Qgroups:

rleap15-6:~ # btrfs qgroup show /mnt2/rock-pool/
Qgroupid    Referenced    Exclusive   Path 
--------    ----------    ---------   ---- 
0/5           16.00KiB     16.00KiB   <toplevel>
0/256         16.00KiB     16.00KiB   67bdf5bd-2c16-41d7-8224-ca864f2c0a68_repshare
0/257         16.00KiB     16.00KiB   .snapshots/67bdf5bd-2c16-41d7-8224-ca864f2c0a68_repshare/repshare_2_replication_1
0/258         16.00KiB     16.00KiB   .snapshots/67bdf5bd-2c16-41d7-8224-ca864f2c0a68_repshare/repshare_2_replication_6
2015/1        16.00KiB     16.00KiB   <0 member qgroups>
2015/2        16.00KiB     16.00KiB   <0 member qgroups>

Newest incremental snapshot

rleap15-6:~ # btrfs subvol show /mnt2/rock-pool/.snapshots/67bdf5bd-2c16-41d7-8224-ca864f2c0a68_repshare/repshare_2_replication_6
.snapshots/67bdf5bd-2c16-41d7-8224-ca864f2c0a68_repshare/repshare_2_replication_6
        Name:                   repshare_2_replication_6
        UUID:                   6e4f86b6-adad-0b46-8849-d81336e222b2
        Parent UUID:            6678dbc9-64a0-bd40-a55d-c93d7bc1e630
        Received UUID:          e4dc1724-9589-0444-8b46-5b0b01d4f5d0
        Creation time:          2024-10-02 13:20:04 +0100
        Subvolume ID:           258
        Generation:             4953
        Gen at creation:        4953
        Parent ID:              5
        Top level ID:           5
        Flags:                  readonly
        Send transid:           70
        Send time:              2024-10-02 13:20:04 +0100
        Receive transid:        4954
        Receive time:           2024-10-02 13:20:04 +0100
        Snapshot(s):
        Quota group:            0/258
          Limit referenced:     -
          Limit exclusive:      -
          Usage referenced:     16.00KiB
          Usage exclusive:      16.00KiB

@phillxnet
Copy link
Member Author

3rd Replication


Sender

rockstor.log

[02/Oct/2024 13:40:04] INFO [smart_manager.replication.sender:335] Id: 67bdf5bd-2c16-41d7-8224-ca864f2c0a68-2. Sending incremental replica between /mnt2/raid-test/.snapshots/repshare/repshare_2_replication_6 -- /mnt2/raid-test/.snapshots/repshare/repshare_2_replication_7

Qgroups

installer:~ # btrfs qgroup show /mnt2/raid-test/
Qgroupid    Referenced    Exclusive   Path 
--------    ----------    ---------   ---- 
0/5           16.00KiB     16.00KiB   <toplevel>
0/262         16.00KiB     16.00KiB   repshare
0/263         16.00KiB     16.00KiB   .snapshots/repshare/repshare_2_replication_1
0/264         16.00KiB     16.00KiB   .snapshots/repshare/repshare_2_replication_6
0/265         16.00KiB     16.00KiB   .snapshots/repshare/repshare_2_replication_7
2015/1        64.00KiB     64.00KiB   <0 member qgroups>

Source share now has 3 snapshots (as before these are displayed as expected in sender Web-UI):

installer:~ # btrfs subvolume show /mnt2/raid-test/repshare/
repshare
        Name:                   repshare
        UUID:                   bda7f280-1234-7f43-94b2-a3f523c5bbe8
        Parent UUID:            -
        Received UUID:          -
        Creation time:          2024-10-02 11:40:37 +0100
        Subvolume ID:           262
        Generation:             77
        Gen at creation:        70
        Parent ID:              5
        Top level ID:           5
        Flags:                  -
        Send transid:           0
        Send time:              2024-10-02 11:40:37 +0100
        Receive transid:        0
        Receive time:           -
        Snapshot(s):
                                .snapshots/repshare/repshare_2_replication_1
                                .snapshots/repshare/repshare_2_replication_6
                                .snapshots/repshare/repshare_2_replication_7
        Quota group:            0/262
          Limit referenced:     -
          Limit exclusive:      -
          Usage referenced:     16.00KiB
          Usage exclusive:      16.00KiB

Third snapshot details:

installer:~ # btrfs subvolume show /mnt2/raid-test/.snapshots/repshare/repshare_2_replication_7
.snapshots/repshare/repshare_2_replication_7
        Name:                   repshare_2_replication_7
        UUID:                   e9f05da3-c85a-fe4b-96aa-a58c234f0922
        Parent UUID:            bda7f280-1234-7f43-94b2-a3f523c5bbe8
        Received UUID:          -
        Creation time:          2024-10-02 13:40:04 +0100
        Subvolume ID:           265
        Generation:             77
        Gen at creation:        77
        Parent ID:              5
        Top level ID:           5
        Flags:                  readonly
        Send transid:           0
        Send time:              2024-10-02 13:40:04 +0100
        Receive transid:        0
        Receive time:           -
        Snapshot(s):
        Quota group:            0/265
          Limit referenced:     -
          Limit exclusive:      -
          Usage referenced:     16.00KiB
          Usage exclusive:      16.00KiB

Receiver

Web-UI Shares still show the original Share, and the anomaly first snapshot sent; as per the last 2 stages.
But we now have 2 snapshots listed, both parented by our initial anomalous Share (initial snap sent):

  • Snapshot Name: repshare_2_replication_6

  • Parent Share: /.snapshots/67bdf5bd-2c16-41d7-8224-ca864f2c0a68_repshare/repshare_2_replication_1

  • Snapshot Name: repshare_2_replication_7

  • Parent Share: /.snapshots/67bdf5bd-2c16-41d7-8224-ca864f2c0a68_repshare/repshare_2_replication_1

Qgroups

rleap15-6:~ # btrfs qgroup show /mnt2/rock-pool/
Qgroupid    Referenced    Exclusive   Path 
--------    ----------    ---------   ---- 
0/5           16.00KiB     16.00KiB   <toplevel>
0/256         16.00KiB     16.00KiB   67bdf5bd-2c16-41d7-8224-ca864f2c0a68_repshare
0/257         16.00KiB     16.00KiB   .snapshots/67bdf5bd-2c16-41d7-8224-ca864f2c0a68_repshare/repshare_2_replication_1
0/258         16.00KiB     16.00KiB   .snapshots/67bdf5bd-2c16-41d7-8224-ca864f2c0a68_repshare/repshare_2_replication_6
0/259         16.00KiB     16.00KiB   .snapshots/67bdf5bd-2c16-41d7-8224-ca864f2c0a68_repshare/repshare_2_replication_7
2015/1        16.00KiB     16.00KiB   <0 member qgroups>
2015/2        16.00KiB     16.00KiB   <0 member qgroups>

Newest incremental snapshot

rleap15-6:~ # btrfs subvol show /mnt2/rock-pool/.snapshots/67bdf5bd-2c16-41d7-8224-ca864f2c0a68_repshare/repshare_2_replication_7
.snapshots/67bdf5bd-2c16-41d7-8224-ca864f2c0a68_repshare/repshare_2_replication_7
        Name:                   repshare_2_replication_7
        UUID:                   9f3645e3-1cae-7a45-b01e-cdfe1f9646a1
        Parent UUID:            6e4f86b6-adad-0b46-8849-d81336e222b2
        Received UUID:          e9f05da3-c85a-fe4b-96aa-a58c234f0922
        Creation time:          2024-10-02 13:40:04 +0100
        Subvolume ID:           259
        Generation:             4956
        Gen at creation:        4956
        Parent ID:              5
        Top level ID:           5
        Flags:                  readonly
        Send transid:           70
        Send time:              2024-10-02 13:40:04 +0100
        Receive transid:        4957
        Receive time:           2024-10-02 13:40:04 +0100
        Snapshot(s):
        Quota group:            0/259
          Limit referenced:     -
          Limit exclusive:      -
          Usage referenced:     16.00KiB
          Usage exclusive:      16.00KiB

And the view of our anomalous initial full subvol send which, currently at least, is parent host to 2nd subsequent differential send/receive subvols (receive side):

rleap15-6:~ # btrfs subvol show /mnt2/rock-pool/.snapshots/67bdf5bd-2c16-41d7-8224-ca864f2c0a68_repshare/repshare_2_replication_1
.snapshots/67bdf5bd-2c16-41d7-8224-ca864f2c0a68_repshare/repshare_2_replication_1
        Name:                   repshare_2_replication_1
        UUID:                   6678dbc9-64a0-bd40-a55d-c93d7bc1e630
        Parent UUID:            -
        Received UUID:          4ee3f083-8dc0-7846-aee6-8517722a0446
        Creation time:          2024-10-02 12:45:03 +0100
        Subvolume ID:           257
        Generation:             4953
        Gen at creation:        4949
        Parent ID:              5
        Top level ID:           5
        Flags:                  readonly
        Send transid:           70
        Send time:              2024-10-02 12:45:03 +0100
        Receive transid:        4950
        Receive time:           2024-10-02 12:45:03 +0100
        Snapshot(s):
                                .snapshots/67bdf5bd-2c16-41d7-8224-ca864f2c0a68_repshare/repshare_2_replication_6
        Quota group:            0/257
          Limit referenced:     -
          Limit exclusive:      -
          Usage referenced:     16.00KiB
          Usage exclusive:      16.00KiB

and the details of our 3rd (to date) received subvol :

rleap15-6:~ # btrfs subvol show /mnt2/rock-pool/.snapshots/67bdf5bd-2c16-41d7-8224-ca864f2c0a68_repshare/repshare_2_replication_6
.snapshots/67bdf5bd-2c16-41d7-8224-ca864f2c0a68_repshare/repshare_2_replication_6
        Name:                   repshare_2_replication_6
        UUID:                   6e4f86b6-adad-0b46-8849-d81336e222b2
        Parent UUID:            6678dbc9-64a0-bd40-a55d-c93d7bc1e630
        Received UUID:          e4dc1724-9589-0444-8b46-5b0b01d4f5d0
        Creation time:          2024-10-02 13:20:04 +0100
        Subvolume ID:           258
        Generation:             4956
        Gen at creation:        4953
        Parent ID:              5
        Top level ID:           5
        Flags:                  readonly
        Send transid:           70
        Send time:              2024-10-02 13:20:04 +0100
        Receive transid:        4954
        Receive time:           2024-10-02 13:20:04 +0100
        Snapshot(s):
                                .snapshots/67bdf5bd-2c16-41d7-8224-ca864f2c0a68_repshare/repshare_2_replication_7
        Quota group:            0/258
          Limit referenced:     -
          Limit exclusive:      -
          Usage referenced:     16.00KiB
          Usage exclusive:      16.00KiB

With the latest having no snapshot info yet:

rleap15-6:~ # btrfs subvol show /mnt2/rock-pool/.snapshots/67bdf5bd-2c16-41d7-8224-ca864f2c0a68_repshare/repshare_2_replication_7
.snapshots/67bdf5bd-2c16-41d7-8224-ca864f2c0a68_repshare/repshare_2_replication_7
        Name:                   repshare_2_replication_7
        UUID:                   9f3645e3-1cae-7a45-b01e-cdfe1f9646a1
        Parent UUID:            6e4f86b6-adad-0b46-8849-d81336e222b2
        Received UUID:          e9f05da3-c85a-fe4b-96aa-a58c234f0922
        Creation time:          2024-10-02 13:40:04 +0100
        Subvolume ID:           259
        Generation:             4956
        Gen at creation:        4956
        Parent ID:              5
        Top level ID:           5
        Flags:                  readonly
        Send transid:           70
        Send time:              2024-10-02 13:40:04 +0100
        Receive transid:        4957
        Receive time:           2024-10-02 13:40:04 +0100
        Snapshot(s):
        Quota group:            0/259
          Limit referenced:     -
          Limit exclusive:      -
          Usage referenced:     16.00KiB
          Usage exclusive:      16.00KiB
rleap15-6:~ # btrfs subvol list /mnt2/rock-pool/
ID 256 gen 4948 top level 5 path 67bdf5bd-2c16-41d7-8224-ca864f2c0a68_repshare
ID 257 gen 4953 top level 5 path .snapshots/67bdf5bd-2c16-41d7-8224-ca864f2c0a68_repshare/repshare_2_replication_1
ID 258 gen 4956 top level 5 path .snapshots/67bdf5bd-2c16-41d7-8224-ca864f2c0a68_repshare/repshare_2_replication_6
ID 259 gen 4956 top level 5 path .snapshots/67bdf5bd-2c16-41d7-8224-ca864f2c0a68_repshare/repshare_2_replication_7

@phillxnet
Copy link
Member Author

phillxnet commented Oct 2, 2024

4th Replication


Sender

rockstor.log

[02/Oct/2024 14:10:04] INFO [smart_manager.replication.sender:335] Id: 67bdf5bd-2c16-41d7-8224-ca864f2c0a68-2. Sending incremental replica between /mnt2/raid-test/.snapshots/repshare/repshare_2_replication_7 -- /mnt2/raid-test/.snapshots/repshare/repshare_2_replication_8

Qgroups

installer:~ # btrfs qgroup show /mnt2/raid-test/
Qgroupid    Referenced    Exclusive   Path 
--------    ----------    ---------   ---- 
0/5           16.00KiB     16.00KiB   <toplevel>
0/262         16.00KiB     16.00KiB   repshare
0/264         16.00KiB     16.00KiB   .snapshots/repshare/repshare_2_replication_6
0/265         16.00KiB     16.00KiB   .snapshots/repshare/repshare_2_replication_7
0/266         16.00KiB     16.00KiB   .snapshots/repshare/repshare_2_replication_8
2015/1        64.00KiB     64.00KiB   <0 member qgroups>

Source share still has 3 snapshots, but they are the last 3, the first having been cleaned away.

installer:~ # btrfs subvolume show /mnt2/raid-test/repshare/
repshare
        Name:                   repshare
        UUID:                   bda7f280-1234-7f43-94b2-a3f523c5bbe8
        Parent UUID:            -
        Received UUID:          -
        Creation time:          2024-10-02 11:40:37 +0100
        Subvolume ID:           262
        Generation:             79
        Gen at creation:        70
        Parent ID:              5
        Top level ID:           5
        Flags:                  -
        Send transid:           0
        Send time:              2024-10-02 11:40:37 +0100
        Receive transid:        0
        Receive time:           -
        Snapshot(s):
                                .snapshots/repshare/repshare_2_replication_6
                                .snapshots/repshare/repshare_2_replication_7
                                .snapshots/repshare/repshare_2_replication_8
        Quota group:            0/262
          Limit referenced:     -
          Limit exclusive:      -
          Usage referenced:     16.00KiB
          Usage exclusive:      16.00KiB

Fourth/latest (in replication task run) snapshot details:

installer:~ # btrfs subvolume show /mnt2/raid-test/.snapshots/repshare/repshare_2_replication_8
.snapshots/repshare/repshare_2_replication_8
        Name:                   repshare_2_replication_8
        UUID:                   11202d9d-3238-d942-a054-7ccac7596c54
        Parent UUID:            bda7f280-1234-7f43-94b2-a3f523c5bbe8
        Received UUID:          -
        Creation time:          2024-10-02 14:10:04 +0100
        Subvolume ID:           266
        Generation:             79
        Gen at creation:        79
        Parent ID:              5
        Top level ID:           5
        Flags:                  readonly
        Send transid:           0
        Send time:              2024-10-02 14:10:04 +0100
        Receive transid:        0
        Receive time:           -
        Snapshot(s):
        Quota group:            0/266
          Limit referenced:     -
          Limit exclusive:      -
          Usage referenced:     16.00KiB
          Usage exclusive:      16.00KiB

Receiver

rockstor.log

[02/Oct/2024 14:10:04] INFO [storageadmin.views.snapshot:61] Supplanting share (67bdf5bd-2c16-41d7-8224-ca864f2c0a68_repshare) with snapshot (.snapshots/67bdf5bd-2c16-41d7-8224-ca864f2c0a68_repshare/repshare_2_replication_1).
[02/Oct/2024 14:10:04] INFO [storageadmin.views.snapshot:103] Moving snapshot (/mnt2/rock-pool/.snapshots/67bdf5bd-2c16-41d7-8224-ca864f2c0a68_repshare/repshare_2_replication_1) to prior share's pool location (/mnt2/rock-pool/67bdf5bd-2c16-41d7-8224-ca864f2c0a68_repshare)

Web-UI Shares are now looking more as expected; with the temporary anomolous .snapshot subvol not longer showing as the share.
We have on receive side in Web-UI shares only our expected receiver share:

  • 67bdf5bd-2c16-41d7-8224-ca864f2c0a68_repshare
    -- With snapshots: repshare_2_replication_6, repshare_2_replication_7, repshare_2_replication_8

Which relates to sending Appliance ID and original share name at sender
And we have a successful promotion of what was our temporary receiver parent subvol repshare_2_replication_1 taking the place of the prior place-holder replication receive share. The target issue of this PR.

Qgroups

rleap15-6:~ # btrfs qgroup show /mnt2/rock-pool/
Qgroupid    Referenced    Exclusive   Path 
--------    ----------    ---------   ---- 
0/5           16.00KiB     16.00KiB   <toplevel>
0/257         16.00KiB     16.00KiB   67bdf5bd-2c16-41d7-8224-ca864f2c0a68_repshare
0/258         16.00KiB     16.00KiB   .snapshots/67bdf5bd-2c16-41d7-8224-ca864f2c0a68_repshare/repshare_2_replication_6
0/259         16.00KiB     16.00KiB   .snapshots/67bdf5bd-2c16-41d7-8224-ca864f2c0a68_repshare/repshare_2_replication_7
0/260         16.00KiB     16.00KiB   .snapshots/67bdf5bd-2c16-41d7-8224-ca864f2c0a68_repshare/repshare_2_replication_8
2015/1           0.00B        0.00B   <0 member qgroups>
2015/2        16.00KiB     16.00KiB   <0 member qgroups>

And our newly supplanted subvol receiving share details:

rleap15-6:~ # btrfs subvol show /mnt2/rock-pool/67bdf5bd-2c16-41d7-8224-ca864f2c0a68_repshare
67bdf5bd-2c16-41d7-8224-ca864f2c0a68_repshare
        Name:                   67bdf5bd-2c16-41d7-8224-ca864f2c0a68_repshare
        UUID:                   6678dbc9-64a0-bd40-a55d-c93d7bc1e630
        Parent UUID:            -
        Received UUID:          -
        Creation time:          2024-10-02 12:45:03 +0100
        Subvolume ID:           257
        Generation:             4953
        Gen at creation:        4949
        Parent ID:              5
        Top level ID:           5
        Flags:                  -
        Send transid:           0
        Send time:              2024-10-02 12:45:03 +0100
        Receive transid:        4960
        Receive time:           2024-10-02 14:10:04 +0100
        Snapshot(s):
                                .snapshots/67bdf5bd-2c16-41d7-8224-ca864f2c0a68_repshare/repshare_2_replication_6
        Quota group:            0/257
          Limit referenced:     -
          Limit exclusive:      -
          Usage referenced:     16.00KiB
          Usage exclusive:      16.00KiB

All pool snapshot only volumes at this stage:

rleap15-6:~ # btrfs subvol list -s /mnt2/rock-pool/
ID 258 gen 4956 cgen 4953 top level 5 otime 2024-10-02 13:20:04 path .snapshots/67bdf5bd-2c16-41d7-8224-ca864f2c0a68_repshare/repshare_2_replication_6
ID 259 gen 4961 cgen 4956 top level 5 otime 2024-10-02 13:40:04 path .snapshots/67bdf5bd-2c16-41d7-8224-ca864f2c0a68_repshare/repshare_2_replication_7
ID 260 gen 4961 cgen 4961 top level 5 otime 2024-10-02 14:10:04 path .snapshots/67bdf5bd-2c16-41d7-8224-ca864f2c0a68_repshare/repshare_2_replication_8

N.B. The following also indicates parent/received_uuid and path of all subvols on receiver.

ID 260 gen 4961 top level 5 path .snapshots/67bdf5bd-2c16-41d7-8224-ca864f2c0a68_repshare/repshare_2_replication_8
rleap15-6:~ # btrfs subvol list -a -q -R /mnt2/rock-pool/
ID 257 gen 4953 top level 5 parent_uuid -                                    received_uuid -                                    path 67bdf5bd-2c16-41d7-8224-ca864f2c0a68_repshare
ID 258 gen 4956 top level 5 parent_uuid 6678dbc9-64a0-bd40-a55d-c93d7bc1e630 received_uuid e4dc1724-9589-0444-8b46-5b0b01d4f5d0 path .snapshots/67bdf5bd-2c16-41d7-8224-ca864f2c0a68_repshare/repshare_2_replication_6
ID 259 gen 4961 top level 5 parent_uuid 6e4f86b6-adad-0b46-8849-d81336e222b2 received_uuid e9f05da3-c85a-fe4b-96aa-a58c234f0922 path .snapshots/67bdf5bd-2c16-41d7-8224-ca864f2c0a68_repshare/repshare_2_replication_7
ID 260 gen 4961 top level 5 parent_uuid 9f3645e3-1cae-7a45-b01e-cdfe1f9646a1 received_uuid 11202d9d-3238-d942-a054-7ccac7596c54 path .snapshots/67bdf5bd-2c16-41d7-8224-ca864f2c0a68_repshare/repshare_2_replication_8

@phillxnet
Copy link
Member Author

5th Replication


Sender

rockstor.log

[02/Oct/2024 16:30:03] INFO [smart_manager.replication.sender:335] Id: 67bdf5bd-2c16-41d7-8224-ca864f2c0a68-2. Sending incremental replica between /mnt2/raid-test/.snapshots/repshare/repshare_2_replication_8 -- /mnt2/raid-test/.snapshots/repshare/repshare_2_replication_9

Qgroups

installer:~ # btrfs qgroup show /mnt2/raid-test/
Qgroupid    Referenced    Exclusive   Path 
--------    ----------    ---------   ---- 
0/5           16.00KiB     16.00KiB   <toplevel>
0/262         16.00KiB     16.00KiB   repshare
0/265         16.00KiB     16.00KiB   .snapshots/repshare/repshare_2_replication_7
0/266         16.00KiB     16.00KiB   .snapshots/repshare/repshare_2_replication_8
0/267         16.00KiB     16.00KiB   .snapshots/repshare/repshare_2_replication_9
2015/1        64.00KiB     64.00KiB   <0 member qgroups>

Source Share

installer:~ # btrfs subvolume show /mnt2/raid-test/repshare/
repshare
        Name:                   repshare
        UUID:                   bda7f280-1234-7f43-94b2-a3f523c5bbe8
        Parent UUID:            -
        Received UUID:          -
        Creation time:          2024-10-02 11:40:37 +0100
        Subvolume ID:           262
        Generation:             81
        Gen at creation:        70
        Parent ID:              5
        Top level ID:           5
        Flags:                  -
        Send transid:           0
        Send time:              2024-10-02 11:40:37 +0100
        Receive transid:        0
        Receive time:           -
        Snapshot(s):
                                .snapshots/repshare/repshare_2_replication_7
                                .snapshots/repshare/repshare_2_replication_8
                                .snapshots/repshare/repshare_2_replication_9
        Quota group:            0/262
          Limit referenced:     -
          Limit exclusive:      -
          Usage referenced:     16.00KiB
          Usage exclusive:      16.00KiB

latest (in replication task run) snapshot details:

installer:~ # btrfs subvolume show /mnt2/raid-test/.snapshots/repshare/repshare_2_replication_9
.snapshots/repshare/repshare_2_replication_9
        Name:                   repshare_2_replication_9
        UUID:                   da5f29fc-7b55-fd43-9fa6-edd78abb5fa7
        Parent UUID:            bda7f280-1234-7f43-94b2-a3f523c5bbe8
        Received UUID:          -
        Creation time:          2024-10-02 16:30:03 +0100
        Subvolume ID:           267
        Generation:             81
        Gen at creation:        81
        Parent ID:              5
        Top level ID:           5
        Flags:                  readonly
        Send transid:           0
        Send time:              2024-10-02 16:30:03 +0100
        Receive transid:        0
        Receive time:           -
        Snapshot(s):
        Quota group:            0/267
          Limit referenced:     -
          Limit exclusive:      -
          Usage referenced:     16.00KiB
          Usage exclusive:      16.00KiB

Receiver

rockstor.log

[02/Oct/2024 16:30:03] INFO [storageadmin.views.snapshot:61] Supplanting share (67bdf5bd-2c16-41d7-8224-ca864f2c0a68_repshare) with snapshot (repshare_2_replication_6).
[02/Oct/2024 16:30:03] INFO [storageadmin.views.snapshot:103] Moving snapshot (/mnt2/rock-pool/.snapshots/67bdf5bd-2c16-41d7-8224-ca864f2c0a68_repshare/repshare_2_replication_6) to prior share's pool location (/mnt2/rock-pool/67bdf5bd-2c16-41d7-8224-ca864f2c0a68_repshare)

Qgroup

rleap15-6:~ # btrfs qgroup show /mnt2/rock-pool/
Qgroupid    Referenced    Exclusive   Path 
--------    ----------    ---------   ---- 
0/5           16.00KiB     16.00KiB   <toplevel>
0/258         16.00KiB     16.00KiB   67bdf5bd-2c16-41d7-8224-ca864f2c0a68_repshare
0/259         16.00KiB     16.00KiB   .snapshots/67bdf5bd-2c16-41d7-8224-ca864f2c0a68_repshare/repshare_2_replication_7
0/260         16.00KiB     16.00KiB   .snapshots/67bdf5bd-2c16-41d7-8224-ca864f2c0a68_repshare/repshare_2_replication_8
0/261         16.00KiB     16.00KiB   .snapshots/67bdf5bd-2c16-41d7-8224-ca864f2c0a68_repshare/repshare_2_replication_9
2015/1           0.00B        0.00B   <0 member qgroups>
2015/2           0.00B        0.00B   <0 member qgroups>

current statue of our recently supplanted receving share:

rleap15-6:~ # btrfs subvol show /mnt2/rock-pool/67bdf5bd-2c16-41d7-8224-ca864f2c0a68_repshare
67bdf5bd-2c16-41d7-8224-ca864f2c0a68_repshare
        Name:                   67bdf5bd-2c16-41d7-8224-ca864f2c0a68_repshare
        UUID:                   6e4f86b6-adad-0b46-8849-d81336e222b2
        Parent UUID:            6678dbc9-64a0-bd40-a55d-c93d7bc1e630
        Received UUID:          -
        Creation time:          2024-10-02 13:20:04 +0100
        Subvolume ID:           258
        Generation:             4956
        Gen at creation:        4953
        Parent ID:              5
        Top level ID:           5
        Flags:                  -
        Send transid:           0
        Send time:              2024-10-02 13:20:04 +0100
        Receive transid:        4966
        Receive time:           2024-10-02 16:30:03 +0100
        Snapshot(s):
                                .snapshots/67bdf5bd-2c16-41d7-8224-ca864f2c0a68_repshare/repshare_2_replication_7
        Quota group:            0/258
          Limit referenced:     -
          Limit exclusive:      -
          Usage referenced:     16.00KiB
          Usage exclusive:      16.00KiB

I.e. our latest share is now what repshare_2_replication_6 was, hence it now having repshare_2_replication_7 as it's recorded original snapshot.

Note however that Rockstor shows this share as follows:

  Name Created on Visibility to user Writable Total Size Exclusive Size
  repshare_2_replication_9 October 2nd 2024, 4:30:04 pm Hidden No 16.00 KB 16.00 KB
  repshare_2_replication_8 October 2nd 2024, 2:10:04 pm Hidden No 16.00 KB 16.00 KB
  repshare_2_replication_7 October 2nd 2024, 2:10:04 pm Hidden No 16.00 KB 16.00 KB

Which is as intended on the target system: Replication share represented as Share on target with 3 progressively newer snapshots that re rotated as newer snapshots are sent to the receiver.

N.B. there is an argument for us returning the target Share to ro post our supplanting it's contents: to be addressed in a dedicated issue. As writes to it, will be lost as it is progressively supplanted by the oldest of the 3 cascading snapshots sent via replication. An artifact in-part of having insufficient documentation on replication and it's intended function: i.e. unidirectional differential block-level transit with history.

@phillxnet
Copy link
Member Author

From the 4th/5th replication task we assume a stable state: repeating what the previous replication event (4th) first establishes: the subvol migration of oldest of 3 ro snapshots to share. And we have also a share with now no received_uuid in evidence:

Receiver rockstor replication clone (repclone)

Our snap to share 'clone' facility enacts a similar process: enabling a share from snapshot transition.

rleap15-6:~ # btrfs subvol show /mnt2/rock-pool/67bdf5bd-2c16-41d7-8224-ca864f2c0a68_repshare | grep UUID
        UUID:                   6e4f86b6-adad-0b46-8849-d81336e222b2
        Parent UUID:            6678dbc9-64a0-bd40-a55d-c93d7bc1e630
        Received UUID:          -

@phillxnet
Copy link
Member Author

@FroggyFlox @Hooverdan96 So we have now at least a little sketch of the replication workings clarified. I just wanted to have a newer reference to point to, and potentially use to guide a doc entry refresh.

As per @Hooverdan96 finding, we very much look to have resolved this issue re the use of a -f force flag. As per newer btrfs caution with subvols having been associated with receiving a send/receive. And our differential send/receive is at least one snapshot away from the one we change: we look to be on safe grounds with its use. I.e. it is not longer used as a reference in and differential send. But more a historical reference removed now from the cascade as a new one comes in to ensure we have our cascade remaining.

@phillxnet
Copy link
Member Author

phillxnet commented Oct 2, 2024

I propose we merge this as-is given it simply add a -f to set property, but only when enacting ro -> rw during a repclone. Our existing behaviour regarding leaving this share as rw is for another issue and proposal there-in. No other behaviour is modified by this PR, and we return to our prior Stable's functionality; and that of older Leaps/btrfs before the jump that came with Leap 15.6 and it's newer kernel.

I.e. from the following #2777 (comment)
on the last major work on the replication subsystem (before 15.6 was available):

Rpmbuilds completed successfully on 15.4 and 15.5 target OS's in X86_64 arch and are now being tested for prior replication function.

And at that point we had the same behaviour as was reproduced here: using this PR branch (but with a Leap 15.6 receiver).

@Hooverdan96
Copy link
Member

sounds good to me.

@phillxnet phillxnet merged commit bbb4720 into rockstor:testing Oct 3, 2024
@phillxnet phillxnet deleted the 2902-replication-received_uuid-blocker-re-snap-to-share-promotion branch October 3, 2024 09:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants