Skip to content

docs(services/s3): fix inverted comment on disable_list_objects_v2#7820

Merged
Xuanwo merged 2 commits into
apache:mainfrom
yangyang233333:fix-disable-list-objects-v2-doc-comment
Jun 25, 2026
Merged

docs(services/s3): fix inverted comment on disable_list_objects_v2#7820
Xuanwo merged 2 commits into
apache:mainfrom
yangyang233333:fix-disable-list-objects-v2-doc-comment

Conversation

@yangyang233333

Copy link
Copy Markdown
Contributor

Which issue does this PR close?

N/A — small doc-comment fix.

Rationale

The doc comment on S3Builder::disable_list_objects_v2 describes the opposite of the actual behavior.

Current first line:

Disable list objects v2 so that opendal will not use the older List Objects V1 to list objects.

But setting disable_list_objects_v2 = true makes the backend select S3ListerV1 (see backend.rs, the else if self.core.disable_list_objects_v2 { ... S3ListerV1::new(...) } branch). So disabling V2 makes OpenDAL fall back to V1, not avoid it.

The wording also contradicts the very next sentence ("some legacy services do not yet support V2"), which implies falling back to V1 is the intended behavior.

This PR changes "will not use the older List Objects V1" → "will fall back to the older List Objects V1" so the comment matches the code. No functional change.

Changes

  • core/services/s3/src/backend.rs: one-line doc-comment wording fix.

The first line of the doc comment said disabling list objects v2 makes
OpenDAL 'not use the older List Objects V1', which is the opposite of the
actual behavior. Setting disable_list_objects_v2 = true makes the backend
select S3ListerV1, i.e. it falls back TO the older List Objects V1.

Fix the wording to 'fall back to the older List Objects V1' to match the
code and the following sentence about legacy services not supporting V2.
@yangyang233333 yangyang233333 requested a review from Xuanwo as a code owner June 25, 2026 01:47
@dosubot dosubot Bot added size:XS This PR changes 0-9 lines, ignoring generated files. releases-note/docs The PR modifies docs related content or has a title that begins with "docs" labels Jun 25, 2026
}

/// Disable list objects v2 so that opendal will not use the older
/// Disable list objects v2 so that opendal will fall back to the older

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
/// Disable list objects v2 so that opendal will fall back to the older
/// Disable list objects v2 so that Openal will fall back to the older

I strongly suggest deprecating disable_ functions and to use enable instead because it takes time to understand some tricky combination of configurations.

In this case, enable_legacy_list_objects_v1 would do. It has been a while since AWS deprecate this. Doc is here.

This action has been revised. We recommend that you use the newer version, ListObjectsV2, when developing applications. For backward compatibility, Amazon S3 continues to support ListObjects.

@Xuanwo Xuanwo Jun 25, 2026

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I feel enable_legacy_list_objects_v1 seems to be good but that introduce a new config. I think it's find to implement as a follow-up.

@dosubot dosubot Bot added the lgtm This PR has been approved by a maintainer label Jun 25, 2026
@Xuanwo Xuanwo merged commit 73ba2c0 into apache:main Jun 25, 2026
108 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

lgtm This PR has been approved by a maintainer releases-note/docs The PR modifies docs related content or has a title that begins with "docs" size:XS This PR changes 0-9 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants