2024-06-26T11:40:09.630Z | <Md Mahamudur Rahaman Sajib> Hi Everyone,
As `osd_pool_default_min_size` is by default 0. If we try to set the size to 2(`ceph osd pool set rbd size 2`) it will assign the `min_size`
to 1 according to this code
``` unsigned get_osd_pool_default_min_size(const ConfigValues& values,
uint8_t size) const {
uint8_t min_size = get_val<uint64_t>(values, "osd_pool_default_min_size");
return min_size ? std::min(min_size, size) : (size - size / 2);
}```
But min_size 1 is dangerous and generally discouraged. Proposed fix to avoid this is,
```std:min(min_size ? min_size : std:max((size - size / 2), 2), size)```
Goal is to prevent users from accidentally ending up with min_size 1 and If they require it, they will set it explicitly.
Any thoughts in this topic? |