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:
@@ -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. */
|
||||
|
||||
@@ -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.");
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user