Repository navigation
feat: upload deduplication, mandatory locking service, and lock cleanup consolidation - #143
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This pull request refactors cluster-safe upload deduplication across all supported storage backends, enforces a mandatory locking service architecture with a Null Object fallback, consolidates upload lock cleanup, and standardizes multi-backend integration testing.
1. Upload Checksum Deduplication Architecture
DeduplicationServiceto manage thread-safe and cluster-safe deduplication lifecycles, CAS race resolution, missing parent detection, and reference-counted cleanups.DiskChecksumIndex: Filesystem-based index storing parent references and child links under<storagePath>/checksums/<algo>/<checksum>.S3ChecksumIndex: S3 object-based index leveraging conditional writes (If-None-Match: *) with automatic fallback to unconditional put-object, parent tombstoning, and child reference tracking.AzureBlobChecksumIndex: Azure Blob-based index using conditional blob uploads (If-None-Match: *) and blob prefixes for child trackers.Upload-Checksum) or the IETF Resumable Uploads for HTTP (RUFH) specification (Digest/Content-Digest).docs/DEDUPLICATION.mdand updatedREADME.md,docs/ARCHITECTURE.md,docs/CONFIGURATION.md,docs/S3_STORAGE.md, anddocs/AZURE_BLOB_STORAGE.md.2. Mandatory UploadLockingService & Null Object Pattern
UploadLockingServiceas mandatory across all storage backends (DiskStorageService,S3StorageService,AzureBlobStorageService, andThreadLocalCachedStorageAndLockingService).NoOpUploadLockingServiceimplementingUploadLockingService(Null Object Pattern) for unit testing and custom embedding environments where locking is handled externally.Utils.getLockingServiceOrDefault(...)to eliminate redundant null checks across request handlers and storage services.3. Storage Service Lifecycle & Lock Cleanup Consolidation
getUploadLockingService()toUploadStorageServiceinterface and its implementations.cleanupExpiredUploads(UploadLockingService)in favor of zero-argumentcleanupExpiredUploads().terminateUpload(UploadInfo)across all storage backends to ensure locks are cleanly and unconditionally removed upon upload termination.UploadInfo(serialVersionUID = -8751200491586638308L).AGENTS.mdand architecture docs thatUploadLockimplementsAutoCloseableand should always be managed with try-with-resources.