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!: Point In Time Recovery (PITR) #452

Merged
merged 23 commits into from Feb 17, 2021
Merged

Conversation

thiagotnunes
Copy link
Contributor

@thiagotnunes thiagotnunes commented Sep 23, 2020

Implements the PITR-lite support.

With this functionality users will be able to set the retention period for their databases (through the version_retention_period database field). Other than that, user should be able to specify the timestamp for a consistent copy of a database through the version_time field when creating a backup.

@thiagotnunes thiagotnunes requested a review from as a code owner Sep 23, 2020
@google-cla google-cla bot added the cla: yes label Sep 23, 2020
@thiagotnunes thiagotnunes added the do not merge label Sep 23, 2020
@product-auto-label product-auto-label bot added the api: spanner label Sep 23, 2020
@thiagotnunes thiagotnunes added kokoro:force-run and removed do not merge labels Sep 29, 2020
@yoshi-kokoro yoshi-kokoro removed the kokoro:force-run label Sep 29, 2020
@thiagotnunes thiagotnunes added the do not merge label Sep 30, 2020
@thiagotnunes thiagotnunes requested review from olavloite and skuruppu Oct 1, 2020
Copy link
Contributor

@olavloite olavloite left a comment

This looks generally good to me. There is one integration test case that needs a small change.

There are also a number of generated code changes in this PR. I assume that those will be added through a separate PR, and removed from this.

@thiagotnunes thiagotnunes requested a review from as a code owner Oct 1, 2020
@thiagotnunes thiagotnunes added the kokoro:force-run label Oct 7, 2020
@yoshi-kokoro yoshi-kokoro removed the kokoro:force-run label Oct 7, 2020
@codecov
Copy link

@codecov codecov bot commented Oct 8, 2020

Codecov Report

Merging #452 (e752a39) into master (44aa384) will decrease coverage by 0.04%.
The diff coverage is 67.69%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master     #452      +/-   ##
============================================
- Coverage     85.24%   85.19%   -0.05%     
- Complexity     2612     2620       +8     
============================================
  Files           144      145       +1     
  Lines         14208    14260      +52     
  Branches       1372     1376       +4     
============================================
+ Hits          12111    12149      +38     
- Misses         1526     1537      +11     
- Partials        571      574       +3     
Impacted Files Coverage Δ Complexity Δ
...gle/cloud/spanner/testing/RemoteSpannerHelper.java 0.00% <0.00%> (ø) 0.00 <0.00> (ø)
.../google/cloud/spanner/testing/TimestampHelper.java 30.00% <30.00%> (ø) 1.00 <1.00> (?)
...in/java/com/google/cloud/spanner/DatabaseInfo.java 66.66% <55.55%> (ø) 8.00 <2.00> (+2.00)
...main/java/com/google/cloud/spanner/BackupInfo.java 83.60% <62.50%> (-0.03%) 12.00 <1.00> (+1.00) ⬇️
...src/main/java/com/google/cloud/spanner/Backup.java 87.50% <100.00%> (-1.60%) 23.00 <0.00> (-1.00)
...c/main/java/com/google/cloud/spanner/Database.java 68.42% <100.00%> (+3.71%) 15.00 <0.00> (ø)
.../google/cloud/spanner/DatabaseAdminClientImpl.java 85.18% <100.00%> (+0.91%) 32.00 <3.00> (+1.00)
...m/google/cloud/spanner/connection/SpannerPool.java 87.36% <0.00%> (-0.53%) 33.00% <0.00%> (ø%)
...a/com/google/cloud/spanner/SessionPoolOptions.java 69.53% <0.00%> (ø) 18.00% <0.00%> (+1.00%)
... and 3 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 44aa384...e752a39. Read the comment docs.

@generated-files-bot
Copy link

@generated-files-bot generated-files-bot bot commented Nov 12, 2020

Warning: This pull request is touching the following templated files:

  • google-cloud-spanner/src/test/java/com/google/cloud/spanner/admin/database/v1/DatabaseAdminClientTest.java
  • proto-google-cloud-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/Backup.java
  • proto-google-cloud-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/BackupOrBuilder.java
  • proto-google-cloud-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/BackupProto.java
  • proto-google-cloud-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/CommonProto.java
  • proto-google-cloud-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/CreateDatabaseRequest.java
  • proto-google-cloud-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/CreateDatabaseRequestOrBuilder.java
  • proto-google-cloud-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/Database.java
  • proto-google-cloud-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/DatabaseOrBuilder.java
  • proto-google-cloud-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/SpannerDatabaseAdminProto.java

@google-cla
Copy link

@google-cla google-cla bot commented Nov 12, 2020

All (the pull request submitter and all commit authors) CLAs are signed, but one or more commits were authored or co-authored by someone other than the pull request submitter.

We need to confirm that all authors are ok with their commits being contributed to this project. Please have them confirm that by leaving a comment that contains only @googlebot I consent. in this pull request.

Note to project maintainer: There may be cases where the author cannot leave a comment, or the comment is not properly detected as consent. In those cases, you can manually confirm consent of the commit author(s), and set the cla label to yes (if enabled on your project).

ℹ️ Googlers: Go here for more info.

@google-cla google-cla bot added cla: no and removed cla: yes labels Nov 12, 2020
@generated-files-bot
Copy link

@generated-files-bot generated-files-bot bot commented Nov 12, 2020

Warning: This pull request is touching the following templated files:

  • google-cloud-spanner/src/test/java/com/google/cloud/spanner/admin/database/v1/DatabaseAdminClientTest.java
  • proto-google-cloud-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/Backup.java
  • proto-google-cloud-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/BackupOrBuilder.java
  • proto-google-cloud-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/BackupProto.java
  • proto-google-cloud-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/CommonProto.java
  • proto-google-cloud-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/CreateDatabaseRequest.java
  • proto-google-cloud-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/CreateDatabaseRequestOrBuilder.java
  • proto-google-cloud-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/Database.java
  • proto-google-cloud-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/DatabaseOrBuilder.java
  • proto-google-cloud-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/SpannerDatabaseAdminProto.java

@google-cla
Copy link

@google-cla google-cla bot commented Nov 12, 2020

All (the pull request submitter and all commit authors) CLAs are signed, but one or more commits were authored or co-authored by someone other than the pull request submitter.

We need to confirm that all authors are ok with their commits being contributed to this project. Please have them confirm that by leaving a comment that contains only @googlebot I consent. in this pull request.

Note to project maintainer: There may be cases where the author cannot leave a comment, or the comment is not properly detected as consent. In those cases, you can manually confirm consent of the commit author(s), and set the cla label to yes (if enabled on your project).

ℹ️ Googlers: Go here for more info.

@generated-files-bot
Copy link

@generated-files-bot generated-files-bot bot commented Nov 16, 2020

Warning: This pull request is touching the following templated files:

  • google-cloud-spanner/src/test/java/com/google/cloud/spanner/admin/database/v1/DatabaseAdminClientTest.java
  • proto-google-cloud-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/Backup.java
  • proto-google-cloud-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/BackupOrBuilder.java
  • proto-google-cloud-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/BackupProto.java
  • proto-google-cloud-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/CommonProto.java
  • proto-google-cloud-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/CreateDatabaseRequest.java
  • proto-google-cloud-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/CreateDatabaseRequestOrBuilder.java
  • proto-google-cloud-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/Database.java
  • proto-google-cloud-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/DatabaseOrBuilder.java
  • proto-google-cloud-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/SpannerDatabaseAdminProto.java

@google-cla google-cla bot added cla: yes and removed cla: no labels Nov 16, 2020
Copy link

@yoshi-code-bot yoshi-code-bot left a comment

Some suggestions could not be made:

  • google-cloud-spanner/src/main/java/com/google/cloud/spanner/DatabaseInfo.java
    • lines 201-212

@thiagotnunes thiagotnunes changed the title feat: Point In Time Recovery (PITR) feat!: Point In Time Recovery (PITR) Jan 29, 2021
thiagotnunes added 18 commits Feb 1, 2021
Exposes earliest version time and version retention period fields in the
database class.
Adds integration tests for updating the version retention period.
Adds create database tests for PITR and refactors the integration test
class.
Separates PITR database tests into 2 files for clarity.
The feature is not supported in the emulator currently.
Addresses PR comment.
To compare version retention period and earliest version time.
Fixes formatting of the DatabaseInfo
Adds test to check for the throttled field in the update database ddl
metadata.
Adds more explanations to the purpose of the added params for pitr-lite:
version_retention_period and earliest_version_time.
Adds PITR-lite version time to backups. This should make it possible to
specify the consistent time for copying the database.
@thiagotnunes thiagotnunes removed the do not merge label Feb 17, 2021
@thiagotnunes thiagotnunes merged commit ab14a5e into googleapis:master Feb 17, 2021
17 of 19 checks passed
@thiagotnunes thiagotnunes deleted the pitr-lite branch Feb 17, 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