• Oran Agra's avatar
    Cluster refactor, common API for different implementations (#12742) · 58cb3025
    Oran Agra authored
    This PR reworks the clustering code to support multiple clustering
    implementations, specifically, the current "legacy" clustering
    implementation or, although not part of this PR, flotilla (see #10875).
    Which implementation is used could be a compile-time flag (will be added
    later). Legacy clustering functionality remains unchanged.
    
    The basic idea is as follows. The header cluster.h now contains function
    declarations that define the "Cluster API." These are the contract and
    interface between any clustering implementation and the rest of the
    Redis source code. Some of the function definitions are shared between
    all clustering implementations. These functions are in cluster.c. The
    functions and data structures specific to legacy clustering are in
    cluster-legacy.c/h. One consequence of this is that the structs
    clusterNode and clusterState which were previously "public" to the rest
    of Redis are now hidden behind the Cluster API.
    
    The PR is divided up into commits, each with a commit message explaining
    the changes. some are just mass rename or moving code between files (may
    not require close inspection / review), others are manual changes.
    
    One other, related change is:
    - The "failover" command is now plugged into the Cluster API so that the
    clustering implementation can (a) enable/disable the command to begin
    with and if enabled (b) perform the actual failover. The "failover"
    command remains disabled for legacy clustering.
    58cb3025
debug.c 98.4 KB