ceph rgw 流程分析


bucke_id的创建

```
void RGWRados::create_bucket_id(string *bucket_id)
{
  uint64_t iid = instance_id();
  uint64_t bid = next_bucket_id();
  char buf[get_zone_params().get_id().size() + 48];
  snprintf(buf, sizeof(buf), "%s.%llu.%llu", get_zone_params().get_id().c_str(), (long long)iid, (long long)bid);
  *bucket_id = buf;
}


uint64_t librados::RadosClient::get_instance_id()
{
  return instance_id;
}

```

``` 
   "bucket": "test1",
    "pool": "default.rgw.buckets.data",
    "index_pool": "default.rgw.buckets.index",
    "id": "69b999f0-e4ef-4ec3-a649-861e36495b0a.334114.1",
    "marker": "69b999f0-e4ef-4ec3-a649-861e36495b0a.334114.1",
    "owner": "yly",
    "ver": "0#3",
    "master_ver": "0#0",
    "mtime": "2018-05-19 08:46:10.077565",
    "max_marker": "0#",
```

删除test1后重新创建

```
   "bucket": "test1",
    "pool": "default.rgw.buckets.data",
    "index_pool": "default.rgw.buckets.index",
    "id": "69b999f0-e4ef-4ec3-a649-861e36495b0a.334114.2",
    "marker": "69b999f0-e4ef-4ec3-a649-861e36495b0a.334114.2",
    "owner": "yly",
    "ver": "0#1",
    "master_ver": "0#0",
    "mtime": "2018-05-19 09:38:06.252830",
    "max_marker": "0#",
```

删除test1后重新创建

```
    "bucket": "test1",
    "pool": "default.rgw.buckets.data",
    "index_pool": "default.rgw.buckets.index",
    "id": "69b999f0-e4ef-4ec3-a649-861e36495b0a.334114.3",
    "marker": "69b999f0-e4ef-4ec3-a649-861e36495b0a.334114.3",
    "owner": "yly",
    "ver": "0#1",
    "master_ver": "0#0",
    "mtime": "2018-05-19 09:40:21.547588",
    "max_marker": "0#",
```

删除test1
重启rgw后重新创建test1

```
    "bucket": "test1",
    "pool": "default.rgw.buckets.data",
    "index_pool": "default.rgw.buckets.index",
    "id": "69b999f0-e4ef-4ec3-a649-861e36495b0a.334126.1",
    "marker": "69b999f0-e4ef-4ec3-a649-861e36495b0a.334126.1",
    "owner": "yly",
    "ver": "0#1",
    "master_ver": "0#0",
    "mtime": "2018-05-19 09:43:01.299655",
    "max_marker": "0#",
```

> 重启rgw后这个instance_id就变了,应该和rgw instance启动的时候有关


```

ACLGrant
ACLGranteeType
ACLOwner
ACLPermission
AuthMonitor::Incremental
BitVector<2>
BloomHitSet
Capability
CompatSet
CrushWrapper
DBObjectMap::State
DBObjectMap::_Header
DecayCounter
ECSubRead
ECSubReadReply
ECSubWrite
ECSubWriteReply
ECUtil::HashInfo
ECommitted
EExport
EFragment
EImportFinish
EImportStart
EMetaBlob
EMetaBlob::dirlump
EMetaBlob::fullbit
EMetaBlob::nullbit
EMetaBlob::remotebit
EOpen
EResetJournal
ESession
ESessions
ESlaveUpdate
ESubtreeMap
ETableClient
ETableServer
EUpdate
ExplicitHashHitSet
ExplicitObjectHitSet
FSMap
HitSet
HitSet::Params
InoTable
InodeStore
JournalPointer
Journaler::Header
LevelDBStoreStats
LogEntry
LogEntryKey
LogSummary
MAuth
MAuthReply
MCacheExpire
MClientCapRelease
MClientCaps
MClientLease
MClientReconnect
MClientReply
MClientRequest
MClientRequestForward
MClientSession
MClientSnap
MCommand
MCommandReply
MDSCacheObjectInfo
MDSMap
MDSMap::mds_info_t
MDentryLink
MDentryUnlink
MDirUpdate
MDiscover
MDiscoverReply
MExportCaps
MExportCapsAck
MExportDir
MExportDirAck
MExportDirCancel
MExportDirDiscover
MExportDirDiscoverAck
MExportDirFinish
MExportDirNotify
MExportDirNotifyAck
MExportDirPrep
MExportDirPrepAck
MForward
MGetPoolStats
MGetPoolStatsReply
MHeartbeat
MInodeFileCaps
MLock
MLog
MLogAck
MMDSBeacon
MMDSCacheRejoin
MMDSFindIno
MMDSFindInoReply
MMDSFragmentNotify
MMDSLoadTargets
MMDSMap
MMDSResolve
MMDSResolveAck
MMDSSlaveRequest
MMDSTableRequest
MMonCommand
MMonCommandAck
MMonElection
MMonGetMap
MMonGetVersion
MMonGetVersionReply
MMonGlobalID
MMonJoin
MMonMap
MMonPaxos
MMonProbe
MMonScrub
MMonSubscribe
MMonSubscribeAck
MMonSync
MOSDAlive
MOSDBoot
MOSDFailure
MOSDMap
MOSDOp
MOSDOpReply
MOSDPGBackfill
MOSDPGCreate
MOSDPGInfo
MOSDPGLog
MOSDPGMissing
MOSDPGNotify
MOSDPGQuery
MOSDPGRemove
MOSDPGScan
MOSDPGTemp
MOSDPGTrim
MOSDPing
MOSDRepScrub
MOSDScrub
MOSDSubOp
MOSDSubOpReply
MPGStats
MPGStatsAck
MPing
MPoolOp
MPoolOpReply
MRemoveSnaps
MRoute
MStatfs
MStatfsReply
MWatchNotify
MonCap
MonMap
MonitorDBStore::Op
MonitorDBStore::Transaction
OSDMap
OSDMap::Incremental
OSDSuperblock
ObjectCacheInfo
ObjectMetaInfo
ObjectRecoveryInfo
ObjectRecoveryProgress
ObjectStore::Transaction
PGMap
PGMap::Incremental
PullOp
PushOp
PushReplyOp
RGWAccessControlList
RGWAccessControlPolicy
RGWAccessKey
RGWBucketEnt
RGWBucketInfo
RGWCacheNotifyInfo
RGWOLHInfo
RGWObjManifest
RGWObjManifestPart
RGWSubUser
RGWUploadPartInfo
RGWUserInfo
RGWZone
RGWZoneGroup
RGWZoneParams
ScrubMap
ScrubMap::object
SequencerPosition
SloppyCRCMap
SnapContext
SnapInfo
SnapRealmInfo
SnapServer
SnapSet
bloom_filter
bluestore_cnode_t
bluestore_extent_ref_map_t
bluestore_extent_t
bluestore_onode_t
bluestore_overlay_t
bluestore_wal_op_t
bluestore_wal_transaction_t
cap_reconnect_t
ceph_data_stats
client_writeable_range_t
clone_info
cls::journal::Client
cls::journal::ObjectPosition
cls::journal::ObjectSetPosition
cls::rbd::MirrorImage
cls::rbd::MirrorPeer
cls_lock_assert_op
cls_lock_break_op
cls_lock_get_info_op
cls_lock_get_info_reply
cls_lock_list_locks_reply
cls_lock_lock_op
cls_lock_set_cookie_op
cls_lock_unlock_op
cls_rbd_parent
cls_rbd_snap
cls_refcount_get_op
cls_refcount_put_op
cls_refcount_read_op
cls_refcount_read_ret
cls_refcount_set_op
cls_replica_log_bound
cls_replica_log_delete_marker_op
cls_replica_log_get_bounds_op
cls_replica_log_get_bounds_ret
cls_replica_log_item_marker
cls_replica_log_progress_marker
cls_replica_log_set_marker_op
cls_rgw_bi_log_list_op
cls_rgw_bi_log_list_ret
cls_rgw_bi_log_trim_op
cls_rgw_gc_defer_entry_op
cls_rgw_gc_list_op
cls_rgw_gc_list_ret
cls_rgw_gc_obj_info
cls_rgw_gc_remove_op
cls_rgw_gc_set_entry_op
cls_rgw_obj
cls_rgw_obj_chain
cls_rgw_obj_key
cls_user_bucket
cls_user_bucket_entry
cls_user_complete_stats_sync_op
cls_user_get_header_op
cls_user_get_header_ret
cls_user_header
cls_user_list_buckets_op
cls_user_list_buckets_ret
cls_user_remove_bucket_op
cls_user_set_buckets_op
cls_user_stats
coll_t
compressible_bloom_filter
dirfrag_load_vec_t
entity_addr_t
entity_name_t
file_layout_t
filepath
fnode_t
frag_info_t
ghobject_t
hobject_t
inode_backpointer_t
inode_backtrace_t
inode_load_vec_t
inode_t
journal::Entry
librbd::journal::ClientData
librbd::journal::EventEntry
librbd::journal::TagData
librbd::mirroring_watcher::NotifyMessage
librbd::watch_notify::NotifyMessage
librbd::watch_notify::ResponseMessage
link_rollback
mds_load_t
mds_table_pending_t
nest_info_t
obj_list_snap_response_t
object_copy_cursor_t
object_copy_data_t
object_info_t
object_locator_t
object_stat_collection_t
object_stat_sum_t
objectstore_perf_stat_t
old_inode_t
old_rstat_t
osd_info_t
osd_peer_stat_t
osd_reqid_t
osd_stat_t
osd_xinfo_t
pg_create_t
pg_history_t
pg_hit_set_history_t
pg_hit_set_info_t
pg_info_t
pg_interval_t
pg_log_entry_t
pg_log_t
pg_ls_response_t
pg_missing_t
pg_missing_t::item
pg_nls_response_t
pg_pool_t
pg_query_t
pg_stat_t
pg_t
pool_snap_info_t
pool_stat_t
pow2_hist_t
quota_info_t
rados::cls::lock::locker_id_t
rados::cls::lock::locker_info_t
rbd_replay::action::ActionEntry
rbd_replay::action::Dependency
real_time_wrapper
rename_rollback
rename_rollback::drec
request_redirect_t
rgw_bi_log_entry
rgw_bucket
rgw_bucket_category_stats
rgw_bucket_dir
rgw_bucket_dir_entry
rgw_bucket_dir_entry_meta
rgw_bucket_dir_header
rgw_bucket_entry_ver
rgw_bucket_olh_log_entry
rgw_bucket_pending_info
rgw_cls_bucket_clear_olh_op
rgw_cls_check_index_ret
rgw_cls_link_olh_op
rgw_cls_list_op
rgw_cls_list_ret
rgw_cls_obj_complete_op
rgw_cls_obj_prepare_op
rgw_cls_read_olh_log_op
rgw_cls_read_olh_log_ret
rgw_cls_tag_timeout_op
rgw_cls_trim_olh_log_op
rgw_cls_unlink_instance_op
rgw_log_entry
rgw_obj
rmdir_rollback
session_info_t
snaplink_t
sr_t
string_snap_t
watch_info_t


ceph-kvstore-tool leveldb /onest/ceph/src/dev/osd0/current/omap/ get _USER_0000000000002401_USER_  01526691600_yly_test1 out test.bi
ceph-dencoder import test.bin type cls_rgw_bi_log_list_op decode dump_json
```