1
0
mirror of https://github.com/google/nomulus synced 2026-01-11 08:20:27 +00:00

Ignore read-only mode in SQL->DS replication process (#1432)

* Ignore read-only mode in SQL->DS replication process

We need to be able to save indices and save data about the replication
even when we're in read-only mode.
This commit is contained in:
gbrodman
2021-11-24 11:51:25 -05:00
committed by GitHub
parent d4aa7b3c78
commit 4adb7d859d
2 changed files with 5 additions and 5 deletions

View File

@@ -228,10 +228,8 @@ public abstract class EppResource extends BackupGroupRoot implements Buildable {
/** Used when replaying from SQL to DS to populate the Datastore indexes. */
protected void saveIndexesToDatastore() {
ofyTm()
.putAll(
ForeignKeyIndex.create(this, getDeletionTime()),
EppResourceIndex.create(Key.create(this)));
ofyTm().putIgnoringReadOnly(ForeignKeyIndex.create(this, getDeletionTime()));
ofyTm().putIgnoringReadOnly(EppResourceIndex.create(Key.create(this)));
}
/** EppResources that are loaded via foreign keys should implement this marker interface. */

View File

@@ -148,7 +148,9 @@ public class ReplicateToDatastoreAction implements Runnable {
// Write the updated last transaction id to Datastore as part of this Datastore
// transaction.
auditedOfy().save().entity(lastSqlTxn.cloneWithNewTransactionId(nextTxnId));
auditedOfy()
.saveIgnoringReadOnly()
.entity(lastSqlTxn.cloneWithNewTransactionId(nextTxnId));
logger.atInfo().log(
"Finished applying single transaction Cloud SQL -> Cloud Datastore.");
});