What happened?
S3StorageClient.deleteDirectory(bucketName, directoryPrefix) lists objects under the prefix with a single listObjectsV2 call and then issues one deleteObjects batch. listObjectsV2 returns at most 1000 keys per page and the method does not paginate (no continuation-token loop), so only the first ≤1000 objects under the prefix are ever deleted. Any objects beyond the first 1000 are silently orphaned.
Related latent limit: AWS DeleteObjectsRequest accepts at most 1000 keys per call, so once listing is paginated, deletions must also be chunked into batches of ≤1000.
Expected: deleteDirectory should remove all objects under the prefix regardless of count.
Affected code
common/workflow-core/src/main/scala/org/apache/texera/service/util/S3StorageClient.scala — deleteDirectory (~lines 105–145): single listObjectsV2 (no isTruncated/nextContinuationToken loop) + single deleteObjects.
Suggested fix
Paginate the listing via the continuation token until isTruncated is false, accumulating keys, and delete them in batches of ≤1000 per DeleteObjectsRequest.
Branch
main
Affected Area
Storage
Impact / Priority
(P3) Low–Medium — pre-existing; only affects executions producing >1000 objects under a single prefix, but causes silent storage leaks.
What happened?
S3StorageClient.deleteDirectory(bucketName, directoryPrefix)lists objects under the prefix with a singlelistObjectsV2call and then issues onedeleteObjectsbatch.listObjectsV2returns at most 1000 keys per page and the method does not paginate (no continuation-token loop), so only the first ≤1000 objects under the prefix are ever deleted. Any objects beyond the first 1000 are silently orphaned.Related latent limit: AWS
DeleteObjectsRequestaccepts at most 1000 keys per call, so once listing is paginated, deletions must also be chunked into batches of ≤1000.Expected:
deleteDirectoryshould remove all objects under the prefix regardless of count.Affected code
common/workflow-core/src/main/scala/org/apache/texera/service/util/S3StorageClient.scala—deleteDirectory(~lines 105–145): singlelistObjectsV2(noisTruncated/nextContinuationTokenloop) + singledeleteObjects.Suggested fix
Paginate the listing via the continuation token until
isTruncatedis false, accumulating keys, and delete them in batches of ≤1000 perDeleteObjectsRequest.Branch
main
Affected Area
Storage
Impact / Priority
(P3) Low–Medium — pre-existing; only affects executions producing >1000 objects under a single prefix, but causes silent storage leaks.