]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
crush: builder: document set_{legacy,optimal}_crush_map
authorLoic Dachary <loic@dachary.org>
Thu, 13 Apr 2017 13:23:02 +0000 (15:23 +0200)
committerLoic Dachary <ldachary@redhat.com>
Thu, 20 Apr 2017 20:25:59 +0000 (22:25 +0200)
Closes: main/libcrush#26
Signed-off-by: Loic Dachary <loic@dachary.org>
src/crush/builder.h

index 651729ff0e06386726491b4528ab34c3ea47eed5..e1a9f75d0b8074e1c3cd88e39a145032cce584f1 100644 (file)
@@ -307,7 +307,45 @@ crush_make_straw_bucket(struct crush_map *map,
 extern int crush_addition_is_unsafe(__u32 a, __u32 b);
 extern int crush_multiplication_is_unsafe(__u32  a, __u32 b);
 
+/** @ingroup API
+ *
+ * Set the __map__ tunables to implement the most ancient behavior,
+ * for backward compatibility purposes only.
+ *
+ * - choose_local_tries == 2
+ * - choose_local_fallback_tries == 5
+ * - choose_total_tries == 19
+ * - chooseleaf_descend_once == 0
+ * - chooseleaf_vary_r == 0
+ * - straw_calc_version == 0
+ * - chooseleaf_stable = 0
+ *
+ * See the __crush_map__ documentation for more information about
+ * each tunable.
+ *
+ * @param map a crush_map
+ */
 extern void set_legacy_crush_map(struct crush_map *map);
+/** @ingroup API
+ *
+ * Set the __map__ tunables to implement the optimal behavior. These
+ * are the values set by crush_create(). It does not guarantee a
+ * stable mapping after an upgrade.
+ *
+ * For instance when a bug is fixed it may significantly change the
+ * mapping. In that case a new tunable (say tunable_new) is added so
+ * the caller can control when the bug fix is activated. The
+ * set_optimal_crush_map() function will always set all tunables,
+ * including tunable_new, to fix all bugs even if it means changing
+ * the mapping. If the caller needs fine grained control on the
+ * tunables to upgrade to a new version without changing the mapping,
+ * it needs to set the __crush_map__ tunables individually.
+ *
+ * See the __crush_map__ documentation for more information about
+ * each tunable.
+ *
+ * @param map a crush_map
+ */
 extern void set_optimal_crush_map(struct crush_map *map);
 
 #endif