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

feat: exposes default leader in database, and leader options / replicas in instance config #1283

Merged
merged 12 commits into from Jul 19, 2021

Conversation

thiagotnunes
Copy link
Contributor

@thiagotnunes thiagotnunes commented Jul 6, 2021

This PR implements the functionality for CMMR phase 1. Here we do the following:

  • Exposes a new field, default leader in the Database class. This will be populated when retrieving / listing the databases if the value was specified when creating or updating the database.
  • Exposes a new field, replicas in the InstanceConfig class. This will be a list of replicas information available in the given instance (for more details see https://cloud.google.com/spanner/docs/replication#overview_of_replication_in_cloud_spanner).
  • Exposes a new field, leader options in the InstanceConfig class. This will be a list of available leader locations for the databases using the given instance config. This will be populated when retrieving / listing the instance configs.

TODO

  • Add Integration test for setting a database's default leader on CreateDatabase operation
  • Add Integration test for setting a database's default leader using UpdateDatabaseDdl operation

@thiagotnunes thiagotnunes requested a review from as a code owner Jul 6, 2021
@product-auto-label product-auto-label bot added the api: spanner label Jul 6, 2021
@google-cla google-cla bot added the cla: yes label Jul 6, 2021
@thiagotnunes thiagotnunes added do not merge and removed cla: yes labels Jul 6, 2021
@google-cla google-cla bot added the cla: yes label Jul 6, 2021
@thiagotnunes
Copy link
Contributor Author

@thiagotnunes thiagotnunes commented Jul 6, 2021

Backend has not enabled this functionality yet, so the integration tests should not succeed for the moment.

@hengfengli
Copy link
Contributor

@hengfengli hengfengli commented Jul 6, 2021

I don't the emulator would support default_leader and leader_options. You may want to skip these tests for the emulator.

@thiagotnunes
Copy link
Contributor Author

@thiagotnunes thiagotnunes commented Jul 6, 2021

@hengfengli thanks, will do

Skips leader options / replicas checking related tests for the emulator.
@thiagotnunes thiagotnunes added cla: yes and removed cla: yes labels Jul 15, 2021
@hengfengli hengfengli added kokoro:force-run and removed do not merge labels Jul 16, 2021
@yoshi-kokoro yoshi-kokoro removed the kokoro:force-run label Jul 16, 2021
@hengfengli hengfengli added the kokoro:force-run label Jul 16, 2021
@yoshi-kokoro yoshi-kokoro removed the kokoro:force-run label Jul 16, 2021
We decided not to have setting the default leader tests, because it
requires a multi-regional instance. The one we currently have for
running the tests is regional, so the cost of setup would not justify
the testing.
We also skip the get leader options test, since the feature is not
enabled in production yet.
@thiagotnunes thiagotnunes merged commit d72c2f7 into master Jul 19, 2021
17 checks passed
@thiagotnunes thiagotnunes deleted the cmmr-phase-1 branch Jul 19, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: spanner cla: yes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants