peterxcli opened a new pull request, #7929:
URL: https://github.com/apache/ozone/pull/7929

   ## What changes were proposed in this pull request?
   
   **Generate the upload id with time-ordered uuid, so the same key would be 
sorted by creation time in ListMultipartUploads response.**
   
   https://docs.aws.amazon.com/AmazonS3/latest/API/API_ListMultipartUploads.html
   
   
![image](https://github.com/user-attachments/assets/ab076ddd-09db-4653-b3dd-48042e6100a9)
   
   ListMultipartUploads result enforces sorting order based on key and time 
(only for general purpose bucket).
   
   Currently, Ozone "sorts" the result based on the upload ID since the DB key 
for multipartInfoTable is `/{VOLUME_NAME}/{BUCKET_NAME}/{KEY_NAME}/{UPLOAD_ID}` 
(for LEGACY and OBS bucket). Since the DB key for multipart uploads with the 
same key has the same prefix `/{VOLUME_NAME}/{BUCKET_NAME}/{KEY_NAME}/`, the 
key-based sorting should be handled (assuming DB keys only contains ASCII 
characters, see the note at the bottom). Therefore, to enforce the time-based 
sorting, we can sort the multipart uploads with the same key based on the 
initiate time. We can also choose to only support this for LEGACY / OBS bucket.
   
   Note: Currently the StringCodec uses UTF-8 which might be encoded to 
different number of bytes depending of the character, and since RocksDB only 
cares about bytes, these might cause some unexpected sorting order. However, 
AFAIK for ASCII characters, UTF-8 will encoding is always 1 byte, so if the DB 
key are always ASCII, the key name sorting might hold. 
   
   ## What is the link to the Apache JIRA
   
   https://issues.apache.org/jira/browse/HDDS-11532
   
   ## How was this patch tested?
   
   `AbstractS3SDKV1Tests#testListMultipartUploads` and existing tests
   
   CI:
   https://github.com/peterxcli/ozone/actions/runs/13407959118
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to