mirror of
https://github.com/google/nomulus.git
synced 2025-05-14 00:17:20 +02:00
Fix code to always set HistoryEntry modification time using txn time
Since HistoryEntry always represents a read-only log of mutation to a core resource, that mutation should always happen in a transaction, and the HistoryEntry should be saved in that transaction. As such, it's always more accurate to use ofy().getTransactionTime() for the modificationTime of the HistoryEntry rather than just DateTime.now(UTC). In addition, having these be the exact same timestamp makes it possible to align HistoryEntries with commit log manifests using modificationTime = transactionTime, which is useful for recovery and analysis purposes. ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=170136957
This commit is contained in:
parent
ceadfea11f
commit
2702c3a7f3
3 changed files with 3 additions and 6 deletions
|
@ -104,7 +104,7 @@ public class HistoryEntry extends ImmutableObject implements Buildable {
|
|||
/** The actual EPP xml of the command, stored as bytes to be agnostic of encoding. */
|
||||
byte[] xmlBytes;
|
||||
|
||||
/** The time the command occurred. */
|
||||
/** The time the command occurred, represented by the ofy transaction time.*/
|
||||
@Index
|
||||
DateTime modificationTime;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue