Skip to content

Commit

Permalink
gco master AzDestSync
Browse files Browse the repository at this point in the history
  • Loading branch information
snalli committed Nov 5, 2023
1 parent cdb19ed commit b0de9ec
Showing 1 changed file with 2 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@
import com.azure.storage.blob.models.BlobRequestConditions;
import com.azure.storage.blob.models.BlobStorageException;
import com.azure.storage.blob.models.BlockBlobItem;
import com.azure.storage.blob.models.DeleteSnapshotsOptionType;
import com.azure.storage.blob.models.ListBlobsOptions;
import com.azure.storage.blob.options.BlobParallelUploadOptions;
import com.codahale.metrics.MetricRegistry;
Expand Down Expand Up @@ -111,19 +110,6 @@ public AzureCloudDestinationSync(VerifiableProperties verifiableProperties, Metr
* cloudConfig.cloudMaxAttempts = 1; retries are handled by azure-sdk
* cloudConfig.cloudRecentBlobCacheLimit = 0; unnecessary, as repl-logic avoids duplicate messages any ways
* cloudConfig.vcrMinTtlDays = Infinite; Just upload each blob, don't complicate it.
*
* Compaction Configs
* ==================
*
* cloudCompactionGracePeriodDays = 7; default, can lower for testing
* azureBlobStorageMaxResultsPerPage = 5000; default, max, can lower for testing
* cloudCompactionDryRunEnabled = false; for testing
* storeContainerDeletionRetentionDays = 14; default, can change for testing
* cloudBlobCompactionEnabled = true; if u want compaction, for testing
* cloudBlobCompactionIntervalHours ; gap between consecutive compaction cycles
* cloudCompactionNumThreads = 5; default, can change for testing
* cloudBlobCompactionStartupDelaySecs [UNUSED]
* cloudBlobCompactionShutdownTimeoutSecs = 10; default, for graceful exit, doesn't make a big difference
*/
this.accountService = accountService;
this.azureCloudConfig = new AzureCloudConfig(verifiableProperties);
Expand Down Expand Up @@ -756,7 +742,7 @@ protected int eraseBlobs(List<BlobItem> blobItemList, BlobContainerClient blobCo
} else {
Timer.Context storageTimer = azureMetrics.blobCompactionLatency.time();
logger.trace("[COMPACT] Erasing blob {} from Azure blob storage because {}", blobItem.getName(), eraseReason);
blobContainerClient.getBlobClient(blobItem.getName()).deleteIfExistsWithResponse(DeleteSnapshotsOptionType.INCLUDE, null, null, null);
blobContainerClient.getBlobClient(blobItem.getName()).delete();
storageTimer.stop();
vcrMetrics.blobCompactionRate.mark();
}
Expand Down Expand Up @@ -834,6 +820,7 @@ public int compactPartition(String partitionPath) throws CloudStorageException {
logger.info("[COMPACT] Erased {} blobs out of {} from partition {} in Azure blob storage", numBlobsPurged, totalNumBlobs, partitionPath);
return numBlobsPurged;
} catch (Throwable t) {
vcrMetrics.compactionFailureCount.inc();
String error = String.format("[COMPACT] Failed to compact partition %s due to %s", partitionPath, t.getMessage());
logger.error(error);
throw AzureCloudDestination.toCloudStorageException(error, t, null);
Expand Down

0 comments on commit b0de9ec

Please sign in to comment.