From: Kai Zhang Date: Fri, 23 May 2014 00:37:16 +0000 (-0700) Subject: Update architecture.rst:Calculating PG IDs X-Git-Tag: v0.82~35^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=d3af8fa88019b1b43d9f730e3efbf8dbc0cc9fa3;p=ceph.git Update architecture.rst:Calculating PG IDs To Calculate PG ID, if I didn't get it wrong, CRUSH calculates the hash modulo the number of PGs instead of OSDs, according to osd/osd_types.cc:963 ceph_stable_mod(pg.ps(), pg_num, pg_num_mask). Signed-off-by: Kai Zhang --- diff --git a/doc/architecture.rst b/doc/architecture.rst index 55fd83b547e..488cbca26ed 100644 --- a/doc/architecture.rst +++ b/doc/architecture.rst @@ -387,13 +387,13 @@ The only input required by the client is the object ID and the pool. It's simple: Ceph stores data in named pools (e.g., "liverpool"). When a client wants to store a named object (e.g., "john," "paul," "george," "ringo", etc.) it calculates a placement group using the object name, a hash code, the -number of OSDs in the cluster and the pool name. Ceph clients use the following +number of PGs in the pool and the pool name. Ceph clients use the following steps to compute PG IDs. #. The client inputs the pool ID and the object ID. (e.g., pool = "liverpool" and object-id = "john") #. CRUSH takes the object ID and hashes it. -#. CRUSH calculates the hash modulo the number of OSDs. (e.g., ``0x58``) to get +#. CRUSH calculates the hash modulo the number of PGs. (e.g., ``0x58``) to get a PG ID. #. CRUSH gets the pool ID given the pool name (e.g., "liverpool" = ``4``) #. CRUSH prepends the pool ID to the PG ID (e.g., ``4.0x58``). @@ -1450,4 +1450,4 @@ instance for high availability. .. _RESTful: http://en.wikipedia.org/wiki/RESTful .. _Erasure Code Notes: https://github.com/ceph/ceph/blob/40059e12af88267d0da67d8fd8d9cd81244d8f93/doc/dev/osd_internals/erasure_coding/developer_notes.rst .. _Cache Tiering: ../rados/operations/cache-tiering -.. _Set Pool Values: ../rados/operations/pools#set-pool-values \ No newline at end of file +.. _Set Pool Values: ../rados/operations/pools#set-pool-values