private void DoRecovery() { TransactionalStateRecord <TState> storageState = this.storage.State; this.stableVersion = storageState.StableVersion; this.writeLowerBound = storageState.WriteLowerBound; this.version = storageState.Version; this.value = storageState.Value; RevertToPersistedLog(); // Rollback any known aborted transactions Restore(); }
private async Task Persist(long newStableVersion, long newWriteLowerBound) { RecordInPersistedLog(); // update storage state TransactionalStateRecord <TState> storageState = this.storage.State; storageState.Value = this.value; storageState.Version = this.version; storageState.StableVersion = newStableVersion; storageState.WriteLowerBound = newWriteLowerBound; await this.storage.WriteStateAsync(); this.stableVersion = newStableVersion; }