[pve-devel] [PATCH manager] fix #2292: ceph osd create: use size parameter for db/wal

Thomas Lamprecht t.lamprecht at proxmox.com
Fri Jul 19 11:18:47 CEST 2019


On 7/19/19 11:13 AM, Dominik Csapak wrote:
> 
>> I replaced the proposed fix with the one below. if we'd had seen this before Tuesday
>> I'd just renamed the params, but now it's a little to late to make that incompatible
>> change (and our param alias/depreacation wish is not yet fulfilled ;) ).
>> Thanks for the notice!
>>
>> ----8<----
>> diff --git a/PVE/API2/Ceph/OSD.pm b/PVE/API2/Ceph/OSD.pm
>> index 3b432784..954859e9 100644
>> --- a/PVE/API2/Ceph/OSD.pm
>> +++ b/PVE/API2/Ceph/OSD.pm
>> @@ -261,6 +261,10 @@ __PACKAGE__->register_method ({
>>          # extract parameter info and fail if a device is set more than once
>>          my $devs = {};
>>   +       # FIXME: rename params on next API compatibillity change (7.0)
>> +       $param->{wal_dev_size} = delete $param->{wal_size};
>> +       $param->{db_dev_size} = delete $param->{db_size};
>> +
>>          for my $type ( qw(dev db_dev wal_dev) ) {
>>              next if !$param->{$type};
>>  
> 
> thanks, yeah thats a much better fix :)
> 

not sure if better, but I was initially a bit confused by the difference between:

(my $shorttype = $type) =~ s/_dev$//;
my ($shorttype) = $type =~ s/_dev$//;

While it may make some (perl) sense, was still a bit weird for me.





More information about the pve-devel mailing list