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

delimiter.js maxKeys==0 param issue #250

Open
jonathan-gramain opened this issue May 2, 2017 · 4 comments
Open

delimiter.js maxKeys==0 param issue #250

jonathan-gramain opened this issue May 2, 2017 · 4 comments

Comments

@jonathan-gramain
Copy link
Contributor

jonathan-gramain commented May 2, 2017

In algos/list/delimiter.js, in the constructor of Delimiter class, if maxKeys is provided with a value of 0, it gets assigned to 1000 (this.maxKeys = parameters.maxKeys || 1000).

This causes the s3tests.functional.test_s3.test_bucket_list_maxkeys_zero CEPH test to fail because it expects zero entry when setting the limit to 0 but it has all of them.

@DavidPineauScality maybe this bug also affects MetaData in some way, although the ironman machine is obviously happy here, please check.

@jonathan-gramain
Copy link
Contributor Author

0 seems to be considered as a special value in the current code, so it may not be easily fixable.

in delimiter.js:

    /**
     * check if the max keys count has been reached and set the
     * final state of the result if it is the case
     * @return {Boolean} - indicates if the iteration has to stop
     */
    _reachedMaxKeys() {
        if (this.keys >= this.maxKeys) {
            // In cases of maxKeys <= 0 -> IsTruncated = false
            this.IsTruncated = this.maxKeys > 0;
            return true;
        }
        return false;
    }

@ghost
Copy link

ghost commented May 2, 2017

Assigning myself to keep track of it.

@ghost ghost self-assigned this May 2, 2017
@jonathan-gramain
Copy link
Contributor Author

Reading the above function, I also wonder if we don't return the wrong IsTruncated attribute when the total number of keys is exactly maxKeys.

@ghost
Copy link

ghost commented May 3, 2017

Let's take a look at this issue from another angle:

  • Is is even relevant to ask the backend to do a listing of 0 items ? This sounds like work for nothing.
  • Should it not be handled by S3 itself instead, that could be directly answering with an empty listing ? (ie: Similarly as what we do for 0-byte objects)

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

1 participant