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

Task: Change TabletType MASTER to PRIMARY #7113

Closed
deepthi opened this issue Dec 4, 2020 · 5 comments
Closed

Task: Change TabletType MASTER to PRIMARY #7113

deepthi opened this issue Dec 4, 2020 · 5 comments

Comments

@deepthi
Copy link
Member

deepthi commented Dec 4, 2020

There has been discussion in the past on exactly which term to replace master with. Since vitess is a consensus-based system, primary seems like the most appropriate choice (even though source is popular for replication use cases).

TabletType is everywhere in the code base, so we will need to first determine the scope of this change and how to do it in a backwards compatible way.

Website docs should be updated along with code.

@ajm188
Copy link
Contributor

ajm188 commented Dec 4, 2020

I think that if we just rename the field in the enum, then anyone dependent on that should not notice, since it'll still be int(1) on the wire. Then, the code change becomes atomic; we do a global find/replace to topodatapb.TabletType_PRIMARY, and code compiled on the old version still works with the old field name, and code compiled on the new version works with the new field name.

@derekperkins
Copy link
Member

There are a few edge cases where the string representation is used, specifically when json marshaling, so we'd have to check for those types of usage.

@derekperkins
Copy link
Member

While I personally prefer primary, I'd vote to match MySQL and call it source
https://mysqlhighavailability.com/mysql-terminology-updates/
https://dev.mysql.com/doc/refman/8.0/en/replication.html

@ajm188
Copy link
Contributor

ajm188 commented Dec 4, 2020

There are a few edge cases where the string representation is used, specifically when json marshaling, so we'd have to check for those types of usage.

Ah, nice catch! I think we can use an alias in that case https://developers.google.com/protocol-buffers/docs/proto3#enum (I can't link precisely enough)

@deepthi
Copy link
Member Author

deepthi commented Aug 6, 2021

Fixed by #8511

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

No branches or pull requests

4 participants