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

fix batch deletion in removeObjects #1131

Merged
merged 1 commit into from
Apr 26, 2023

Conversation

prakashsvmx
Copy link
Member

fix: removeObjects does not delete more than 1000 objects.

test data setup. generate n number of objects for testing batched deletion from js sdk.

mc mb local22/test-bucket

mc admin user add  local22 test-user minio123
mc admin policy attach local22 readonly --user test-user  # Access denied for this user for deletion

for ((i = 0 ; i < 1110 ; i++)); do
 echo "1" | mc pipe local22/test-bucket/${i}.txt
done

now try to delete from the sdk


const deleteList = [{name:"non-existent"}]

for(let i=0;i<1110; i++){
  deleteList.push({
    name:`${i}.txt`
  })
}

deleteList.splice(2, 0, { name:"does not exist object2"} )
deleteList.splice(1108, 0, { name:"does not exist object1110"} )

s3Client.removeObjects("test-bucket", deleteList ,(e, res) => {

if (e) {
    return console.log(e)
  }
  console.log("Success")
// Note : Inspect the res to find out if an object deletion is success or failure.

})

@kaankabalak
Copy link
Contributor

@prakashsvmx Is there any specific reason for the changes in the package.json file? As far as I can see, we aren't using any new packages for the code changed in src/main/minio.js

@prakashsvmx
Copy link
Member Author

It just lock file version upgrade as per npm.

@harshavardhana harshavardhana merged commit a2d2c0b into minio:master Apr 26, 2023
14 checks passed
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.

None yet

3 participants