• Iustin Pop's avatar
    Add more constants for DRBD and change sync tests · 3c003d9d
    Iustin Pop authored
    This patch adds constants for the connection status, peer roles and disk
    status, and it changes the rules for when the disk is considered as
    “resyncing” - previously it was only for syncsource/synctarget, but
    there are many other transient statuses which could be misinterpreted as
    ‘degraded’ (because they where not considered as resyncing, but the disk
    is not consistent in these statuses).
    Furthermore, cmdlib.py:WaitForSync determines if a device is syncing or
    not based on sync_percent being not none. Not all DRBD resync statuses
    offer a percent done, so if we are syncing but don't have a sync
    percent, we'll report a zero sync percent (and no time estimate).
    The patch also removes a few unused variables (is_sync_target,
    peer_sync_target, is_resync) whose value doesn't make sense anymore with
    the new sync rules.
    Signed-off-by: default avatarIustin Pop <iustin@google.com>
    Reviewed-by: default avatarMichael Hanselmann <hansmi@google.com>