Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

S3 listing ignores "IsTruncated = true" property #122

Closed
wyang007 opened this issue Jun 16, 2024 · 1 comment
Closed

S3 listing ignores "IsTruncated = true" property #122

wyang007 opened this issue Jun 16, 2024 · 1 comment

Comments

@wyang007
Copy link
Contributor

wyang007 commented Jun 16, 2024

In some cases, I see that Davix dir listing ignores true and when listing a bucket with a CEPH S3 storage. Here is an example:

DAVIX(body): Read block (910 bytes):
[<?xml version="1.0" encoding="UTF-8"?><ListBucketResult xmlns="http://s3.amazonaws.com/doc/2006-03-01/"><Name>rubin-sts</Name><Prefix>LSSTCam/</Prefix><MaxKeys>1000</MaxKeys><Delimiter>/</Delimiter><IsTruncated>true</IsTruncated><CommonPrefixes><Prefix>LSSTCam/20230526/</Prefix></CommonPrefixes><CommonPrefixes><Prefix>LSSTCam/20230531/</Prefix></CommonPrefixes><CommonPrefixes><Prefix>LSSTCam/20230601/</Prefix></CommonPrefixes><CommonPrefixes><Prefix>LSSTCam/20230604/</Prefix></CommonPrefixes><CommonPrefixes><Prefix>LSSTCam/20230606/</Prefix></CommonPrefixes><CommonPrefixes><Prefix>LSSTCam/20230612/</Prefix></CommonPrefixes><CommonPrefixes><Prefix>LSSTCam/20230613/</Prefix></CommonPrefixes><CommonPrefixes><Prefix>LSSTCam/20230614/</Prefix></CommonPrefixes><CommonPrefixes><Prefix>LSSTCam/20230615/</Prefix></CommonPrefixes><Marker></Marker><NextMarker>LSSTCam/20230615/</NextMarker></ListBucketResult>]

mpatrascoiu added a commit that referenced this issue Dec 30, 2024
…r" key is missing from the server response. In such cases, use the last listed item as the "NextMarker" value (issue #122)

Documentation:
https://docs.aws.amazon.com/AmazonS3/latest/API/API_ListObjects.html
@mpatrascoiu
Copy link
Contributor

mpatrascoiu commented Jan 20, 2025

Hello,

The initial pull-request (#124) handled the IsTruncated + NextMarker listing scenario. However, it was incomplete when the NextMarker propery was missing.

A pull-request (#127) was started on this, but provided only a partial solution. Further discussion was carried via e-mail.

The objective is to also handle correctly the S3 listing scenario when the IsTruncated flag is present, but the NextMarker property is missing. Although rare, it is allowed by the S3 specification: https://docs.aws.amazon.com/AmazonS3/latest/API/API_ListObjects.html

In such cases, in the next listing request, Davix should provided as NextMarker the last listed item, which can be either the last item in Contents or CommonPrefixes. This was addressed in the following commit:

  • [15ef1a3]: Handle the scenario where the listing is truncated but the "NextMarker" key is missing from the server response

The next version (Davix v0.8.8) will contain this fix.
Closing this ticket.

Cheers,
Mihai

@mpatrascoiu mpatrascoiu changed the title Dir listing ignores IsTruncated = true S3 listing ignores "IsTruncated = true" property Jan 20, 2025
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

No branches or pull requests

2 participants