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 a team as a code owner July 6, 2021 01:41
@product-auto-label product-auto-label bot added the api: spanner Issues related to the googleapis/java-spanner API. label Jul 6, 2021
@google-cla google-cla bot added the cla: yes This human has signed the Contributor License Agreement. label Jul 6, 2021
@thiagotnunes thiagotnunes added do not merge Indicates a pull request not ready for merge, due to either quality or timing. and removed cla: yes This human has signed the Contributor License Agreement. labels Jul 6, 2021
@google-cla google-cla bot added the cla: yes This human has signed the Contributor License Agreement. label Jul 6, 2021
@thiagotnunes
Copy link
Contributor Author

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

@hengfengli
Copy link
Contributor

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

@hengfengli thanks, will do

Skips leader options / replicas checking related tests for the emulator.
@thiagotnunes thiagotnunes added cla: yes This human has signed the Contributor License Agreement. and removed cla: yes This human has signed the Contributor License Agreement. labels Jul 15, 2021
@hengfengli hengfengli added kokoro:force-run Add this label to force Kokoro to re-run the tests. and removed do not merge Indicates a pull request not ready for merge, due to either quality or timing. labels Jul 16, 2021
@yoshi-kokoro yoshi-kokoro removed the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Jul 16, 2021
@hengfengli hengfengli added the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Jul 16, 2021
@yoshi-kokoro yoshi-kokoro removed the kokoro:force-run Add this label to force Kokoro to re-run the tests. 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
@thiagotnunes thiagotnunes deleted the cmmr-phase-1 branch July 19, 2021 01:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: spanner Issues related to the googleapis/java-spanner API. cla: yes This human has signed the Contributor License Agreement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants