[<<][pool][>>][..]
Sat Feb 4 08:42:04 EST 2017

btrfs parents -- UUID != content address

Using btrfs send, the ids in the source and target are not the same,
as they seem to be generated locally at random and not by the
structure of the data -- i.e. it's not a content address.

This is mitigated by setting the received subvol.  However this
tightly couples the source to the destination.  E.g. it is not
possible to send A->B-C and then try to update A->C.

Can this somehow be made canonical?  E.g. when a backup gets
forwarded, set the origin?  Or maybe encode the origin ID in the name?


receiving snapshot core_20170204_0837_tp uuid=aae97891-61aa-6146-a2c3-c932c889ccd6, ctransid=160087 parent_uuid=87146068-571b-cb40-86c2-3d57c2a2b845, parent_ctransid=156623
BTRFS_IOC_SET_RECEIVED_SUBVOL uuid=aae97891-61aa-6146-a2c3-c932c889ccd6, stransid=160087

root@zoe:/vol/1# btrfs sub show core_20170204_0837_tp
/vol/1/core_20170204_0837_tp
        Name:                   core_20170204_0837_tp
        UUID:                   f47fd5f5-4910-054d-8fdb-196ef5d877e7
        Parent UUID:            71d3147f-e997-a549-871b-a26076cab8ab
        Received UUID:          aae97891-61aa-6146-a2c3-c932c889ccd6
        Creation time:          2017-02-04 08:37:56 -0500
        Subvolume ID:           2427
        Generation:             97242
        Gen at creation:        97239
        Parent ID:              5
        Top level ID:           5
        Flags:                  readonly
        Snapshot(s):

root@tp:/# btrfs sub show core_20170204_0837_tp
/core_20170204_0837_tp
        Name:                   core_20170204_0837_tp
        UUID:                   aae97891-61aa-6146-a2c3-c932c889ccd6
        Parent UUID:            71875d50-cd4b-1241-9445-854477b86d56
        Received UUID:          -
        Creation time:          2017-02-04 08:37:33 -0500
        Subvolume ID:           527
        Generation:             160088
        Gen at creation:        160087
        Parent ID:              5
        Top level ID:           5
        Flags:                  readonly
        Snapshot(s):


now, what this means is that
zoe:f47fd5f5-4910-054d-8fdb-196ef5d877e7 == tp:aae97891-61aa-6146-a2c3-c932c889ccd6
where == means: can receive incremental update to produce same tree structure


Since BTRFS_IOC_SET_RECEIVED_SUBVOL can change the received UUID, it
is possible to make chained backups work.

To automate: create canonical names, then when names match, set the
received UUID in the target to the UUID of the source.






[Reply][About]
[<<][pool][>>][..]