Index Replicas

    +

    If an active index is lost, a replica is promoted to active status, and use of the index is uninterrupted.

    The Index Replicas interface allows up to three index replicas to be selected, from a pull-down menu:

    fts index replicas interface

    Each replica must exist on a node separate from its active index, and from any other replica of that active index. Attempts to add more than the number of replicas permitted by the current cluster-configuration is not permitted and results in an error message:

    fts index replicas error message

    Partition Replica

    A partitioned index can be created with multiple replicas to ensure indexes are online despite node failure. If there are multiple server groups in a cluster, replica partitions will be spread out to each server group whenever possible. If one of the server groups is offline, the remaining replica partitions will be available to serve all queries. Every index replica is available to serve queries. Therefore, index replicas can also be used to load rebalancing of query requests.

    Example

    Create an index with replica

    CREATE INDEX idx_pe15 ON `travel-sample`.inventory.route
    (airline, sourceairport, schedule)
     PARTITION BY HASH (airline) WITH {"num_replica": 2};

    When an index node fails, any in-flight query requests (serviced by the failed node) will fail since the partial results are already being processed. Any new query requests requiring the lost partition are then serviced by the partitions in the replica.