Conversation

thiagotnunes

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

@thiagotnunesthiagotnunes requested a review from a team as a code owner July 6, 2021 01:41
@product-auto-labelproduct-auto-label bot added the api: spannerIssues related to the googleapis/java-spanner API.label Jul 6, 2021
@google-clagoogle-cla bot added the cla: yesThis human has signed the Contributor License Agreement.label Jul 6, 2021
@thiagotnunesthiagotnunes added do not mergeIndicates a pull request not ready for merge, due to either quality or timing.and removed cla: yesThis human has signed the Contributor License Agreement.labels Jul 6, 2021
@google-clagoogle-cla bot added the cla: yesThis human has signed the Contributor License Agreement.label Jul 6, 2021
@thiagotnunes

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

@hengfengli

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

@thiagotnunes

@hengfengli thanks, will do

Skips leader options / replicas checking related tests for the emulator.
@thiagotnunesthiagotnunes added cla: yesThis human has signed the Contributor License Agreement.and removed cla: yesThis human has signed the Contributor License Agreement.labels Jul 15, 2021
@hengfenglihengfengli added kokoro:force-runAdd this label to force Kokoro to re-run the tests.and removed do not mergeIndicates a pull request not ready for merge, due to either quality or timing.labels Jul 16, 2021
@yoshi-kokoroyoshi-kokoro removed the kokoro:force-runAdd this label to force Kokoro to re-run the tests.label Jul 16, 2021
@hengfenglihengfengli added the kokoro:force-runAdd this label to force Kokoro to re-run the tests.label Jul 16, 2021
@yoshi-kokoroyoshi-kokoro removed the kokoro:force-runAdd 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.
@thiagotnunesthiagotnunes merged commit d72c2f7 into master Jul 19, 2021
@thiagotnunesthiagotnunes deleted the cmmr-phase-1 branch July 19, 2021 01:26
Sign up for free to join this conversation on . Already have an account? Sign in to comment
api: spannerIssues related to the googleapis/java-spanner API.cla: yesThis human has signed the Contributor License Agreement.
None yet

Successfully merging this pull request may close these issues.