Replay Cloud SQL transactions against datastore (#738)

* Replay Cloud SQL transactions against datastore

Implement the ReplicateToDatastore cron job that will apply all Cloud SQL
transactions to the datastore.  The last transaction id is stored in a
LastSqlTransaction entity in datastore.

Note that this will not be activated in production until a) the cron
configuration is updated and b) the cloudSql.replicateTransactions flag is set
to true in the nomulus config file.

* Post-review changes

Fixed immutability issues with LastSqlTransaction, write a single transaction
at a time to datastore.

* Changes requested in review

* Get a batch of SQL transactions

Read a batch of SQL transactions at a time and then process them
transactionally against datastore.

* Bring this up-to-date with the codebase

* Changes requested in review

* Fixed date in copyright
This commit is contained in:
Michael Muller 2021-03-05 10:35:30 -05:00 committed by GitHub
parent 63f8fcef18
commit b75eb0ad95
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
10 changed files with 415 additions and 5 deletions

View file

@ -13,6 +13,7 @@ HistoryEntry
HostResource
KmsSecret
KmsSecretRevision
LastSqlTransaction
Modification
OneTime
PollMessage

View file

@ -916,3 +916,7 @@ class google.registry.persistence.DomainHistoryVKey {
java.lang.Long historyRevisionId;
java.lang.String repoId;
}
class google.registry.schema.replay.LastSqlTransaction {
@Id long id;
long transactionId;
}