Bug 2344993

Summary: [rgw][server-access-logging]: radosgw-admin bucket logging flush command is returning next log object name instead of current log object name
Product: [Red Hat Storage] Red Hat Ceph Storage Reporter: Hemanth Sai <hmaheswa>
Component: RGWAssignee: Yuval Lifshitz <ylifshit>
Status: VERIFIED --- QA Contact: Hemanth Sai <hmaheswa>
Severity: medium Docs Contact: Rivka Pollack <rpollack>
Priority: unspecified    
Version: 8.0CC: ceph-eng-bugs, cephqe-warriors, mbenjamin, rpollack, tserlin, ylifshit
Target Milestone: ---   
Target Release: 8.1   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: ceph-19.2.1-80.el9cp Doc Type: Bug Fix
Doc Text:
.The `radosgw-admin bucket logging flush` command now provides works as expected Previously, using the `radosgw-admin bucket logging flush` command would return the next lob object name. As a result, the user did not know the name of the log object that was flushed without listing the log bucket. With this fix, the correct name of the object that was flushed is now returned as expected.
Story Points: ---
Clone Of: Environment:
Last Closed: Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 2351689    

Description Hemanth Sai 2025-02-11 18:27:08 UTC
Description of problem:
The log object name that is returned by the radosgw-admin bucket logging flush command and the log object that is actually delivered to the target bucket is not the same.
The command is actually returning the next log object name instead of current object name
we can also observe that the log object name that is delivered currently to the target bucket contains timestamp that is equal to previous log object delivered time



log snippet:

[root@magna016 ~]# aws --endpoint-url http://10.8.128.16:81 --profile hsm s3 cp obj1_4KB s3://src-bkt10/obj6
upload: ./obj1_4KB to s3://src-bkt10/obj6                      
[root@magna016 ~]# 
[root@magna016 ~]# radosgw-admin bucket logging flush --bucket src-bkt10
flushed pending logging object 'src-bkt10-logs2025-02-10-18-14-49-4BQC4NF8OAMC5WXU' to target bucket 'dest-bkt10'
[root@magna016 ~]# 
[root@magna016 ~]# 
[root@magna016 ~]# aws --endpoint-url http://10.8.128.16:81 --profile hsm s3 ls s3://dest-bkt10
2025-02-10 18:14:49        103 src-bkt10-logs2025-02-10-18-14-41-VEAOHMMF60OVY6RS
[root@magna016 ~]# 
[root@magna016 ~]# 
[root@magna016 ~]# aws --endpoint-url http://10.8.128.16:81 --profile hsm s3 cp obj1_4KB s3://src-bkt10/obj7
upload: ./obj1_4KB to s3://src-bkt10/obj7                      
[root@magna016 ~]# 
[root@magna016 ~]# radosgw-admin bucket logging flush --bucket src-bkt10
flushed pending logging object 'src-bkt10-logs2025-02-10-18-16-10-PAX5MDPUOVE0SUI9' to target bucket 'dest-bkt10'
[root@magna016 ~]# 
[root@magna016 ~]# 
[root@magna016 ~]# aws --endpoint-url http://10.8.128.16:81 --profile hsm s3 ls s3://dest-bkt10
2025-02-10 18:14:49        103 src-bkt10-logs2025-02-10-18-14-41-VEAOHMMF60OVY6RS
2025-02-10 18:16:10        103 src-bkt10-logs2025-02-10-18-14-49-4BQC4NF8OAMC5WXU
[root@magna016 ~]# 
[root@magna016 ~]# 
[root@magna016 ~]# aws --endpoint-url http://10.8.128.16:81 --profile hsm s3 cp obj1_4KB s3://src-bkt10/obj8
upload: ./obj1_4KB to s3://src-bkt10/obj8                      
[root@magna016 ~]# 
[root@magna016 ~]# radosgw-admin bucket logging flush --bucket src-bkt10
flushed pending logging object 'src-bkt10-logs2025-02-10-18-16-48-5238891NCD2YP6WQ' to target bucket 'dest-bkt10'
[root@magna016 ~]# 
[root@magna016 ~]# aws --endpoint-url http://10.8.128.16:81 --profile hsm s3 ls s3://dest-bkt10
2025-02-10 18:14:49        103 src-bkt10-logs2025-02-10-18-14-41-VEAOHMMF60OVY6RS
2025-02-10 18:16:10        103 src-bkt10-logs2025-02-10-18-14-49-4BQC4NF8OAMC5WXU
2025-02-10 18:16:48        103 src-bkt10-logs2025-02-10-18-16-10-PAX5MDPUOVE0SUI9
[root@magna016 ~]# 


Version-Release number of selected component (if applicable):
ceph version 19.2.0-53.el9cp

How reproducible:
always

Steps to Reproduce:
1.create a bucket
2.put-bucket-logging on the bucket
3.upload few objects and flush the log using below command. we observe that the log object name that is returned by the command and the log object that is actually delivered to the target bucket is not the same. infact the log object name that is delivered by command is actually the next log object name.
[root@magna016 ~]# radosgw-admin bucket logging flush --bucket src-bkt10
flushed pending logging object 'src-bkt10-logs2025-02-10-18-14-49-4BQC4NF8OAMC5WXU' to target bucket 'dest-bkt10'
[root@magna016 ~]#



Actual results:
radosgw-admin bucket logging flush is not returning the current log object name instead it is returning next log object name.

Expected results:
expected the log object name that the command returns and the actual log object delivered is the same.

Additional info:
captured the log output in this doc:
https://docs.google.com/document/d/1dsPIVFUt6sEjYYAKoyyvmAA14cW2vkHUW9akJIhNOQU/edit?usp=sharing