From: Patrick Donnelly Date: Thu, 14 Nov 2024 17:29:49 +0000 (-0500) Subject: client: sort configs X-Git-Tag: testing/wip-pdonnell-testing-20250227.191159-debug^2~53 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=a84c396e7d34fc5af676f4dc4fdb0d81b2e84a3c;p=ceph-ci.git client: sort configs Signed-off-by: Patrick Donnelly Fixes: https://tracker.ceph.com/issues/66373 --- diff --git a/src/client/Client.cc b/src/client/Client.cc index 4223172fe07..f3fe2facec0 100644 --- a/src/client/Client.cc +++ b/src/client/Client.cc @@ -17421,21 +17421,33 @@ void Client::set_cap_epoch_barrier(epoch_t e) const char** Client::get_tracked_conf_keys() const { - static const char* keys[] = { - "client_cache_size", - "client_cache_mid", - "client_acl_type", - "client_deleg_timeout", - "client_deleg_break_on_open", - "client_oc_size", - "client_oc_max_objects", - "client_oc_max_dirty", - "client_oc_target_dirty", - "client_oc_max_dirty_age", - "client_caps_release_delay", - "client_mount_timeout", - NULL - }; +#define KEYS \ + "client_acl_type", \ + "client_cache_mid", \ + "client_cache_size", \ + "client_caps_release_delay", \ + "client_deleg_break_on_open", \ + "client_deleg_timeout", \ + "client_mount_timeout", \ + "client_oc_max_dirty", \ + "client_oc_max_dirty_age", \ + "client_oc_max_objects", \ + "client_oc_size", \ + "client_oc_target_dirty" \ + + constexpr bool is_sorted = [] () constexpr { + constexpr auto arr = std::to_array({KEYS}); + for (unsigned long i = 0; i < arr.size()-1; ++i) { + if (arr[i] > arr[i+1]) { + return false; + } + } + return true; + }(); + static_assert(is_sorted, "keys are not sorted!"); + + static char const* keys[] = {KEYS, nullptr}; + return keys; }