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 paasta status for vitesscluster and mount /nail/etc/srv-configs to VTTablets #3902

Conversation

VinaySagarGonabavi
Copy link
Contributor

@VinaySagarGonabavi VinaySagarGonabavi commented Jun 26, 2024

Testing setup:

Testing output:
Screenshot 2024-06-25 at 11 49 30 PM

VitessClusterStatus (https://github.com/planetscale/vitess-operator/blob/main/docs/api.md#vitessclusterstatus) and its fields used as a reference for TypedDicts added

Copy link
Contributor

@jfongatyelp jfongatyelp left a comment

Choose a reason for hiding this comment

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

As most changes look like they'll only impact vitess, seems safe from my perspective. 👍

Comment on lines +1885 to +1888
class EtcdLockServerStatus(TypedDict, total=False):
observedGeneration: int
available: str
clientServiceName: str
Copy link
Contributor

Choose a reason for hiding this comment

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

Side question about this -- on EKS we don't actually have direct access to the etcd cluster, is this still used? How is the etcd lock implemented?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We're using only zk implementation of lock server, but the status returns this field and hence created to accommodate it. This is expected to be unused and return an empty value

Copy link
Member

Choose a reason for hiding this comment

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

the typeddicts are non-total so we could always leave them out :)

@VinaySagarGonabavi VinaySagarGonabavi merged commit f437254 into master Jun 27, 2024
10 checks passed
Copy link
Member

@nemacysts nemacysts left a comment

Choose a reason for hiding this comment

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

sorry - was busy yesterday :)

Comment on lines +1885 to +1888
class EtcdLockServerStatus(TypedDict, total=False):
observedGeneration: int
available: str
clientServiceName: str
Copy link
Member

Choose a reason for hiding this comment

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

the typeddicts are non-total so we could always leave them out :)

status: VitessClusterStatus = vitess_status.get("status")
if status is None:
output.append(
PaastaColors.red("indent * tab + Vitess cluster is not available yet")
Copy link
Member

Choose a reason for hiding this comment

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

should this be something like: PaastaColors.red(indent * tab + "Vitess cluster is not available yet")?

+ str(status.get("observedGeneration", 0))
)
output.append(
indent * tab + "Gateway Service Name: " + status.get("gatewayServiceName", "")
Copy link
Member

Choose a reason for hiding this comment

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

not sure if this can happen, but might be nice to have a default like UNKNOWN or something to make it clearer that something is missing :)

output.append(
indent * tab + "Cells: " + PaastaColors.red("No cell status available")
)
return 0
Copy link
Member

Choose a reason for hiding this comment

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

just to confirm: for each of these sections, we can't proceed with the subsequent sections if the current one is unavailable?

orphanedKeyspaces: Dict[str, OrphanStatus]


def print_vitess_status(
Copy link
Member

Choose a reason for hiding this comment

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

might be a useful refactor in the future to break each of the sections into their own function so that print_vitess_status() isn't so long

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants