Skip to content

rgw: add checksum type and algorithm in S3 APIs - #66493

Closed
sungjoon-koh wants to merge 4 commits into
ceph:mainfrom
sungjoon-koh:wip-s3-checksum-headers
Closed

sungjoon-koh wants to merge 4 commits into
ceph:mainfrom
sungjoon-koh:wip-s3-checksum-headers

Conversation

@sungjoon-koh

@sungjoon-koh sungjoon-koh commented Dec 3, 2025 •

Copy link
Copy Markdown
Contributor

tracker: 74071

Contribution Guidelines

  • To sign and title your commits, please refer to Submitting Patches to Ceph.

  • If you are submitting a fix for a stable branch (e.g. "quincy"), please refer to Submitting Patches to Ceph - Backports for the proper workflow.

  • When filling out the below checklist, you may click boxes directly in the GitHub web UI. When entering or editing the entire PR message in the GitHub web UI editor, you may also select a checklist item by adding an x between the brackets: [x]. Spaces and capitalization matter when checking off items this way.

Checklist

  • Tracker (select at least one)
    • References tracker ticket
    • Very recent bug; references commit where it was introduced
    • New feature (ticket optional)
    • Doc update (no ticket needed)
    • Code cleanup (no ticket needed)
  • Component impact
    • Affects Dashboard, opened tracker ticket
    • Affects Orchestrator, opened tracker ticket
    • No impact that needs to be tracked
  • Documentation (select at least one)
    • Updates relevant documentation
    • No doc update is appropriate
  • Tests (select at least one)
Show available Jenkins commands

You must only issue one Jenkins command per-comment. Jenkins does not understand
comments with more than one command.

@sungjoon-koh
sungjoon-koh requested a review from a team as a code owner December 3, 2025 08:28
@github-actions github-actions Bot added the rgw label Dec 3, 2025
@sungjoon-koh
sungjoon-koh force-pushed the wip-s3-checksum-headers branch from 27eb103 to 3110763 Compare December 3, 2025 08:30
@sungjoon-koh sungjoon-koh changed the title Add checksum type and algorithm in S3 APIs rgw: add checksum type and algorithm in S3 APIs Dec 3, 2025
@sungjoon-koh

Copy link
Copy Markdown
Contributor Author
  1. ListParts API
  • test script
BUCKET=cksum-test-20251203
KEY=testobj

fallocate part --len 5M
aws s3api create-bucket --bucket $BUCKET

for CHECKSUM_ALGO in crc64nvme crc32 crc32c sha1 sha256
do
        res=$(aws s3api create-multipart-upload \
                --bucket "$BUCKET" \
                --key "$KEY" \
                --checksum-algorithm "$CHECKSUM_ALGO")
        upload_id=$(echo "$res" | jq -r '.UploadId')

        aws s3api upload-part --bucket $BUCKET --key $KEY --upload-id $upload_id --body part --part-number 1 --checksum-algorithm "$CHECKSUM_ALGO" > /dev/null
        aws s3api upload-part --bucket $BUCKET --key $KEY --upload-id $upload_id --body part --part-number 2 --checksum-algorithm "$CHECKSUM_ALGO" > /dev/null
        aws s3api list-parts --bucket $BUCKET --key $KEY --upload-id $upload_id
done
  • aws result
# CRC64NVME
{
    "Parts": [
        {
            "PartNumber": 1,
            "LastModified": "2025-12-03T02:15:13+00:00",
            "ETag": "\"5f363e0e58a95f06cbe9bbc662c5dfb6\"",
            "Size": 5242880,
            "ChecksumCRC64NVME": "vqf3hRLTlJw="
        },
        {
            "PartNumber": 2,
            "LastModified": "2025-12-03T02:15:17+00:00",
            "ETag": "\"5f363e0e58a95f06cbe9bbc662c5dfb6\"",
            "Size": 5242880,
            "ChecksumCRC64NVME": "vqf3hRLTlJw="
        }
    ],
    "ChecksumAlgorithm": "CRC64NVME",
    "Initiator": {
        "ID": "arn:aws:iam::396070361885:user/sungjoon_koh",
        "DisplayName": "sungjoon_koh"
    },
    "Owner": {
        "ID": "263c74a141d813b697d62541fed8f754ef7b1803093e12f81d384ce0fac8f474"
    },
    "StorageClass": "STANDARD",
    "ChecksumType": "FULL_OBJECT"
}

# CRC32
{
    "Parts": [
        {
            "PartNumber": 1,
            "LastModified": "2025-12-03T02:15:23+00:00",
            "ETag": "\"5f363e0e58a95f06cbe9bbc662c5dfb6\"",
            "Size": 5242880,
            "ChecksumCRC32": "yTuzdQ=="
        },
        {
            "PartNumber": 2,
            "LastModified": "2025-12-03T02:15:31+00:00",
            "ETag": "\"5f363e0e58a95f06cbe9bbc662c5dfb6\"",
            "Size": 5242880,
            "ChecksumCRC32": "yTuzdQ=="
        }
    ],
    "ChecksumAlgorithm": "CRC32",
    "Initiator": {
        "ID": "arn:aws:iam::396070361885:user/sungjoon_koh",
        "DisplayName": "sungjoon_koh"
    },
    "Owner": {
        "ID": "263c74a141d813b697d62541fed8f754ef7b1803093e12f81d384ce0fac8f474"
    },
    "StorageClass": "STANDARD",
    "ChecksumType": "COMPOSITE"
}

# CRC32C
{
    "Parts": [
        {
            "PartNumber": 1,
            "LastModified": "2025-12-03T02:15:50+00:00",
            "ETag": "\"5f363e0e58a95f06cbe9bbc662c5dfb6\"",
            "Size": 5242880,
            "ChecksumCRC32C": "zqsFQg=="
        },
        {
            "PartNumber": 2,
            "LastModified": "2025-12-03T02:15:58+00:00",
            "ETag": "\"5f363e0e58a95f06cbe9bbc662c5dfb6\"",
            "Size": 5242880,
            "ChecksumCRC32C": "zqsFQg=="
        }
    ],
    "ChecksumAlgorithm": "CRC32C",
    "Initiator": {
        "ID": "arn:aws:iam::396070361885:user/sungjoon_koh",
        "DisplayName": "sungjoon_koh"
    },
    "Owner": {
        "ID": "263c74a141d813b697d62541fed8f754ef7b1803093e12f81d384ce0fac8f474"
    },
    "StorageClass": "STANDARD",
    "ChecksumType": "COMPOSITE"
}

# SHA1
{
    "Parts": [
        {
            "PartNumber": 1,
            "LastModified": "2025-12-03T02:16:21+00:00",
            "ETag": "\"5f363e0e58a95f06cbe9bbc662c5dfb6\"",
            "Size": 5242880,
            "ChecksumSHA1": "LpXXWCxTWD+or7VOD+eiWXySy7o="
        },
        {
            "PartNumber": 2,
            "LastModified": "2025-12-03T02:16:24+00:00",
            "ETag": "\"5f363e0e58a95f06cbe9bbc662c5dfb6\"",
            "Size": 5242880,
            "ChecksumSHA1": "LpXXWCxTWD+or7VOD+eiWXySy7o="
        }
    ],
    "ChecksumAlgorithm": "SHA1",
    "Initiator": {
        "ID": "arn:aws:iam::396070361885:user/sungjoon_koh",
        "DisplayName": "sungjoon_koh"
    },
    "Owner": {
        "ID": "263c74a141d813b697d62541fed8f754ef7b1803093e12f81d384ce0fac8f474"
    },
    "StorageClass": "STANDARD",
    "ChecksumType": "COMPOSITE"
}

# SHA256
{
    "Parts": [
        {
            "PartNumber": 1,
            "LastModified": "2025-12-03T02:16:38+00:00",
            "ETag": "\"5f363e0e58a95f06cbe9bbc662c5dfb6\"",
            "Size": 5242880,
            "ChecksumSHA256": "wDbLt1U6kJ+LiHfURhkkMH8n7LZs/5KO7q/VacOIfik="
        },
        {
            "PartNumber": 2,
            "LastModified": "2025-12-03T02:16:43+00:00",
            "ETag": "\"5f363e0e58a95f06cbe9bbc662c5dfb6\"",
            "Size": 5242880,
            "ChecksumSHA256": "wDbLt1U6kJ+LiHfURhkkMH8n7LZs/5KO7q/VacOIfik="
        }
    ],
    "ChecksumAlgorithm": "SHA256",
    "Initiator": {
        "ID": "arn:aws:iam::396070361885:user/sungjoon_koh",
        "DisplayName": "sungjoon_koh"
    },
    "Owner": {
        "ID": "263c74a141d813b697d62541fed8f754ef7b1803093e12f81d384ce0fac8f474"
    },
    "StorageClass": "STANDARD",
    "ChecksumType": "COMPOSITE"
}
  • before patch
{
    "Parts": [
        {
            "PartNumber": 1,
            "LastModified": "2025-12-03T04:00:12+00:00",
            "ETag": "\"5f363e0e58a95f06cbe9bbc662c5dfb6\"",
            "Size": 5242880,
            "ChecksumCRC64NVME": "vqf3hRLTlJw="
        },
        {
            "PartNumber": 2,
            "LastModified": "2025-12-03T04:00:13+00:00",
            "ETag": "\"5f363e0e58a95f06cbe9bbc662c5dfb6\"",
            "Size": 5242880,
            "ChecksumCRC64NVME": "vqf3hRLTlJw="
        }
    ],
    "ChecksumAlgorithm": null,
    "Initiator": null,
    "Owner": {
        "DisplayName": "M. Tester",
        "ID": "testid"
    },
    "StorageClass": "STANDARD",
    "ChecksumType": null
}
{
    "Parts": [
        {
            "PartNumber": 1,
            "LastModified": "2025-12-03T04:00:16+00:00",
            "ETag": "\"5f363e0e58a95f06cbe9bbc662c5dfb6\"",
            "Size": 5242880,
            "ChecksumCRC32": "yTuzdQ=="
        },
        {
            "PartNumber": 2,
            "LastModified": "2025-12-03T04:00:17+00:00",
            "ETag": "\"5f363e0e58a95f06cbe9bbc662c5dfb6\"",
            "Size": 5242880,
            "ChecksumCRC32": "yTuzdQ=="
        }
    ],
    "ChecksumAlgorithm": null,
    "Initiator": null,
    "Owner": {
        "DisplayName": "M. Tester",
        "ID": "testid"
    },
    "StorageClass": "STANDARD",
    "ChecksumType": null
}
{
    "Parts": [
        {
            "PartNumber": 1,
            "LastModified": "2025-12-03T04:00:20+00:00",
            "ETag": "\"5f363e0e58a95f06cbe9bbc662c5dfb6\"",
            "Size": 5242880,
            "ChecksumCRC32C": "zqsFQg=="
        },
        {
            "PartNumber": 2,
            "LastModified": "2025-12-03T04:00:21+00:00",
            "ETag": "\"5f363e0e58a95f06cbe9bbc662c5dfb6\"",
            "Size": 5242880,
            "ChecksumCRC32C": "zqsFQg=="
        }
    ],
    "ChecksumAlgorithm": null,
    "Initiator": null,
    "Owner": {
        "DisplayName": "M. Tester",
        "ID": "testid"
    },
    "StorageClass": "STANDARD",
    "ChecksumType": null
}
{
    "Parts": [
        {
            "PartNumber": 1,
            "LastModified": "2025-12-03T04:00:23+00:00",
            "ETag": "\"5f363e0e58a95f06cbe9bbc662c5dfb6\"",
            "Size": 5242880,
            "ChecksumSHA1": "LpXXWCxTWD+or7VOD+eiWXySy7o="
        },
        {
            "PartNumber": 2,
            "LastModified": "2025-12-03T04:00:24+00:00",
            "ETag": "\"5f363e0e58a95f06cbe9bbc662c5dfb6\"",
            "Size": 5242880,
            "ChecksumSHA1": "LpXXWCxTWD+or7VOD+eiWXySy7o="
        }
    ],
    "ChecksumAlgorithm": null,
    "Initiator": null,
    "Owner": {
        "DisplayName": "M. Tester",
        "ID": "testid"
    },
    "StorageClass": "STANDARD",
    "ChecksumType": null
}
{
    "Parts": [
        {
            "PartNumber": 1,
            "LastModified": "2025-12-03T04:00:27+00:00",
            "ETag": "\"5f363e0e58a95f06cbe9bbc662c5dfb6\"",
            "Size": 5242880,
            "ChecksumSHA256": "wDbLt1U6kJ+LiHfURhkkMH8n7LZs/5KO7q/VacOIfik="
        },
        {
            "PartNumber": 2,
            "LastModified": "2025-12-03T04:00:29+00:00",
            "ETag": "\"5f363e0e58a95f06cbe9bbc662c5dfb6\"",
            "Size": 5242880,
            "ChecksumSHA256": "wDbLt1U6kJ+LiHfURhkkMH8n7LZs/5KO7q/VacOIfik="
        }
    ],
    "ChecksumAlgorithm": null,
    "Initiator": null,
    "Owner": {
        "DisplayName": "M. Tester",
        "ID": "testid"
    },
    "StorageClass": "STANDARD",
    "ChecksumType": null
}
  • after patch
{
    "Parts": [
        {
            "PartNumber": 1,
            "LastModified": "2025-12-03T04:37:24+00:00",
            "ETag": "\"5f363e0e58a95f06cbe9bbc662c5dfb6\"",
            "Size": 5242880,
            "ChecksumCRC64NVME": "vqf3hRLTlJw="
        },
        {
            "PartNumber": 2,
            "LastModified": "2025-12-03T04:37:26+00:00",
            "ETag": "\"5f363e0e58a95f06cbe9bbc662c5dfb6\"",
            "Size": 5242880,
            "ChecksumCRC64NVME": "vqf3hRLTlJw="
        }
    ],
    "ChecksumAlgorithm": "CRC64NVME",
    "Initiator": null,
    "Owner": {
        "DisplayName": "M. Tester",
        "ID": "testid"
    },
    "StorageClass": "STANDARD",
    "ChecksumType": "FULL_OBJECT"
}
{
    "Parts": [
        {
            "PartNumber": 1,
            "LastModified": "2025-12-03T04:37:29+00:00",
            "ETag": "\"5f363e0e58a95f06cbe9bbc662c5dfb6\"",
            "Size": 5242880,
            "ChecksumCRC32": "yTuzdQ=="
        },
        {
            "PartNumber": 2,
            "LastModified": "2025-12-03T04:37:30+00:00",
            "ETag": "\"5f363e0e58a95f06cbe9bbc662c5dfb6\"",
            "Size": 5242880,
            "ChecksumCRC32": "yTuzdQ=="
        }
    ],
    "ChecksumAlgorithm": "CRC32",
    "Initiator": null,
    "Owner": {
        "DisplayName": "M. Tester",
        "ID": "testid"
    },
    "StorageClass": "STANDARD",
    "ChecksumType": "FULL_OBJECT"
}
{
    "Parts": [
        {
            "PartNumber": 1,
            "LastModified": "2025-12-03T04:37:32+00:00",
            "ETag": "\"5f363e0e58a95f06cbe9bbc662c5dfb6\"",
            "Size": 5242880,
            "ChecksumCRC32C": "zqsFQg=="
        },
        {
            "PartNumber": 2,
            "LastModified": "2025-12-03T04:37:33+00:00",
            "ETag": "\"5f363e0e58a95f06cbe9bbc662c5dfb6\"",
            "Size": 5242880,
            "ChecksumCRC32C": "zqsFQg=="
        }
    ],
    "ChecksumAlgorithm": "CRC32C",
    "Initiator": null,
    "Owner": {
        "DisplayName": "M. Tester",
        "ID": "testid"
    },
    "StorageClass": "STANDARD",
    "ChecksumType": "FULL_OBJECT"
}
{
    "Parts": [
        {
            "PartNumber": 1,
            "LastModified": "2025-12-03T04:37:36+00:00",
            "ETag": "\"5f363e0e58a95f06cbe9bbc662c5dfb6\"",
            "Size": 5242880,
            "ChecksumSHA1": "LpXXWCxTWD+or7VOD+eiWXySy7o="
        },
        {
            "PartNumber": 2,
            "LastModified": "2025-12-03T04:37:37+00:00",
            "ETag": "\"5f363e0e58a95f06cbe9bbc662c5dfb6\"",
            "Size": 5242880,
            "ChecksumSHA1": "LpXXWCxTWD+or7VOD+eiWXySy7o="
        }
    ],
    "ChecksumAlgorithm": "SHA1",
    "Initiator": null,
    "Owner": {
        "DisplayName": "M. Tester",
        "ID": "testid"
    },
    "StorageClass": "STANDARD",
    "ChecksumType": "COMPOSITE"
}
{
    "Parts": [
        {
            "PartNumber": 1,
            "LastModified": "2025-12-03T04:37:40+00:00",
            "ETag": "\"5f363e0e58a95f06cbe9bbc662c5dfb6\"",
            "Size": 5242880,
            "ChecksumSHA256": "wDbLt1U6kJ+LiHfURhkkMH8n7LZs/5KO7q/VacOIfik="
        },
        {
            "PartNumber": 2,
            "LastModified": "2025-12-03T04:37:41+00:00",
            "ETag": "\"5f363e0e58a95f06cbe9bbc662c5dfb6\"",
            "Size": 5242880,
            "ChecksumSHA256": "wDbLt1U6kJ+LiHfURhkkMH8n7LZs/5KO7q/VacOIfik="
        }
    ],
    "ChecksumAlgorithm": "SHA256",
    "Initiator": null,
    "Owner": {
        "DisplayName": "M. Tester",
        "ID": "testid"
    },
    "StorageClass": "STANDARD",
    "ChecksumType": "COMPOSITE"
}
  1. CreateMultipartUpload API
  • test script
BUCKET=cksum-test-20251203
KEY=testobj

fallocate part --len 5M
aws s3api create-bucket --bucket $BUCKET

for CHECKSUM_ALGO in crc64nvme crc32 crc32c sha1 sha256
do
        aws s3api create-multipart-upload --bucket "$BUCKET" --key "$KEY" --checksum-algorithm "$CHECKSUM_ALGO"
done
  • aws result
{
    "ServerSideEncryption": "AES256",
    "ChecksumAlgorithm": "CRC64NVME",
    "ChecksumType": "FULL_OBJECT",
    "Bucket": "sj-lctest",
    "Key": "testobj",
    "UploadId": ".73aX_IF9q7yn.CvMcjTRbiY5xg4EyQyCWLRSi1qvg9uKA4uGnUTmbg52JXNBn6N2ra_s.ut0ylHcCcGx2LPU2JGGoIyiWDORmOQqgOcTium71AXERuGTxo0racrAZD5"
}
{
    "ServerSideEncryption": "AES256",
    "ChecksumAlgorithm": "CRC32",
    "ChecksumType": "COMPOSITE",
    "Bucket": "sj-lctest",
    "Key": "testobj",
    "UploadId": "LpXeFeGxj6iP_CUMYd.NwLXKEqjFYDLVAMOp5CW.X6wZjIhe91lJnxNq84D9vb9naokqXtSbaHqMBUyy2iW6A6KGAACzrPItBsQKdjWMv.fiMujMl23xs3xNlqkOqYBp"
}
{
    "ServerSideEncryption": "AES256",
    "ChecksumAlgorithm": "CRC32C",
    "ChecksumType": "COMPOSITE",
    "Bucket": "sj-lctest",
    "Key": "testobj",
    "UploadId": "wa3e6v3ct1XibpjA7UpN9Xn_aakOiDt.kRmMTUByVyqBdQU9RiadFthqdV2bavLAMxj1SJINIdXnHefx1IFWnYwQo223l0QiubTtKZp8GvV.dcPFVC.1n8U_CkWsBI5q"
}
{
    "ServerSideEncryption": "AES256",
    "ChecksumAlgorithm": "SHA1",
    "ChecksumType": "COMPOSITE",
    "Bucket": "sj-lctest",
    "Key": "testobj",
    "UploadId": "txNlOJ7pUk_Nf1q09VJW8mducG45ZABt54Z4M4hNGb9MLhJ0NqvTDh3OhQl6KkdwZv_SVAAiFp8OB2shywFffUcWSUFL8Rbf1rwhm0K_qbp12LOXMpc2Yvq59guskHfc"
}
{
    "ServerSideEncryption": "AES256",
    "ChecksumAlgorithm": "SHA256",
    "ChecksumType": "COMPOSITE",
    "Bucket": "sj-lctest",
    "Key": "testobj",
    "UploadId": "eCb2OppD3VH3ZfWZ9QHpXQMguc9VJRVBjq59czwqJUyla_3gQswsah7o0XU_AFkjjBpnuGO6ud0xedD5na3NAgxEWXOh4Cb6TC4x5R7qL7W0bPZRWitzJFEvkXeixuyl"
}
  • before patch
{
    "ChecksumAlgorithm": "CRC64NVME",
    "Bucket": "cksum-test-20251203",
    "Key": "testobj",
    "UploadId": "2~TT3GqOElS3aERsisdw_54Skd9fm7OZ0"
}
{
    "ChecksumAlgorithm": "CRC32",
    "Bucket": "cksum-test-20251203",
    "Key": "testobj",
    "UploadId": "2~fBcIeug0jAfE89ac4ooclB8l1bX1Lb6"
}
{
    "ChecksumAlgorithm": "CRC32C",
    "Bucket": "cksum-test-20251203",
    "Key": "testobj",
    "UploadId": "2~docBCuJYO2yYDxXWPzsC0BMzEaOkabf"
}
{
    "ChecksumAlgorithm": "SHA1",
    "Bucket": "cksum-test-20251203",
    "Key": "testobj",
    "UploadId": "2~0BOv5uUvDA2ZGVjaRkAY24rKQJrLJ2b"
}
{
    "ChecksumAlgorithm": "SHA256",
    "Bucket": "cksum-test-20251203",
    "Key": "testobj",
    "UploadId": "2~UKkuV1AQ4ZallT480aVzE1eW0meH7Qu"
}
  • after patch
{
    "ChecksumAlgorithm": "CRC64NVME",
    "ChecksumType": "FULL_OBJECT",
    "Bucket": "cksum-test-20251203",
    "Key": "testobj",
    "UploadId": "2~-7WJR8wIc406JfsMpYpqEDd-IQAtKIZ"
}
{
    "ChecksumAlgorithm": "CRC32",
    "ChecksumType": "FULL_OBJECT",
    "Bucket": "cksum-test-20251203",
    "Key": "testobj",
    "UploadId": "2~hVLyQxX-xDJikkNKAaB8vsfaXnrHanA"
}
{
    "ChecksumAlgorithm": "CRC32C",
    "ChecksumType": "FULL_OBJECT",
    "Bucket": "cksum-test-20251203",
    "Key": "testobj",
    "UploadId": "2~S9w7BY-zHzb6VyvKcctSndx_-StmOkE"
}
{
    "ChecksumAlgorithm": "SHA1",
    "ChecksumType": "COMPOSITE",
    "Bucket": "cksum-test-20251203",
    "Key": "testobj",
    "UploadId": "2~lD2rYZOWK6TyGqMdBgIScCUfy4mc0Jy"
}
{
    "ChecksumAlgorithm": "SHA256",
    "ChecksumType": "COMPOSITE",
    "Bucket": "cksum-test-20251203",
    "Key": "testobj",
    "UploadId": "2~OOflc5vLSydCC09Dz4hkp8KdOy04WKc"
}
  1. ListObjects
  • test script
#!/bin/bash

bucket="cksum-listobject-20251203"
keyprefix="test-cksum"

aws s3api create-bucket --bucket=$bucket > /dev/null

for algo in CRC64NVME CRC32 CRC32C SHA1 SHA256
do
        key=$keyprefix-$algo
        UI=$(aws s3api create-multipart-upload --bucket $bucket --key $key --checksum-algorithm $algo | jq -r '.UploadId')

        part1_output=$(aws s3api upload-part --bucket=$bucket --key=$key --part-number 1 --body part1.file --upload-id $UI --checksum-algorithm $algo)
        part2_output=$(aws s3api upload-part --bucket=$bucket --key=$key --part-number 2 --body part2.file --upload-id $UI --checksum-algorithm $algo)

        checksum_key="Checksum$algo"
        jq -n \
          --argjson p1 "$part1_output" \
          --argjson p2 "$part2_output" \
          --arg csk "$checksum_key" \
          '{
            "Parts": [
              {
                "ETag": $p1.ETag,
                ($csk): $p1[$csk],
                "PartNumber": 1
              },
              {
                "ETag": $p2.ETag,
                ($csk): $p2[$csk],
                "PartNumber": 2
              }
            ]
          }' > parts.json
        aws s3api complete-multipart-upload --bucket=$bucket --key=$key --upload-id $UI --multipart-upload file://parts.json > /dev/null
done

aws s3api list-objects --bucket=$bucket
  • aws result
{
    "Contents": [
        {
            "Key": "test-cksum-CRC32",
            "LastModified": "2025-12-03T05:15:03+00:00",
            "ETag": "\"a7d414b9133d6483d9a1c4e04e856e3b-2\"",
            "ChecksumAlgorithm": [
                "CRC32"
            ],
            "ChecksumType": "COMPOSITE",
            "Size": 10485760,
            "StorageClass": "STANDARD",
            "Owner": {
                "ID": "263c74a141d813b697d62541fed8f754ef7b1803093e12f81d384ce0fac8f474"
            }
        },
        {
            "Key": "test-cksum-CRC32C",
            "LastModified": "2025-12-03T05:15:16+00:00",
            "ETag": "\"a7d414b9133d6483d9a1c4e04e856e3b-2\"",
            "ChecksumAlgorithm": [
                "CRC32C"
            ],
            "ChecksumType": "COMPOSITE",
            "Size": 10485760,
            "StorageClass": "STANDARD",
            "Owner": {
                "ID": "263c74a141d813b697d62541fed8f754ef7b1803093e12f81d384ce0fac8f474"
            }
        },
        {
            "Key": "test-cksum-CRC64NVME",
            "LastModified": "2025-12-03T05:14:49+00:00",
            "ETag": "\"a7d414b9133d6483d9a1c4e04e856e3b-2\"",
            "ChecksumAlgorithm": [
                "CRC64NVME"
            ],
            "ChecksumType": "FULL_OBJECT",
            "Size": 10485760,
            "StorageClass": "STANDARD",
            "Owner": {
                "ID": "263c74a141d813b697d62541fed8f754ef7b1803093e12f81d384ce0fac8f474"
            }
        },
        {
            "Key": "test-cksum-SHA1",
            "LastModified": "2025-12-03T05:15:26+00:00",
            "ETag": "\"a7d414b9133d6483d9a1c4e04e856e3b-2\"",
            "ChecksumAlgorithm": [
                "SHA1"
            ],
            "ChecksumType": "COMPOSITE",
            "Size": 10485760,
            "StorageClass": "STANDARD",
            "Owner": {
                "ID": "263c74a141d813b697d62541fed8f754ef7b1803093e12f81d384ce0fac8f474"
            }
        },
        {
            "Key": "test-cksum-SHA256",
            "LastModified": "2025-12-03T05:15:35+00:00",
            "ETag": "\"a7d414b9133d6483d9a1c4e04e856e3b-2\"",
            "ChecksumAlgorithm": [
                "SHA256"
            ],
            "ChecksumType": "COMPOSITE",
            "Size": 10485760,
            "StorageClass": "STANDARD",
            "Owner": {
                "ID": "263c74a141d813b697d62541fed8f754ef7b1803093e12f81d384ce0fac8f474"
            }
        }
    ],
    "RequestCharged": null,
    "Prefix": ""
}
  • before patch
{
    "Contents": [
        {
            "Key": "test-cksum-CRC32",
            "LastModified": "2025-12-03T05:21:55+00:00",
            "ETag": "\"a7d414b9133d6483d9a1c4e04e856e3b-2\"",
            "Size": 10485760,
            "StorageClass": "STANDARD",
            "Owner": {
                "DisplayName": "M. Tester",
                "ID": "testid"
            }
        },
        {
            "Key": "test-cksum-CRC32C",
            "LastModified": "2025-12-03T05:21:59+00:00",
            "ETag": "\"a7d414b9133d6483d9a1c4e04e856e3b-2\"",
            "Size": 10485760,
            "StorageClass": "STANDARD",
            "Owner": {
                "DisplayName": "M. Tester",
                "ID": "testid"
            }
        },
        {
            "Key": "test-cksum-CRC64NVME",
            "LastModified": "2025-12-03T05:21:51+00:00",
            "ETag": "\"a7d414b9133d6483d9a1c4e04e856e3b-2\"",
            "Size": 10485760,
            "StorageClass": "STANDARD",
            "Owner": {
                "DisplayName": "M. Tester",
                "ID": "testid"
            }
        },
        {
            "Key": "test-cksum-SHA1",
            "LastModified": "2025-12-03T05:22:03+00:00",
            "ETag": "\"a7d414b9133d6483d9a1c4e04e856e3b-2\"",
            "Size": 10485760,
            "StorageClass": "STANDARD",
            "Owner": {
                "DisplayName": "M. Tester",
                "ID": "testid"
            }
        },
        {
            "Key": "test-cksum-SHA256",
            "LastModified": "2025-12-03T05:22:07+00:00",
            "ETag": "\"a7d414b9133d6483d9a1c4e04e856e3b-2\"",
            "Size": 10485760,
            "StorageClass": "STANDARD",
            "Owner": {
                "DisplayName": "M. Tester",
                "ID": "testid"
            }
        }
    ],
    "RequestCharged": null,
    "Prefix": ""
}
  • after patch
{
    "Contents": [
        {
            "Key": "test-cksum-CRC32",
            "LastModified": "2025-12-03T08:05:56+00:00",
            "ETag": "\"a7d414b9133d6483d9a1c4e04e856e3b-2\"",
            "ChecksumAlgorithm": [
                "CRC32"
            ],
            "ChecksumType": "FULL_OBJECT",
            "Size": 10485760,
            "StorageClass": "STANDARD",
            "Owner": {
                "DisplayName": "M. Tester",
                "ID": "testid"
            }
        },
        {
            "Key": "test-cksum-CRC32C",
            "LastModified": "2025-12-03T08:06:00+00:00",
            "ETag": "\"a7d414b9133d6483d9a1c4e04e856e3b-2\"",
            "ChecksumAlgorithm": [
                "CRC32C"
            ],
            "ChecksumType": "FULL_OBJECT",
            "Size": 10485760,
            "StorageClass": "STANDARD",
            "Owner": {
                "DisplayName": "M. Tester",
                "ID": "testid"
            }
        },
        {
            "Key": "test-cksum-CRC64NVME",
            "LastModified": "2025-12-03T08:05:52+00:00",
            "ETag": "\"a7d414b9133d6483d9a1c4e04e856e3b-2\"",
            "ChecksumAlgorithm": [
                "CRC64NVME"
            ],
            "ChecksumType": "FULL_OBJECT",
            "Size": 10485760,
            "StorageClass": "STANDARD",
            "Owner": {
                "DisplayName": "M. Tester",
                "ID": "testid"
            }
        },
        {
            "Key": "test-cksum-SHA1",
            "LastModified": "2025-12-03T08:06:04+00:00",
            "ETag": "\"a7d414b9133d6483d9a1c4e04e856e3b-2\"",
            "ChecksumAlgorithm": [
                "SHA1"
            ],
            "ChecksumType": "COMPOSITE",
            "Size": 10485760,
            "StorageClass": "STANDARD",
            "Owner": {
                "DisplayName": "M. Tester",
                "ID": "testid"
            }
        },
        {
            "Key": "test-cksum-SHA256",
            "LastModified": "2025-12-03T08:06:08+00:00",
            "ETag": "\"a7d414b9133d6483d9a1c4e04e856e3b-2\"",
            "ChecksumAlgorithm": [
                "SHA256"
            ],
            "ChecksumType": "COMPOSITE",
            "Size": 10485760,
            "StorageClass": "STANDARD",
            "Owner": {
                "DisplayName": "M. Tester",
                "ID": "testid"
            }
        }
    ],
    "RequestCharged": null,
    "Prefix": ""
}

@sungjoon-koh

sungjoon-koh commented Dec 3, 2025 •

Copy link
Copy Markdown
Contributor Author

Reshard test

$  ./bin/radosgw-admin bucket reshard --bucket sj-listobjectstest --num-shards 503
2025-12-03T17:44:58.572+0900 7fddf0a1da80 -1 WARNING: all dangerous and experimental features are enabled.
2025-12-03T17:44:58.579+0900 7fddf0a1da80 -1 WARNING: all dangerous and experimental features are enabled.
2025-12-03T17:44:58.580+0900 7fddf0a1da80 -1 WARNING: all dangerous and experimental features are enabled.
tenant:
bucket name: sj-listobjectstest
start time: 2025-12-03T17:44:58.715623+0900
inventory_entries: 5
end time: 2025-12-03T17:44:58.721241+0900
start time: 2025-12-03T17:44:58.728892+0900
inc_entries: 0
end time: 2025-12-03T17:44:58.732850+0900
2025-12-03T17:44:58.737+0900 7fddf0a1da80  1 execute INFO: reshard of bucket "sj-listobjectstest" from 11 shards to 503 shards completed successfully
$ aws s3api list-objects --bucket=sj-listobjectstest
{
    "Contents": [
        {
            "Key": "test-cksum-CRC32",
            "LastModified": "2025-12-03T08:05:56+00:00",
            "ETag": "\"a7d414b9133d6483d9a1c4e04e856e3b-2\"",
            "ChecksumAlgorithm": [
                "CRC32"
            ],
            "ChecksumType": "FULL_OBJECT",
            "Size": 10485760,
            "StorageClass": "STANDARD",
            "Owner": {
                "DisplayName": "M. Tester",
                "ID": "testid"
            }
        },
        {
            "Key": "test-cksum-CRC32C",
            "LastModified": "2025-12-03T08:06:00+00:00",
            "ETag": "\"a7d414b9133d6483d9a1c4e04e856e3b-2\"",
            "ChecksumAlgorithm": [
                "CRC32C"
            ],
            "ChecksumType": "FULL_OBJECT",
            "Size": 10485760,
            "StorageClass": "STANDARD",
            "Owner": {
                "DisplayName": "M. Tester",
                "ID": "testid"
            }
        },
        {
            "Key": "test-cksum-CRC64NVME",
            "LastModified": "2025-12-03T08:05:52+00:00",
            "ETag": "\"a7d414b9133d6483d9a1c4e04e856e3b-2\"",
            "ChecksumAlgorithm": [
                "CRC64NVME"
            ],
            "ChecksumType": "FULL_OBJECT",
            "Size": 10485760,
            "StorageClass": "STANDARD",
            "Owner": {
                "DisplayName": "M. Tester",
                "ID": "testid"
            }
        },
        {
            "Key": "test-cksum-SHA1",
            "LastModified": "2025-12-03T08:06:04+00:00",
            "ETag": "\"a7d414b9133d6483d9a1c4e04e856e3b-2\"",
            "ChecksumAlgorithm": [
                "SHA1"
            ],
            "ChecksumType": "COMPOSITE",
            "Size": 10485760,
            "StorageClass": "STANDARD",
            "Owner": {
                "DisplayName": "M. Tester",
                "ID": "testid"
            }
        },
        {
            "Key": "test-cksum-SHA256",
            "LastModified": "2025-12-03T08:06:08+00:00",
            "ETag": "\"a7d414b9133d6483d9a1c4e04e856e3b-2\"",
            "ChecksumAlgorithm": [
                "SHA256"
            ],
            "ChecksumType": "COMPOSITE",
            "Size": 10485760,
            "StorageClass": "STANDARD",
            "Owner": {
                "DisplayName": "M. Tester",
                "ID": "testid"
            }
        }
    ],
    "RequestCharged": null,
    "Prefix": ""
}

@sungjoon-koh

sungjoon-koh commented Dec 4, 2025 •

Copy link
Copy Markdown
Contributor Author

Additional patch for ListObjectsV2

  • AWS S3 result
{
    "Contents": [
        {
            "Key": "test-cksum-CRC32",
            "LastModified": "2025-12-03T05:15:03+00:00",
            "ETag": "\"a7d414b9133d6483d9a1c4e04e856e3b-2\"",
            "ChecksumAlgorithm": [
                "CRC32"
            ],
            "ChecksumType": "COMPOSITE",
            "Size": 10485760,
            "StorageClass": "STANDARD"
        },
        {
            "Key": "test-cksum-CRC32C",
            "LastModified": "2025-12-03T05:15:16+00:00",
            "ETag": "\"a7d414b9133d6483d9a1c4e04e856e3b-2\"",
            "ChecksumAlgorithm": [
                "CRC32C"
            ],
            "ChecksumType": "COMPOSITE",
            "Size": 10485760,
            "StorageClass": "STANDARD"
        },
        {
            "Key": "test-cksum-CRC64NVME",
            "LastModified": "2025-12-03T05:14:49+00:00",
            "ETag": "\"a7d414b9133d6483d9a1c4e04e856e3b-2\"",
            "ChecksumAlgorithm": [
                "CRC64NVME"
            ],
            "ChecksumType": "FULL_OBJECT",
            "Size": 10485760,
            "StorageClass": "STANDARD"
        },
        {
            "Key": "test-cksum-SHA1",
            "LastModified": "2025-12-03T05:15:26+00:00",
            "ETag": "\"a7d414b9133d6483d9a1c4e04e856e3b-2\"",
            "ChecksumAlgorithm": [
                "SHA1"
            ],
            "ChecksumType": "COMPOSITE",
            "Size": 10485760,
            "StorageClass": "STANDARD"
        },
        {
            "Key": "test-cksum-SHA256",
            "LastModified": "2025-12-03T05:15:35+00:00",
            "ETag": "\"a7d414b9133d6483d9a1c4e04e856e3b-2\"",
            "ChecksumAlgorithm": [
                "SHA256"
            ],
            "ChecksumType": "COMPOSITE",
            "Size": 10485760,
            "StorageClass": "STANDARD"
        }
    ],
    "RequestCharged": null,
    "Prefix": ""
}
  • Before patch
{
    "Contents": [
        {
            "Key": "test-cksum-CRC32",
            "LastModified": "2025-12-04T14:46:38+00:00",
            "ETag": "\"a7d414b9133d6483d9a1c4e04e856e3b-2\"",
            "Size": 10485760,
            "StorageClass": "STANDARD"
        },
        {
            "Key": "test-cksum-CRC32C",
            "LastModified": "2025-12-04T14:46:41+00:00",
            "ETag": "\"a7d414b9133d6483d9a1c4e04e856e3b-2\"",
            "Size": 10485760,
            "StorageClass": "STANDARD"
        },
        {
            "Key": "test-cksum-CRC64NVME",
            "LastModified": "2025-12-04T14:46:34+00:00",
            "ETag": "\"a7d414b9133d6483d9a1c4e04e856e3b-2\"",
            "Size": 10485760,
            "StorageClass": "STANDARD"
        },
        {
            "Key": "test-cksum-SHA1",
            "LastModified": "2025-12-04T14:46:45+00:00",
            "ETag": "\"a7d414b9133d6483d9a1c4e04e856e3b-2\"",
            "Size": 10485760,
            "StorageClass": "STANDARD"
        },
        {
            "Key": "test-cksum-SHA256",
            "LastModified": "2025-12-04T14:46:49+00:00",
            "ETag": "\"a7d414b9133d6483d9a1c4e04e856e3b-2\"",
            "Size": 10485760,
            "StorageClass": "STANDARD"
        }
    ],
    "RequestCharged": null,
    "Prefix": ""
}
  • After Patch
{
    "Contents": [
        {
            "Key": "test-cksum-CRC32",
            "LastModified": "2025-12-04T14:46:38+00:00",
            "ETag": "\"a7d414b9133d6483d9a1c4e04e856e3b-2\"",
            "ChecksumAlgorithm": [
                "CRC32"
            ],
            "ChecksumType": "FULL_OBJECT",
            "Size": 10485760,
            "StorageClass": "STANDARD"
        },
        {
            "Key": "test-cksum-CRC32C",
            "LastModified": "2025-12-04T14:46:41+00:00",
            "ETag": "\"a7d414b9133d6483d9a1c4e04e856e3b-2\"",
            "ChecksumAlgorithm": [
                "CRC32C"
            ],
            "ChecksumType": "FULL_OBJECT",
            "Size": 10485760,
            "StorageClass": "STANDARD"
        },
        {
            "Key": "test-cksum-CRC64NVME",
            "LastModified": "2025-12-04T14:46:34+00:00",
            "ETag": "\"a7d414b9133d6483d9a1c4e04e856e3b-2\"",
            "ChecksumAlgorithm": [
                "CRC64NVME"
            ],
            "ChecksumType": "FULL_OBJECT",
            "Size": 10485760,
            "StorageClass": "STANDARD"
        },
        {
            "Key": "test-cksum-SHA1",
            "LastModified": "2025-12-04T14:46:45+00:00",
            "ETag": "\"a7d414b9133d6483d9a1c4e04e856e3b-2\"",
            "ChecksumAlgorithm": [
                "SHA1"
            ],
            "ChecksumType": "COMPOSITE",
            "Size": 10485760,
            "StorageClass": "STANDARD"
        },
        {
            "Key": "test-cksum-SHA256",
            "LastModified": "2025-12-04T14:46:49+00:00",
            "ETag": "\"a7d414b9133d6483d9a1c4e04e856e3b-2\"",
            "ChecksumAlgorithm": [
                "SHA256"
            ],
            "ChecksumType": "COMPOSITE",
            "Size": 10485760,
            "StorageClass": "STANDARD"
        }
    ],
    "RequestCharged": null,
    "Prefix": ""
}

@sungjoon-koh

Copy link
Copy Markdown
Contributor Author

Add s3-tests for this PR
ceph/s3-tests#712

@mattbenjamin mattbenjamin left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

am I correct that this is putting string names for checksum algorithms, plus "FULL_OBJECT" or "COMPOSITE" as strings into bucket index entries?

could we maybe use the well-known (to RGW source code) ordinals for the algorithms to reduce size (to 2 bytes I think) and some shorthand equivalent for full vs composite (since its information load is 1bit)?

@adamemerson adamemerson added the needs-separate-s3tests-qa This is a PR to RGW that, at present, needs to be QA'd against is own s3tests branch before merge. label Dec 4, 2025
@sungjoon-koh

Copy link
Copy Markdown
Contributor Author

@mattbenjamin Thank you for the review. I’ll fix it as you suggested.

@sungjoon-koh
sungjoon-koh force-pushed the wip-s3-checksum-headers branch 2 times, most recently from dbf6a17 to f4a2ba1 Compare December 5, 2025 21:47
@sungjoon-koh

Copy link
Copy Markdown
Contributor Author

jenkins test make check

@sungjoon-koh

Copy link
Copy Markdown
Contributor Author

jenkins test make check arm64

@sungjoon-koh

Copy link
Copy Markdown
Contributor Author

jenkins test make check

@sungjoon-koh

Copy link
Copy Markdown
Contributor Author

jenkins test make check arm64

@sungjoon-koh
sungjoon-koh force-pushed the wip-s3-checksum-headers branch from f4a2ba1 to 2c9a589 Compare December 25, 2025 15:59

@mattbenjamin mattbenjamin left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good to me

@sungjoon-koh

Copy link
Copy Markdown
Contributor Author

@mattbenjamin Thank you for the review!
I fixed json decode and dump code, since ceph-dencoder test (src/test/encoding/check-generated.sh) failed.

Comment thread src/rgw/rgw_cksum.h
Comment on lines +115 to +116
static constexpr uint16_t CKSUM_TYPE_MASK =
(FLAG_COMPOSITE|FLAG_FULL_OBJECT);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you say more about why we need this CKSUM_TYPE_MASK?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@cbodley I was thinking it might be better to introduce CKSUM_TYPE_MASK as (FLAG_COMPOSITE | FLAG_FULL_OBJECT), so that we can check only those two flags without being affected by FLAG_COMBINED. I think this could help clarify the logic, but please let me know if you see a better way.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it's just not clear why we need to mask other bits out of what we store in rgw_bucket_dir_entry_meta::cksum_flags. if we're storing cksum_flags in the index, i think we should store all of the flags, not just a subset

won't these checks in rgw_rest_s3.cc work fine without masking?

if (iter->meta.cksum_flags & rgw::cksum::Cksum::FLAG_COMPOSITE) {

Comment thread src/cls/rgw/cls_rgw_types.h Resolved
@sungjoon-koh
sungjoon-koh force-pushed the wip-s3-checksum-headers branch from bf42419 to 989b80f Compare January 24, 2026 11:48
@sungjoon-koh

Copy link
Copy Markdown
Contributor Author

jenkins test api

@sungjoon-koh

Copy link
Copy Markdown
Contributor Author

@cbodley Could you please check it when you have a time?

@github-actions

Copy link
Copy Markdown

This pull request can no longer be automatically merged: a rebase is needed and changes have to be manually resolved

@github-actions

Copy link
Copy Markdown

This pull request has been automatically marked as stale because it has not had any activity for 60 days. It will be closed if no further activity occurs for another 30 days.
If you are a maintainer or core committer, please follow-up on this pull request to identify what steps should be taken by the author to move this proposed change forward.
If you are the author of this pull request, thank you for your proposed contribution. If you believe this change is still appropriate, please ensure that any feedback has been addressed and ask for a code review.

@github-actions github-actions Bot added the stale label Jul 17, 2026
@github-actions

Copy link
Copy Markdown

This pull request has been automatically closed because there has been no activity for 90 days. Please feel free to reopen this pull request (or open a new one) if the proposed change is still appropriate. Thank you for your contribution!

@github-actions github-actions Bot closed this Aug 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs-rebase needs-separate-s3tests-qa This is a PR to RGW that, at present, needs to be QA'd against is own s3tests branch before merge. rgw stale

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants