diff --git a/cs/src/core/FasterLog/FasterLogRecoveryInfo.cs b/cs/src/core/FasterLog/FasterLogRecoveryInfo.cs index ef6633890..6cb82ec85 100644 --- a/cs/src/core/FasterLog/FasterLogRecoveryInfo.cs +++ b/cs/src/core/FasterLog/FasterLogRecoveryInfo.cs @@ -239,7 +239,8 @@ public void CommitIterators(ConcurrentDictionary { foreach (var kvp in Iterators) { - persistedIterators[kvp.Key].UpdateCompletedUntilAddress(kvp.Value); + if (persistedIterators.TryGetValue(kvp.Key, out FasterLogScanIterator iterator)) + iterator.UpdateCompletedUntilAddress(kvp.Value); } } } diff --git a/cs/src/devices/AzureStorageDevice/AzureStorageNamedDeviceFactory.cs b/cs/src/devices/AzureStorageDevice/AzureStorageNamedDeviceFactory.cs index bbe0c196a..e22c92b06 100644 --- a/cs/src/devices/AzureStorageDevice/AzureStorageNamedDeviceFactory.cs +++ b/cs/src/devices/AzureStorageDevice/AzureStorageNamedDeviceFactory.cs @@ -1,4 +1,5 @@ using FASTER.core; +using Microsoft.Extensions.Logging; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; @@ -13,13 +14,15 @@ public class AzureStorageNamedDeviceFactory : INamedDeviceFactory readonly BlobUtilsV12.ServiceClients pageBlobAccount; BlobUtilsV12.ContainerClients pageBlobContainer; BlobUtilsV12.BlobDirectory pageBlobDirectory; + readonly ILogger logger; /// /// Create instance of factory for Azure devices /// /// - public AzureStorageNamedDeviceFactory(string connectionString) - : this(BlobUtilsV12.GetServiceClients(connectionString)) + /// + public AzureStorageNamedDeviceFactory(string connectionString, ILogger logger = null) + : this(BlobUtilsV12.GetServiceClients(connectionString), logger) { } @@ -27,9 +30,11 @@ public AzureStorageNamedDeviceFactory(string connectionString) /// Create instance of factory for Azure devices /// /// - AzureStorageNamedDeviceFactory(BlobUtilsV12.ServiceClients pageBlobAccount) + /// + AzureStorageNamedDeviceFactory(BlobUtilsV12.ServiceClients pageBlobAccount, ILogger logger = null) { this.pageBlobAccount = pageBlobAccount; + this.logger = logger; } /// @@ -76,7 +81,7 @@ public void Delete(FileDescriptor fileInfo) /// public IDevice Get(FileDescriptor fileInfo) { - return new AzureStorageDevice(fileInfo.fileName, pageBlobDirectory.GetSubDirectory(fileInfo.directoryName), null, false); + return new AzureStorageDevice(fileInfo.fileName, pageBlobDirectory.GetSubDirectory(fileInfo.directoryName), null, false, false, logger); } /// diff --git a/cs/src/devices/AzureStorageDevice/BlobEntry.cs b/cs/src/devices/AzureStorageDevice/BlobEntry.cs index 676a50d95..176d9c639 100644 --- a/cs/src/devices/AzureStorageDevice/BlobEntry.cs +++ b/cs/src/devices/AzureStorageDevice/BlobEntry.cs @@ -55,11 +55,6 @@ public BlobEntry(AzureStorageDevice azureStorageDevice) /// The page blob to create public async Task CreateAsync(long size, BlobUtilsV12.PageBlobClients pageBlob) { - if (this.waitingCount != 0) - { - this.azureStorageDevice.BlobManager?.HandleStorageError(nameof(CreateAsync), "expect to be called on blobs that don't already exist and exactly once", pageBlob.Default?.Name, null, false, false); - } - await this.azureStorageDevice.BlobManager.PerformWithRetriesAsync( this.azureStorageDevice.BlobManager.AsynchronousStorageReadMaxConcurrency, true, diff --git a/cs/src/devices/AzureStorageDevice/BlobManager.cs b/cs/src/devices/AzureStorageDevice/BlobManager.cs index aae76129a..70f5e42a8 100644 --- a/cs/src/devices/AzureStorageDevice/BlobManager.cs +++ b/cs/src/devices/AzureStorageDevice/BlobManager.cs @@ -87,7 +87,7 @@ internal BlobManager( this.leaseBlobDirectory = leaseBlobDirectory; this.LeaseBlobName = leaseBlobName ?? LeaseBlobName; this.TraceHelper = new FasterTraceHelper(logger, logLevelLimit, performanceLogger); - this.StorageErrorHandler = errorHandler ?? new StorageErrorHandler(null, logLevelLimit, null, null); + this.StorageErrorHandler = errorHandler ?? new StorageErrorHandler(logger, logLevelLimit, null, null); this.shutDownOrTermination = errorHandler == null ? new CancellationTokenSource() : CancellationTokenSource.CreateLinkedTokenSource(errorHandler.Token);