osd_type: encode new version for stretch CRUSH buckets
We are implementing a new version of the encoding scheme for stretch
CRUSH buckets in our OSD system.
However, we have encountered limitations when it comes to extending the
encoding version for non-stretch pools. Currently, we are restricted to
using version 29 due to backward compatibility concerns.
To address this, we have devised a solution that excludes version 30 while
maintaining backward compatibility. This means that we will specifically check
for version 30 and maintain the same behavior for older clients.
For new clients, we can proceed with encoding and decoding using version 31.
To accommodate stretch pools, we will utilize std::optional. The first byte of
the encoding will serve as a boolean indicator, determining if the optional data is present.
If the first byte is set to true, we will encode and decode four uint32_t members: peering_crush_*.
By implementing these changes, we can ensure compatibility with older clients while enabling the use
of the enhanced encoding scheme for new clients, specifically for stretch pools.