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

[vtctld] Add GetSrvVSchemas command #8221

Merged
merged 4 commits into from
Jun 1, 2021

Conversation

doeg
Copy link
Contributor

@doeg doeg commented May 31, 2021

Signed-off-by: Sara Bee 855595+doeg@users.noreply.github.com

Description

This is a precursor to adding an /api/srvvschemas endpoint to VTAdmin, which will return all of the SrvVSchemas for all cells (or optionally filtered by cell) in a cluster. #8208 was the first attempt at this, however: @ajm188 suggested adding this to the vtctld so that the vtctlds can query all of the topos in their region. This is more efficient than VTAdmin querying each individual cell.

vtctldclient GetSrvVSchemas zone1
{
  "zone1": {
    "keyspaces": {
      "commerce": {
        "tables": {
          "customer_seq": {
            "type": "sequence"
          },
          "order_seq": {
            "type": "sequence"
          },
          "product": {}
        }
      },
      "customer": {
        "sharded": true,
        "vindexes": {
          "hash": {
            "type": "hash"
          }
        },
        "tables": {
          "corder": {
            "column_vindexes": [
              {
                "column": "customer_id",
                "name": "hash"
              }
            ],
            "auto_increment": {
              "column": "order_id",
              "sequence": "order_seq"
            }
          },
          "customer": {
            "column_vindexes": [
              {
                "column": "customer_id",
                "name": "hash"
              }
            ],
            "auto_increment": {
              "column": "customer_id",
              "sequence": "customer_seq"
            }
          }
        }
      }
    },
    "routing_rules": {}
  }
}
vtctldclient GetSrvVSchemas nope
[]
vtctldclient GetSrvVSchemas zone1 nope
{
  "zone1": {
    "keyspaces": {
      "commerce": {
        "tables": {
          "customer_seq": {
            "type": "sequence"
          },
          "order_seq": {
            "type": "sequence"
          },
          "product": {}
        }
      },
      "customer": {
        "sharded": true,
        "vindexes": {
          "hash": {
            "type": "hash"
          }
        },
        "tables": {
          "corder": {
            "column_vindexes": [
              {
                "column": "customer_id",
                "name": "hash"
              }
            ],
            "auto_increment": {
              "column": "order_id",
              "sequence": "order_seq"
            }
          },
          "customer": {
            "column_vindexes": [
              {
                "column": "customer_id",
                "name": "hash"
              }
            ],
            "auto_increment": {
              "column": "customer_id",
              "sequence": "customer_seq"
            }
          }
        }
      }
    },
    "routing_rules": {}
  }
}

Related Issue(s)

Checklist

  • Tests were added or are not required
  • Documentation was added or is not required

Deployment Notes

N/A

doeg added 2 commits May 31, 2021 15:13
Signed-off-by: Sara Bee <855595+doeg@users.noreply.github.com>
…f null

Signed-off-by: Sara Bee <855595+doeg@users.noreply.github.com>
@doeg doeg added Component: VTAdmin VTadmin interface Type: Enhancement Logical improvement (somewhere between a bug and feature) labels May 31, 2021
@doeg doeg marked this pull request as ready for review May 31, 2021 19:53
@doeg doeg requested a review from ajm188 as a code owner May 31, 2021 19:53
doeg added 2 commits May 31, 2021 18:21
Signed-off-by: Sara Bee <855595+doeg@users.noreply.github.com>
Signed-off-by: Sara Bee <855595+doeg@users.noreply.github.com>
Copy link
Contributor

@ajm188 ajm188 left a comment

Choose a reason for hiding this comment

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

lgtm (and thank you for adding the help texts to the others! ❤️ )

@ajm188 ajm188 merged commit 69b9833 into vitessio:master Jun 1, 2021
@ajm188 ajm188 deleted the sarabee-vtctld-getsrvvschemas branch June 1, 2021 01:18
ajm188 added a commit to tinyspeck/vitess that referenced this pull request Jun 15, 2021
…vschemas

[vtctld] Add GetSrvVSchemas command

Signed-off-by: Andrew Mason <amason@slack-corp.com>
ajm188 added a commit to tinyspeck/vitess that referenced this pull request Jul 23, 2021
…vschemas

[vtctld] Add GetSrvVSchemas command

Signed-off-by: Andrew Mason <amason@slack-corp.com>
vmogilev pushed a commit to tinyspeck/vitess that referenced this pull request May 23, 2022
…vschemas

[vtctld] Add GetSrvVSchemas command

Signed-off-by: Vitaliy Mogilevskiy <vmogilevskiy@slack-corp.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Component: Cluster management Component: VTAdmin VTadmin interface Type: Enhancement Logical improvement (somewhere between a bug and feature)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants