radosgw-admin validate tier type while setting
One can get into difficult situations with multisite and incorrect tier-types
an eg would be:
on a secondary zone do
$ radosgw-admin zone modify --rgw-zone=us-west --tier-type=es --tier-config=endpoint=http://localhost:9200 .. $ radosgw-admin period update --commit # this succeeds
Now the radosgw's in this zone wouldn't start anymore and further period updates from rgw-admin will error out as sync module init fails
The only possible way to salvage this situation would be to go back to the master, modify zonegroup via infile to set the right tier type and go the the secondary and do a realm pull with keys etc, maybe input validation while doing a tier creation would be the easiest way out?
#2 Updated by Abhishek Lekshmanan 3 months ago
Yehuda Sadeh wrote:
The command here in itself is not invalid. You could and should be able to modify the tier type of the zone. What happens if you try to revert the tier type (e.g., set it to "rgw" instead). Does the command fail to execute then?
Well the zone modify itself would succeed, the subsequent period commit fails with
$ ../src/mrun dc2 radosgw-admin period commit 2017-05-05 10:54:31.662401 7f9d2dfaa6c0 -1 ERROR: failed to init sync module instance, ret=-2 couldn't init storage provider
#3 Updated by Abhishek Lekshmanan 3 months ago
basically init_complete() fails since it will fail at RGWSyncModulesManager::create_instance() and since period commit or any other rgw admin comments that isn't a raw storage op would fail, so even though though zone modify succeeds, it can't be committed in the period and hence subsequent changes are not possible from this zonegroup anymore. Maybe we could do a check in zone modify on the tier_type by asking the sync modules manager?