CreationDate in the s3api list-buckets output is constant
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
OpenStack Object Storage (swift) |
Confirmed
|
Medium
|
Unassigned |
Bug Description
I created few buckets on a swift-rocky cluster using aws s3api create-bucket
aws s3api --endpoint-url=https:/
{
"Location": "/bucket1"
}
aws s3api --endpoint-url=https:/
{
"Location": "/bucket2"
}
aws s3api --endpoint-url=https:/
{
"Location": "/bucket3"
}
aws s3api --endpoint-url=https:/
{
"Location": "/bucket4"
}
The output for list-buckets shows same/constant (very old) CreationDate.
aws s3api --endpoint-url=https:/
{
"Owner": {
"ID": "xxxxxxxxxxxxx"
},
"Buckets": [
{
"Name": "bucket1"
},
{
"Name": "bucket2"
},
{
"Name": "bucket3"
},
{
"Name": "bucket4"
}
]
}
The CreationDate is hardcoded in the s3api service controller:
Any suggestion about how we can get the correct CreationDate?
The container table in the db only has put_timestamp which we overwrite after POST too.
sqlite> .schema container
CREATE TABLE container (
);
After creation:
35|bucket1|
After post on bucket1:
39|bucket1|
Yeah -- I remember looking into it once, I have *no idea* where that date came from.
If we wanted to do it right, we'd probably have to pack multiple timestamps into the put_timestamp column, similar to what we do with the three timestamps objects have in the container DB:
sqlite> select created_at from object; 89510+1481c3+ 1a6a31
1576866812.
Might want to look at https:/ /github. com/openstack/ swift/blob/ master/ swift/common/ utils.py# L1375-L1460