Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add FindAllShardsInKeyspace to vtctldserver #7201

Merged

Conversation

ajm188
Copy link
Contributor

@ajm188 ajm188 commented Dec 17, 2020

Backport

NO

Status

READY

Description

This PR adds the FindAllShardsInKeyspace command to the VtctldServer API. It also reimplements the vtctl command to use the same underlying codepath, but transforms the output to maintain backwards compatibility.

Local testing example

For a local example, I went through the local example up through 30x (reshard example). Then, both commands:

❯ vtctldclient --server "localhost:15999" findallshardsinkeyspace customer | jq '.' # new command, new output
{
  "shards": {
    "-80": {
      "keyspace": "customer",
      "name": "-80",
      "shard": {
        "master_alias": {
          "cell": "zone1",
          "uid": 300
        },
        "master_term_start_time": {
          "seconds": 1608237365,
          "nanoseconds": 274539000
        },
        "key_range": {
          "end": "gA=="
        },
        "is_master_serving": true
      }
    },
    "80-": {
      "keyspace": "customer",
      "name": "80-",
      "shard": {
        "master_alias": {
          "cell": "zone1",
          "uid": 400
        },
        "master_term_start_time": {
          "seconds": 1608237366,
          "nanoseconds": 193144000
        },
        "key_range": {
          "start": "gA=="
        },
        "is_master_serving": true
      }
    }
  }
}
❯ vtctlclient -server "localhost:15999" findallshardsinkeyspace customer | jq '.' # old command, maintaining same output format
{
  "-80": {
    "master_alias": {
      "cell": "zone1",
      "uid": 300
    },
    "master_term_start_time": {
      "seconds": 1608237365,
      "nanoseconds": 274539000
    },
    "key_range": {
      "end": "gA=="
    },
    "is_master_serving": true
  },
  "80-": {
    "master_alias": {
      "cell": "zone1",
      "uid": 400
    },
    "master_term_start_time": {
      "seconds": 1608237366,
      "nanoseconds": 193144000
    },
    "key_range": {
      "start": "gA=="
    },
    "is_master_serving": true
  }
}

Related Issue(s)

List related PRs against other branches:
#7135

Todos

  • Tests
  • Documentation

Deployment Notes

N/A

Impacted Areas in Vitess

List general components of the application that this PR will affect:

  • Query Serving
  • VReplication
  • Cluster Management
  • Build

Signed-off-by: Andrew Mason <amason@slack-corp.com>
Signed-off-by: Andrew Mason <amason@slack-corp.com>
Signed-off-by: Andrew Mason <amason@slack-corp.com>
…o be backwards-compat

Signed-off-by: Andrew Mason <amason@slack-corp.com>
Signed-off-by: Andrew Mason <amason@slack-corp.com>
Copy link
Contributor

@rohit-nayak-ps rohit-nayak-ps left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@rohit-nayak-ps rohit-nayak-ps merged commit ceeed3e into vitessio:master Dec 23, 2020
@askdba askdba added this to the v9.0 milestone Jan 6, 2021
ajm188 pushed a commit to tinyspeck/vitess that referenced this pull request Jan 10, 2021
…_keyspace

Add FindAllShardsInKeyspace to vtctldserver
@ajm188 ajm188 deleted the am_find_all_shards_in_keyspace branch January 14, 2021 15:40
setassociative pushed a commit to tinyspeck/vitess that referenced this pull request Mar 11, 2021
…_keyspace

Add FindAllShardsInKeyspace to vtctldserver
@ajm188 ajm188 added this to In progress in Vtctld Service via automation May 23, 2021
@ajm188 ajm188 moved this from In progress to Done in Vtctld Service May 23, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Development

Successfully merging this pull request may close these issues.

None yet

3 participants