Bug #63657
openThe usage of all buckets will be deleted(If you execute DELETE /admin/usage?bucket={bucket-name})
0%
Description
The usage of all buckets will be deleted(If you execute DELETE /admin/usage?bucket={bucket-name})
[Reproduction Steps]
1) I'm sending files to the buckets "bucket-1", "bucket-2", and "bucket-3".
2) When the following API is executed, the transfer usage of "bucket-1", "bucket-2", and "bucket-3" are retrieved.
GET: /admin/usage?uid=user-1&start=2023-11-01T00:00:00.000Z&end=2023-11-30T09:59:59.000Z
3) Using the following API, only the transfer usage of "bucket-1" is deleted.
DELETE: /admin/usage?bucket=bucket-1&uid=user-1&remove-all=True&start=2023-11-01T00:00:00.000Z&end=2023-11-30T09:59:59.000Z
4) When the following API is executed, there is no transfer usage for "bucket-1", and the transfer usage of "bucket-2" and "bucket-3" are retrieved.
GET: /admin/usage?uid=user-1&start=2023-11-01T00:00:00.000Z&end=2023-11-30T09:59:59.000Z
5) I will delete the "bucket-2" using the following command.
aws --endpoint-url=http://ceph-s3-endpoint.com --no-verify-ssl s3api delete-bucket --bucket bucket-2
5) When the following API is executed, there is no transfer usage for "bucket-1", and the transfer usage of "bucket-2" and "bucket-3" are retrieved.
GET: /admin/usage?uid=user-1&start=2023-11-01T00:00:00.000Z&end=2023-11-30T09:59:59.000Z
6) Using the following API, only the transfer usage of "bucket-2" is deleted. (This step is the defect detection step.)
- Expected Result: When the following API is executed, only the transfer usage of "bucket-2" should be deleted, and the transfer usage of "bucket-3" should be maintained.
- Actual Result: When the following API is executed, the transfer usage of all Buckets are deleted.
DELETE: /admin/usage?bucket=bucket-2&uid=user-1&remove-all=True&start=2023-11-01T00:00:00.000Z&end=2023-11-30T09:59:59.000Z
7) When the following API is executed, the transfer usage of all Buckets are retrieved. (This step is the defect detection step.)
- Expected Result: When the following API is executed, there should be no transfer usage for "bucket-1" and "bucket-2", and the transfer usage of "bucket-3" should be retrieved.
- Actual Result: When the following API is executed, the transfer usage of all Buckets are not retrieved.
GET: /admin/usage?uid=user-1&start=2023-11-01T00:00:00.000Z&end=2023-11-30T09:59:59.000Z
Updated by KangKyu Lee 5 months ago
The usage of all buckets will be deleted(If you execute DELETE /admin/usage?bucket={bucket-name})
[Reproduction Steps]
1) I'm sending files to the buckets "bucket-1", "bucket-2", and "bucket-3".
2) When the following API is executed, the transfer usage of "bucket-1", "bucket-2", and "bucket-3" are retrieved.
GET: /admin/usage?uid=user-1&start=2023-11-01T00:00:00.000Z&end=2023-11-30T09:59:59.000Z
3) Using the following API, only the transfer usage of "bucket-1" is deleted.
DELETE: /admin/usage?bucket=bucket-1&uid=user-1&remove-all=True&start=2023-11-01T00:00:00.000Z&end=2023-11-30T09:59:59.000Z
4) When the following API is executed, there is no transfer usage for "bucket-1", and the transfer usage of "bucket-2" and "bucket-3" are retrieved.
GET: /admin/usage?uid=user-1&start=2023-11-01T00:00:00.000Z&end=2023-11-30T09:59:59.000Z
5) I will delete the "bucket-2" using the following command.
aws --endpoint-url=http://ceph-s3-endpoint.com --no-verify-ssl s3api delete-bucket --bucket bucket-2
6) When the following API is executed, there is no transfer usage for "bucket-1", and the transfer usage of "bucket-2" and "bucket-3" are retrieved.
GET: /admin/usage?uid=user-1&start=2023-11-01T00:00:00.000Z&end=2023-11-30T09:59:59.000Z
7) Using the following API, only the transfer usage of "bucket-2" is deleted. (This step is the defect detection step.)
- Expected Result: When the following API is executed, only the transfer usage of "bucket-2" should be deleted, and the transfer usage of "bucket-3" should be maintained.
- Actual Result: When the following API is executed, the transfer usage of all Buckets are deleted.
DELETE: /admin/usage?bucket=bucket-2&uid=user-1&remove-all=True&start=2023-11-01T00:00:00.000Z&end=2023-11-30T09:59:59.000Z
8) When the following API is executed, the transfer usage of all Buckets are retrieved. (This step is the defect detection step.)
- Expected Result: When the following API is executed, there should be no transfer usage for "bucket-1" and "bucket-2", and the transfer usage of "bucket-3" should be retrieved.
- Actual Result: When the following API is executed, the transfer usage of all Buckets are not retrieved.
GET: /admin/usage?uid=user-1&start=2023-11-01T00:00:00.000Z&end=2023-11-30T09:59:59.000Z
Updated by Ali Maredia about 2 months ago
This bug does not reproduce on main.
See the output of this script (https://paste.sh/2IyRPtr4#tuYSmCnqmS4RlogGPvdXnieO) run on a vstart cluster here: https://paste.sh/D4W9RWA1#swIgqgxV8hObaohgCgqRtjEn
The only things I notice that are off is that "bucket" is not documented as a parameter for get usage (https://docs.ceph.com/en/latest/radosgw/adminops/#get-usage) and that the usage log is slow or may never remove bkt2's information from the usage log.