pd icon indicating copy to clipboard operation
pd copied to clipboard

Speed up the progress if the master zone changes

Open bufferflies opened this issue 3 months ago • 0 comments

Enhancement Task

Currently, after the user changes the master zone, the region checker needs to generate six operators to fix this region.

For example: The previous rule:

[
  {
    "group_id": "pd",
    "group_index": 0,
    "group_override": false,
    "rules": [
      {
        "group_id": "pd",
        "id": "wl",
        "start_key": "",
        "end_key": "",
        "role": "learner",
        "count": 3,
        "location_labels": ["zone", "az", "host"],
        "label_constraints": [
          {
            "key": "zone",
            "op": "in",
            "values": ["wl"]
          }
        ]
      },
      {
        "group_id": "pd",
        "id": "sh",
        "start_key": "",
        "end_key": "",
        "role": "voter",
        "count": 3,
        "location_labels": ["zone", "az", "host"],
        "label_constraints": [
          {
            "key": "zone",
            "op": "in",
            "values": ["sh"]
          }
        ]
      }
    ]
  }
]

current rule:

[
  {
    "group_id": "pd",
    "group_index": 0,
    "group_override": false,
    "rules": [
      {
        "group_id": "pd",
        "id": "wl",
        "start_key": "",
        "end_key": "",
        "role": "learner",
        "count": 3,
        "location_labels": ["zone", "az", "host"],
        "label_constraints": [
          {
            "key": "zone",
            "op": "in",
            "values": ["wl"]
          }
        ]
      },
      {
        "group_id": "pd",
        "id": "sh",
        "start_key": "",
        "end_key": "",
        "role": "voter",
        "count": 3,
        "location_labels": ["zone", "az", "host"],
        "label_constraints": [
          {
            "key": "zone",
            "op": "in",
            "values": ["sh"]
          }
        ]
      }
    ]
  }
]

It needs six operators, including 3 promote and 3 demote peers to fix it; we can combine them into one operator, including six steps.

bufferflies avatar Sep 22 '25 13:09 bufferflies