GCS backend: delete_objects chunks by max_keys_per_delete() but still deletes one object per request
GCSBucket::delete_objects (libs/remote_storage/src/gcs_bucket.rs:~1165) chunks paths by self.max_keys_per_delete() and then iterates every element of every chunk calling delete_oneshot individually, so the chunking has no effect and deletes are N sequential requests.
Two leftovers suggest this is an incomplete port of the S3 path rather than intentional:
let mut delete_objects: Vec<String> = Vec::with_capacity(paths.len());is allocated at the top and never pushed to.S3Bucket::delete_objects(s3_bucket.rs:950) allocates the same vector, fills it withObjectIdentifiers, and issues a single batcheddelete_oidsper chunk.rustcflags bothdelete_objectsas unused andGCSBucket::max_keys_per_deleteas never used, alongside unusedfrom/cancelparams and an unusedTryStreamExtimport in the same file.
Correctness looks fine, objects do get deleted. The cost is request volume: deleting a large layer set issues one request per object where S3 batches. Relevant to GC and timeline deletion, cf. #10265.
Happy to send a PR using GCS batch delete if that's wanted, though I don't have a GCS account to test against, so I'd want guidance on how you validate this backend. Found while building the repo locally (initial GCS support #11666, later delete fix #12873).
Source: neondatabase/neon