Skip to content
Snippets Groups Projects
  • Gleb Kashkin's avatar
    fa21117d
    config: verify replicaset to contain an instance · fa21117d
    Gleb Kashkin authored
    It is very easy to misplace a config option to a different level, for
    example create an empty replicaset `sharding` with storage role, instead
    of configuring sharding option to `storage`:
    ```
    groups:
      g-001:
        replicasets:
          sharding:
            roles:
            - storage
          r-001:
            instances:
              i-001: {}
    ```
    
    This patch adds validation that forbids creating an empty group or
    replicaset. Note that a group or a replicaset could still be defined
    in multiple config sources and may appear empty in one of them, the
    check is performed on the merged cluster config.
    
    Closes #9895
    
    NO_DOC=bugfix
    fa21117d
    History
    config: verify replicaset to contain an instance
    Gleb Kashkin authored
    It is very easy to misplace a config option to a different level, for
    example create an empty replicaset `sharding` with storage role, instead
    of configuring sharding option to `storage`:
    ```
    groups:
      g-001:
        replicasets:
          sharding:
            roles:
            - storage
          r-001:
            instances:
              i-001: {}
    ```
    
    This patch adds validation that forbids creating an empty group or
    replicaset. Note that a group or a replicaset could still be defined
    in multiple config sources and may appear empty in one of them, the
    check is performed on the merged cluster config.
    
    Closes #9895
    
    NO_DOC=bugfix
cluster_config_test.lua 9.98 KiB