How to restore the state of a reliable service from an existing backup?

I have a backup logic state service implemented in accordance with the relevant documentation

Same:

protected override async Task RunAsync(CancellationToken cancellationToken)
{
  // ...

  while (true)
  {
    cancellationToken.ThrowIfCancellationRequested();
    BackupDescription myBackupDescription = new BackupDescription(BackupOption.Full, this.BackupCallbackAsync);
    await this.BackupAsync(myBackupDescription);

    // ...

    await Task.Delay(TimeSpan.FromSeconds(1), cancellationToken);
  }
}

private async Task<bool> BackupCallbackAsync(BackupInfo backupInfo, CancellationToken cancellationToken)
{
  var backupId = Guid.NewGuid();
  // backup files copied to external storage here ...
  return true;
}

The documentation offers only one way to restore backups - using the method OnDataLossAsync. But I can not provoke a challenge to this mechtod.

So the question is: how can I restore the state of a service from my backup in case of complete data loss?

For example, all nodes of a service network cluster were destroyed. The only thing I have is my backup. What should I do after redistribution to restore the state of my services?

Data Log Service Fabric, - .

+4
1

Dataloss - :

Connect-ServiceFabricCluster
$s = "fabric:/WebReferenceApplication/InventoryService"
$p = Get-ServiceFabricApplication | Get-ServiceFabricService -ServiceName $s | Get-ServiceFabricPartition | Select -First 1
$p | Invoke-ServiceFabricPartitionDataLoss -DataLossMode FullDataLoss -ServiceName $s

, , - , .

.

+1

Source: https://habr.com/ru/post/1654294/


All Articles