The Comprehensive Ceph Guide
فارسیGet started

RGW PUT and multipart

In the book: Chapter 4

Lab

RGW PUT and multipart

Give a key and a size and follow an S3 PUT through radosgw to the bucket index and the data pool, with the RADOS objects it creates.

3RADOS objects
.dir.MARKER.5bucket index shard
10 MiBobject size
ceph_str_hash_linux("photos/2026/11/img_0001.jpg") = 2668161921 → sid ^ ((sid & 0xff) << 24) → % 7877 % 11 = 5
clientradosgwauthindex pooldata pool1. PUT2. authenticate3. tail stripes4. index prepare5. head write6. index complete7. 200 OK
  1. PUT The client sends PUT /bucket/photos/2026/11/img_0001.jpg with 10 MiB of data; RGWPutObj::execute starts. RGWPutObj::execute (rgw_op.cc)
  2. authenticate The AWS signature is checked (v4 here) and the user's permissions on the bucket are evaluated. rgw::auth::s3::AWSAuthStrategy, AWSv4ComplSingle (rgw_auth_s3.cc)
  3. tail stripes As the body streams in, the processor writes 2 tail object(s) of 4 MiB to the data pool. AtomicObjectProcessor::process, RadosWriter::process
  4. index prepare rgw_bucket_prepare_op marks a pending entry for photos/2026/11/img_0001.jpg on shard 5 of 11, so a crash now leaves a trace that can be cleaned up. RGWRados::Bucket::UpdateIndex::prepare, cls_rgw rgw_bucket_prepare_op
  5. head write The head object is written in one write_full with the first 4 MiB, the manifest and the attributes (ETag, ACL, content type). RGWRados::Object::Write::_do_write_meta (write_full + xattrs)
  6. index complete rgw_bucket_complete_op turns the pending entry into a listed object on shard 5 and appends to the bucket index log for sync. UpdateIndex::complete, rgw_bucket_complete_op (+ bilog)
  7. 200 OK radosgw answers 200 with the ETag; the object is now visible in listings. RGWPutObj_ObjStore_S3::send_response (rgw_rest_s3.cc)
RADOS objects of this upload
  1. MARKER_photos/2026/11/img_0001.jpg4 MiB + xattrs
  2. MARKER__shadow_.RAND32_14 MiB
  3. MARKER__shadow_.RAND32_22 MiB

Default sizes: the head holds up to 4 MiB (rgw_max_chunk_size), stripes are 4 MiB (rgw_obj_stripe_size), a part is at least 5 MiB (rgw_multipart_min_part_size).

Follows:

  • src/rgw/rgw_op.cc :: RGWPutObj::execute, RGWCompleteMultipart::execute the PUT and complete-multipart operations
  • src/rgw/driver/rados/rgw_putobj_processor.cc :: AtomicObjectProcessor, MultipartObjectProcessor writing the head, stripes and parts
  • src/rgw/driver/rados/rgw_rados.cc :: Object::Write::_do_write_meta, Bucket::UpdateIndex::prepare / complete writing the head and updating the index
  • src/cls/rgw/cls_rgw.cc :: rgw_bucket_prepare_op, rgw_bucket_complete_op the two index operations on the OSD
  • src/rgw/services/svc_bi_rados.h :: bucket_shard_index; src/common/ceph_hash.cc :: ceph_str_hash_linux which bucket index shard a key goes to
  • src/rgw/driver/rados/rgw_obj_manifest.cc :: RGWObjManifest (head, stripes, rgw_obj_stripe_size 4M) how the object is laid out in RADOS
A fixed snapshot of the simulator; the interactive version is in the web edition's lab. Interactive lab: RGW PUT and multipart