Skip to content

feat: add option to disable bulk delete for aws#734

Merged
alamb merged 3 commits into
apache:mainfrom
openobserve:disable-bulk-delete
Jun 2, 2026
Merged

feat: add option to disable bulk delete for aws#734
alamb merged 3 commits into
apache:mainfrom
openobserve:disable-bulk-delete

Conversation

@hengfeiyang
Copy link
Copy Markdown
Contributor

@hengfeiyang hengfeiyang commented May 27, 2026

Which issue does this PR close?

Rationale for this change

We discussed in #731 and agree to add an option to disable bulk_delete for AWS.

What changes are included in this PR?

Add a new option for AWS s3 client with_disable_bulk_delete.

Are there any user-facing changes?

User can use client.with_disable_bulk_delete(true) to disable bulk delete if his provider doesn't compatible for s3 bulk delete API.

@hengfeiyang
Copy link
Copy Markdown
Contributor Author

@alamb @tustvold Can you help review?

@alamb
Copy link
Copy Markdown
Contributor

alamb commented May 28, 2026

What do you think about @PsiACE suggestion here: #731 (comment)

@Xuanwo 's suggestion is correct. Your request was sent to the wrong endpoint. Adding an option to disable bulk delete is not the right solution to this problem.

Adding an option to disable bulk delete does seem reasonable however

Copy link
Copy Markdown
Contributor

@alamb alamb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @hengfeiyang -- this code looks good to me -- it is clearly a compatible and opt-in option for the API

Two issues in my mind:

  1. I had a question about one more test
  2. @PsiACE's question

Comment thread src/aws/mod.rs
Ok(location)
}
})
.buffered(20)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wondered how you picked 20 as the concurrency but it seems to mirror the buffered(20) below

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes. it is from bellow.

Comment thread src/aws/client.rs Outdated
}

#[tokio::test]
async fn test_disable_bulk_delete_uses_single_object_delete() {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is there an existing test that shows that bulk_delete actually uses the POST /delete API? I didn't see one immediately

If not I think we should add one to document in test the different behaviors

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let me check this test case.

@hengfeiyang
Copy link
Copy Markdown
Contributor Author

@alamb about @PsiACE's question, I replied in the issue #731

hengfeiyang added a commit to openobserve/arrow-rs-object-store that referenced this pull request May 28, 2026
Address review feedback from apache#734: add a test that demonstrates the
default `delete_stream` path uses the bulk `DeleteObjects` API
(`POST /?delete`), complementing the existing test for the new
`disable_bulk_delete` single-object path.

While here, fix the assertion pattern used by these tests. `MockServer`
swallows panics inside response closures (the connection resets and the
S3 retry logic can still surface a Ok result), so assertions placed
inside the closure were silently ignored. Capture request data into
shared state and assert in the main test body so violations genuinely
fail the test.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@hengfeiyang hengfeiyang force-pushed the disable-bulk-delete branch from 655a486 to a5c9a86 Compare May 28, 2026 15:37
@hengfeiyang
Copy link
Copy Markdown
Contributor Author

@alamb i added 4 new unit tests, the key point is different option will generate different result:

  • with_virtual_hosted_style_request
  • with_disable_bulk_delete

Unit tests

# Test name virtual_hosted disable_bulk_delete Expected request
1 test_delete_default false false POST /test-bucket?delete
2 test_delete_default_with_disable_bulk false true DELETE /test-bucket/foo, DELETE /test-bucket/bar (no query)
3 test_delete_virtual_hosted true false POST /?delete
4 test_delete_virtual_hosted_with_disable_bulk true true DELETE /foo, DELETE /bar (no query)

@alamb alamb merged commit a9a83f1 into apache:main Jun 2, 2026
9 checks passed
@alamb
Copy link
Copy Markdown
Contributor

alamb commented Jun 2, 2026

thanks @hengfeiyang and @tustvold

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

S3: delete() now requires DeleteObjects (bulk delete) support, breaks S3-compatible providers (Alibaba Cloud OSS, etc.)

3 participants