Page MenuHomeClusterLabs Projects

Update SBD to avoid deprecated Pacemaker APIs
Open, NormalPublic

Assigned To
None
Authored By
kgaillot
Mar 27 2024, 6:28 PM
Tags
  • Restricted Project
  • Restricted Project
Referenced Files
None
Subscribers

Description

See subtasks, plus:

  • configure.ac does AC_CHECK_LIB(pe_rules, test_rule, , missing="yes") but test_rule() (and all of libpe_rules) will soon be deprecated; note that SBD doesn't actually use anything from or link with libpe_rules, so this can just be dropped
  • sbd-cluster.c uses the existence of CRM_SCORE_INFINITY to decide when to use the pacemaker-remote binary name; the constant is deprecated in favor of PCMK_SCORE_INFINITY, so test for either
  • sbd-inquisitor.c depends on transitive inclusion of limits.h (as does sbd.h), libxml/tree.h, and glib.h via Pacemaker headers; include them explicitly
  • sbd-pacemaker.c
    • uses the deprecated GListPtr type; use GList * instead
    • uses the deprecated XML_TAG_CIB constant; use PCMK_XE_CIB instead when available
    • uses the deprecated is_set() macro; use pcmk_is_set() instead when available
    • uses the deprecated copy_xml() function; no replacement will be made available, so redefine it per Pacemaker 2.1.7
  • From crm/cluster.h (see T788), sbd uses:
    • enum cluster_type_e with values pcmk_cluster_unknown and pcmk_cluster_corosync; the enum and values will soon be renamed
    • crm_cluster_t, which will soon be renamed pcmk_cluster_t; direct access to the destroy and cpg.cpg_callbacks_t members will be replaced with functions
    • get_cluster_type(), name_for_cluster_type(), and crm_cluster_connect(), which will soon be renamed
    • configure.ac does AC_CHECK_LIB(crmcluster, crm_peer_init, , missing="yes") but doesn't actually use crm_peer_init(), which will soon be deprecated; no name will be present in libcrmcluster in all Pacemaker versions, so check for a new API, and if unavailable, check for an old one (get_cluster_type() would be better since SBD actually uses it)
  • A lot of scheduler APIs that SBD uses have been or soon will be deprecated
    • configure.ac checks for enum pe_quorum_policy policy with a value of no_quorum_demote, and the code additionally uses other values; all those values are deprecated in favor of names with a pcmk_ prefix, so check for both old and new names
    • The resource struct will soon be refactored (see T790); sbd uses the deprecated resource_t type alias (use pcmk_resource_t instead when available), and directly accesses the id and flags members (use the new accessors instead when available)
    • The node structs will soon be refactored (see T789); sbd uses the deprecated node_t type alias (use pcmk_node_t instead when available), and directly accesses multiple members (use the new accessors instead when available)
    • The main scheduler struct will soon be refactored (see T791); sbd uses the deprecated pe_working_set_t type alias (use pcmk_scheduler_t instead when available), and directly accesses multiple members (use the new accessors instead when available)

Existing SBD versions should continue to build with Pacemaker 3.0.0, but the code should be updated as soon as practical to continue to build with future Pacemaker versions.

Event Timeline

kgaillot triaged this task as Normal priority.Mar 27 2024, 6:28 PM
kgaillot created this task.
kgaillot created this object with edit policy "Restricted Project (Project)".
kgaillot added a subtask: Restricted Maniphest Task.

From crm/cluster.h, sbd uses send_cluster_text() and crm_msg_ais but only if HAVE_DECL_PCMK_CLUSTER_CLASSIC_AIS

kgaillot changed the status of subtask T790: Deprecate direct access to scheduler resource structs from Merged to Released.
kgaillot changed the status of subtask T789: Deprecate direct access to scheduler node structs from Merged to Released.
kgaillot changed the status of subtask T788: Deprecate public API access to most of libcrmcluster from Merged to Released.