Enable pool level replication using type snapshot
Hi, from the docs it was not clear how to enable replication using type snapshot so I ended up trying to enable it on pool level which (according to upstream docs) looks to be not supported.
However MicroCeph allows running the following command to enable replication using type snapshot on pool level:
microceph replication enable rbd foo --type snapshot --remote secondary
But instead the command seems to trigger the setup of --type journal instead as pre-existing volumes of the pool foo now have the journaling feature enabled and their mirroring mode (rbd info foo/test) also displays mirroring mode: journal.
I have tested using MicroCeph squid/stable. Those are the reproducer steps on the two Ceph clusters micro01 and micro02:
# micro01
microceph cluster bootstrap
microceph disk add /dev/sdb /dev/sdc /dev/sdd
microceph remote import secondary <token from micro02> --local-name primary
microceph cluster export secondary
microceph enable rbd-mirror
ceph osd pool create foo 32
rbd pool init foo
rbd create foo/test --size 10M
rbd create foo/test2 --size 10M
root@micro01:~# rbd info foo/test
rbd image 'test':
size 10 MiB in 3 objects
order 22 (4 MiB objects)
snapshot_count: 0
id: 375c50cac2b3
block_name_prefix: rbd_data.375c50cac2b3
format: 2
features: layering, exclusive-lock, object-map, fast-diff, deep-flatten
op_features:
flags:
create_timestamp: Fri Apr 25 07:15:51 2025
access_timestamp: Fri Apr 25 07:15:51 2025
modify_timestamp: Fri Apr 25 07:15:51 2025
microceph replication enable rbd foo --type snapshot --remote secondary # fails without error
root@micro01:~# rbd info foo/test
rbd image 'test':
size 10 MiB in 3 objects
order 22 (4 MiB objects)
snapshot_count: 0
id: 375c50cac2b3
block_name_prefix: rbd_data.375c50cac2b3
format: 2
features: layering, exclusive-lock, object-map, fast-diff, deep-flatten, journaling
op_features:
flags:
create_timestamp: Fri Apr 25 07:15:51 2025
access_timestamp: Fri Apr 25 07:15:51 2025
modify_timestamp: Fri Apr 25 07:15:51 2025
journal: 375c50cac2b3
mirroring state: enabled
mirroring mode: journal
mirroring global id: aab836e6-8046-4921-8c3f-de7f7e13e59b
mirroring primary: true
# micro02
microceph cluster bootstrap
microceph disk add /dev/sdb /dev/sdc /dev/sdd
microceph cluster export primary
microceph remote import primary <token from micro01> --local-name secondary
microceph enable rbd-mirror
ceph osd pool create foo 32
rbd pool init foo
Thank you for reporting your feedback to us!
The internal ticket has been created: https://warthogs.atlassian.net/browse/CEPH-1268.
This message was autogenerated
Hi @roosterfish ,
I've submitted a fix for this issue that adds a validation check to prevent enabling snapshot-based replication on RBD pools. Instead of silently falling back to journal mode, the command now returns a clear error message.
Open to any feedback. Thanks!
The fix should be available in squid/edge now. Thanks @roosterfish and @panagiotisevaggelou 🙌🏼