title: Quiz 2
description: This quiz is to test your understanding of the basic data replica settings in TiDB.
allow_repeat_submission: true
evaluate_immediately: true
show_correct_answer: true

questions:
  - type: SingleChoice
    question: What is a TiKV Region in the context of TiDB?
    options:
      - id: 4
        text: A Region is a continuous range of rows, internally managed as a basic unit of data storage and replication in TiKV.
        correct: true
      - id: 2
        text: A Region is the network segment where TiKV nodes are deployed.
      - id: 3
        text: A Region is a server dedicated to processing SQL queries in TiDB.
      - id: 1
        text: A Region is the directory on disk where backup data is stored.
    explanation: In TiKV, a Region is the basic unit of data storage, representing a continuous range of key-value pairs and replicated across multiple TiKV nodes to ensure fault tolerance and scalability. See [TiKV Overview](https://docs.pingcap.com/tidb/stable/tikv-overview/#architecture-overview) for more details.

  - type: SingleChoice
    question: Which of the following statements about the `replication.max-replicas` configuration parameter is correct?
    options:
      - id: 3
        text: "`replication.max-replicas` controls the number of data replicas TiKV maintains for each TiKV Region."
        correct: true
      - id: 2
        text: "`replication.max-replicas` defines the number of TiDB servers in the cluster."
      - id: 1
        text: "`replication.max-replicas` sets the backup frequency for the cluster."
      - id: 4
        text: "`replication.max-replicas` is used to limit the number of SQL queries a user can execute."
    explanation: The `replication.max-replicas` configuration parameter in TiDB controls how many data replicas are maintained for each Region by TiKV, which is critical for high availability and fault tolerance.

  - type: SingleChoice
    question: Which SQL statement can you use in TiDB to find out the replica count for Regions in a TiKV cluster?
    options:
      - id: 1
        text: "mysql> SHOW CONFIG WHERE type = 'tikv' AND name='replication.max-replicas';"
      - id: 2
        text: "mysql> SHOW CONFIG WHERE type='pd' AND name='replication.max-replicas';"
        correct: true
      - id: 3
        text: "mysql> SHOW CREATE TABLE <table_name>;"
      - id: 4
        text: "mysql> SELECT COUNT(*) FROM INFORMATION_SCHEMA.TIDB_REGIONS;"
    explanation: To check the configured TiKV Region replica count, use the SQL statement `SHOW CONFIG WHERE type='pd' AND name='replication.max-replicas';` in TiDB. In our lab cluster, the value is 3, with replicas distributed across 3 TiKV nodes in 3 different subnets and 3 Availability Zones for high availability.
