Skip to content

Instantly share code, notes, and snippets.

@zaitcev
Created June 24, 2015 05:27
Show Gist options
  • Save zaitcev/0770debe19c960eb0c73 to your computer and use it in GitHub Desktop.
Save zaitcev/0770debe19c960eb0c73 to your computer and use it in GitHub Desktop.
rgw.trace.txt 1
v1
## Down the rabbit hole
- check out Yehuda's branch
- "swift and s3 have separate url-to-object translations" - ?
class rgw_obj # rgw_common.h
std::string loc;
class RGWGetObj : public RGWOp # rgw_op.h
rgw_obj obj;
map<string, bufferlist> attrs;
class RGWOp # rgw_op.h
struct req_state *s; # RGWOp(): s(NULL)
struct req_state # rgw_common.h
RGWBucketInfo bucket_info;
struct RGWBucketInfo # rgw_common.h
rgw_bucket bucket;
struct rgw_bucket # rgw_common.h
std::string name;
std::string data_pool;
std::string index_pool;
class RGWRados # rgw_rados.h
class Object
RGWBucketInfo bucket_info; # another one?
struct Read # rgw_rados.h:1511
RGWRados::Object *source;
process_request(store)
struct req_state rstate(...), *s = &rstate;
RGWHandler *handler = rest->get_handler(store, s, client_io, &mgr, &init_error);
op = handler->get_op(store);
op->pre_exec();
op->RGWGetObj::execute() # rgw_op.cc
RGWGetObj_CB cb(this);
# rgw_obj obj - this->obj
# struct req_state *s; - this->s
RGWRados::Object op_target(store, s->bucket_info,
*static_cast<RGWObjectCtx *>(s->obj_ctx), obj); # bunch of assignments
RGWRados::Object::Read read_op(source=&op_target); # bunch of assignments
RGWRados::Object::Read::prepare() # rgw_rados.cc
RGWRados *store = source->get_store();
RGWObjState *astate = source->get_state();
store->get_obj_ioctx(state.obj = astate->obj, &state.io_ctx);
RGWRados::get_obj_ioctx(const rgw_obj& obj, librados::IoCtx *ioctx) # rgw_rados.cc
# XXX wrong hole despite the comment? only opens pool for bucket!
rgw_bucket bucket;
string oid, key;
get_obj_bucket_and_oid_loc(obj, bucket, oid, key);
static inline void get_obj_bucket_and_oid_loc(const rgw_obj& obj,
rgw_bucket& bucket, string& oid, string& locator{=key}) # rgw_rados.h
bucket = obj.bucket;
prepend_bucket_marker(bucket, obj.get_object(), oid); # to oid
prepend_bucket_marker(bucket, obj.get_loc(), locator);
open_bucket_data_ctx(bucket, *ioctx);
string& pool = bucket.data_pool;
open_bucket_pool_ctx(bucket.name, bucket.data_pool, data_ctx);
RGWRados::open_bucket_pool_ctx(const string& bucket_name,
const string& pool, librados::IoCtx& io_ctx) # rgw_rados.cc
librados::Rados *rad = get_rados_handle();
rad->ioctx_create(pool.c_str(), io_ctx);
ioctx->locator_set_key(key);
..............
read_op.iterate(ofs, end, &cb);
op->complete();
-- normal run -n client.radosgw.gateway -d
break RGWRados::open_bucket_pool_ctx
break RGWRados::get_rados_handle
-> see rgw.gdb.2.out
-- same list request
swift -v -A http://simbelmyne.zaitcev.lan:8080/auth/v1.0 -U test:tester -K testing list
2015-06-22 22:42:41.965693 7fff357b2700 1 civetweb: 0x7fffa4009360: 192.168.128.10 - - [22/Jun/2015:22:42:18 -0600] "GET /swift/v1 HTTP/1.1" -1 0 - python-swiftclient-2.3.1
RGWRados::instance_id
RGWListBuckets::execute # rgw_op.cc
rgw_read_user_buckets(store,user_id,need_stats)
buckets_obj_id=rgw_get_buckets_obj(user_id)
obj=rgw_obj(buckets_obj_id)
RGWRados::cls_user_list_buckets(obj, in_marker="")
RGWRados::get_obj_ref
RGWRados::open_bucket_data_ctx
RGWRados::open_bucket_pool_ctx(bucket_name=".users.uid", pool=".users.uid",)
RGWRados::update_containers_stats # if(need_stats)
RGWRados::cls_bucket_head
RGWRados::open_bucket_index<rgw_cls_list_ret>
RGWRados::open_bucket_index
RGWRados::open_bucket_index_base
RGWRados::open_bucket_index_ctx
RGWRados::open_bucket_pool_ctx (
bucket_name="testcont", pool=".rgw.buckets.index"
- or
bucket_name="tlongname", pool=".rgw.buckets.index"
RGWRados::get_bucket_instance_info # 2x (per 1 container)
RGWRados::get_bucket_instance_from_oid
rgw_get_system_obj
RGWRados::SystemObject::Read::stat
RGWRados::stat_system_obj
get_obj_state
RGWRados::get_obj_state
RGWRados::get_obj_state_impl
RGWCache<RGWRados>::raw_obj_stat
RGWRados::raw_obj_stat
RGWRados::get_obj_ref
RGWRados::open_bucket_data_ctx
RGWRados::open_bucket_pool_ctx (
bucket_name=".rgw", pool=".rgw"
2015-06-22 22:42:47.275690 7fff357b2700 1 civetweb: 0x7fffa4009360: 192.168.128.10 - - [22/Jun/2015:22:42:41 -0600] "GET /swift/v1 HTTP/1.1" -1 0 - python-swiftclient-2.3.1
RGWRados::instance_id
RGWListBuckets::execute
rgw_read_user_buckets
RGWRados::cls_user_list_buckets
RGWRados::get_obj_ref
RGWRados::open_bucket_data_ctx
RGWRados::open_bucket_pool_ctx (
bucket_name=".users.uid", pool=".users.uid",
# But no RGWRados::update_containers_stats this time
# so, need_stats=0 or ...?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment