From b76f12d499125c283ff1ae702653847053fd9d84 Mon Sep 17 00:00:00 2001 From: John Wilkins Date: Tue, 4 Dec 2012 10:58:02 -0800 Subject: [PATCH 01/23] doc: Edited striping section. Modified stripe graphic to pretty print. Also modified replication graphic to pretty print. Signed-off-by: John Wilkins --- doc/architecture.rst | 185 ++++++++++++++++++++++++------------------- 1 file changed, 103 insertions(+), 82 deletions(-) diff --git a/doc/architecture.rst b/doc/architecture.rst index e944192ef7e..116ec4110f3 100644 --- a/doc/architecture.rst +++ b/doc/architecture.rst @@ -146,15 +146,30 @@ appropriate placement groups in the secondary and tertiary OSDs (as many OSDs as additional replicas), and responds to the client once it has confirmed the object was stored successfully. -.. ditaa:: +--------+ Write +--------------+ Replica 1 +----------------+ - | Client |*-------------->| Primary OSD |*---------------->| Secondary OSD | - | |<--------------*| |<----------------*| | - +--------+ Write Ack +--------------+ Replica 1 Ack +----------------+ - ^ * - | | Replica 2 +----------------+ - | +----------------------->| Tertiary OSD | - +--------------------------*| | - Replica 2 Ack +----------------+ + +.. ditaa:: + +----------+ + | Client | + | | + +----------+ + * ^ + Write (1) | | Ack (6) + | | + v * + +-------------+ + | Primary OSD | + | | + +-------------+ + * ^ ^ * + Write (2) | | | | Write (3) + +------+ | | +------+ + | +------+ +------+ | + | | Ack (4) Ack (5)| | + v * * v + +---------------+ +---------------+ + | Secondary OSD | | Tertiary OSD | + | | | | + +---------------+ +---------------+ Since any network device has a limit to the number of concurrent connections it @@ -222,82 +237,84 @@ of striping: If you anticipate large images sizes, large S3 or Swift objects (video), or -large CephFS files, you may see considerable read/write performance improvements -by striping client data over mulitple objects within an object set. Significant -write performance occurs when the client writes the stripe units to their -corresponding objects simultaneously. Since objects get mapped to different -placement groups and further mapped to different OSDs, each write occurs -simultaneously at the maximum write speed. So the stripe count may serve as a -proxy for the multiple of the performance improvement. Read performance is -similarly affected. However, setting up connections between the client and the -OSDs and the network latency also play a role in the overall performance. +large CephFS directories, you may see considerable read/write performance +improvements by striping client data over mulitple objects within an object set. +Significant write performance occurs when the client writes the stripe units to +their corresponding objects in parallel. Since objects get mapped to different +placement groups and further mapped to different OSDs, each write occurs in +parallel at the maximum write speed. A write to a single disk would be limited +by the head movement (e.g. 6ms per seek) and bandwidth of that one device (e.g. +100MB/s). By spreading that write over multiple objects (which map to different +placement groups and OSDs) Ceph can reduce the number of seeks per drive and +combine the throughput of multiple drives to achieve much faster write (or read) +speeds. In the following diagram, client data gets striped across an object set (``object set 1`` in the following diagram) consisting of 4 objects, where the -first stripe unit is ``stripe 0`` in ``object 0``, and the fourth stripe unit is -``stripe 3`` in ``object 3``. After writing the fourth stripe, the client -determines if the object set is full. If the object set is not full, the client -begins writing a stripe to the first object again (``object 0`` in the following -diagram). If the object set is full, the client creates a new object set -(``object set 2`` in the following diagram), and begins writing to the first -stripe (``stripe 4``) in the first object in the new object set (``object 4`` in -the diagram below). +first stripe unit is ``stripe unit 0`` in ``object 0``, and the fourth stripe +unit is ``stripe unit 3`` in ``object 3``. After writing the fourth stripe, the +client determines if the object set is full. If the object set is not full, the +client begins writing a stripe to the first object again (``object 0`` in the +following diagram). If the object set is full, the client creates a new object +set (``object set 2`` in the following diagram), and begins writing to the first +stripe (``stripe unit 16``) in the first object in the new object set (``object +4`` in the diagram below). .. ditaa:: - +---------------+ - | Client Data | - | Format | - | cCCC | - +---------------+ - | - +-----------------+--------+--------+-----------------+ - | | | | +--\ - v v v v | - /-----------\ /-----------\ /-----------\ /-----------\ | - | Begin cCCC| | Begin cCCC| | Begin cCCC| | Begin cCCC| | - | Object 0 | | Object 1 | | Object 2 | | Object 3 | | - +-----------+ +-----------+ +-----------+ +-----------+ | - | stripe | | stripe | | stripe | | stripe | | - | unit 0 | | unit 1 | | unit 2 | | unit 3 | | - +-----------+ +-----------+ +-----------+ +-----------+ | - | stripe | | stripe | | stripe | | stripe | +-\ - | unit 4 | | unit 5 | | unit 6 | | unit 7 | | Object - +-----------+ +-----------+ +-----------+ +-----------+ +- Set - | stripe | | stripe | | stripe | | stripe | | 1 - | unit 8 | | unit 9 | | unit 10 | | unit 11 | +-/ - +-----------+ +-----------+ +-----------+ +-----------+ | - | stripe | | stripe | | stripe | | stripe | | - | unit 12 | | unit 13 | | unit 14 | | unit 15 | | - +-----------+ +-----------+ +-----------+ +-----------+ | - | End cCCC | | End cCCC | | End cCCC | | End cCCC | | - | Object 0 | | Object 1 | | Object 2 | | Object 3 | | - \-----------/ \-----------/ \-----------/ \-----------/ | - | - +--/ + +---------------+ + | Client Data | + | Format | + | cCCC | + +---------------+ + | + +-----------------+--------+--------+-----------------+ + | | | | +--\ + v v v v | + /-----------\ /-----------\ /-----------\ /-----------\ | + | Begin cCCC| | Begin cCCC| | Begin cCCC| | Begin cCCC| | + | Object 0 | | Object 1 | | Object 2 | | Object 3 | | + +-----------+ +-----------+ +-----------+ +-----------+ | + | stripe | | stripe | | stripe | | stripe | | + | unit 0 | | unit 1 | | unit 2 | | unit 3 | | + +-----------+ +-----------+ +-----------+ +-----------+ | + | stripe | | stripe | | stripe | | stripe | +-\ + | unit 4 | | unit 5 | | unit 6 | | unit 7 | | Object + +-----------+ +-----------+ +-----------+ +-----------+ +- Set + | stripe | | stripe | | stripe | | stripe | | 1 + | unit 8 | | unit 9 | | unit 10 | | unit 11 | +-/ + +-----------+ +-----------+ +-----------+ +-----------+ | + | stripe | | stripe | | stripe | | stripe | | + | unit 12 | | unit 13 | | unit 14 | | unit 15 | | + +-----------+ +-----------+ +-----------+ +-----------+ | + | End cCCC | | End cCCC | | End cCCC | | End cCCC | | + | Object 0 | | Object 1 | | Object 2 | | Object 3 | | + \-----------/ \-----------/ \-----------/ \-----------/ | + | + +--/ - +--\ - | - /-----------\ /-----------\ /-----------\ /-----------\ | - | Begin cCCC| | Begin cCCC| | Begin cCCC| | Begin cCCC| | - | Object 4 | | Object 5 | | Object 6 | | Object 7 | | - +-----------+ +-----------+ +-----------+ +-----------+ | - | stripe | | stripe | | stripe | | stripe | | - | unit 15 | | unit 16 | | unit 17 | | unit 18 | | - +-----------+ +-----------+ +-----------+ +-----------+ | - | stripe | | stripe | | stripe | | stripe | +-\ - | unit 19 | | unit 20 | | unit 21 | | unit 22 | | Object - +-----------+ +-----------+ +-----------+ +-----------+ +- Set - | stripe | | stripe | | stripe | | stripe | | 2 - | unit 23 | | unit 24 | | unit 25 | | unit 26 | +-/ - +-----------+ +-----------+ +-----------+ +-----------+ | - | stripe | | stripe | | stripe | | stripe | | - | unit 27 | | unit 28 | | unit 29 | | unit 30 | | - +-----------+ +-----------+ +-----------+ +-----------+ | - | End cCCC | | End cCCC | | End cCCC | | End cCCC | | - | Object 4 | | Object 5 | | Object 6 | | Object 7 | | - \-----------/ \-----------/ \-----------/ \-----------/ | - | - +--/ + +--\ + | + /-----------\ /-----------\ /-----------\ /-----------\ | + | Begin cCCC| | Begin cCCC| | Begin cCCC| | Begin cCCC| | + | Object 4 | | Object 5 | | Object 6 | | Object 7 | | + +-----------+ +-----------+ +-----------+ +-----------+ | + | stripe | | stripe | | stripe | | stripe | | + | unit 16 | | unit 17 | | unit 18 | | unit 19 | | + +-----------+ +-----------+ +-----------+ +-----------+ | + | stripe | | stripe | | stripe | | stripe | +-\ + | unit 20 | | unit 21 | | unit 22 | | unit 23 | | Object + +-----------+ +-----------+ +-----------+ +-----------+ +- Set + | stripe | | stripe | | stripe | | stripe | | 2 + | unit 24 | | unit 25 | | unit 26 | | unit 27 | +-/ + +-----------+ +-----------+ +-----------+ +-----------+ | + | stripe | | stripe | | stripe | | stripe | | + | unit 28 | | unit 29 | | unit 30 | | unit 31 | | + +-----------+ +-----------+ +-----------+ +-----------+ | + | End cCCC | | End cCCC | | End cCCC | | End cCCC | | + | Object 4 | | Object 5 | | Object 6 | | Object 7 | | + \-----------/ \-----------/ \-----------/ \-----------/ | + | + +--/ Three important variables determine how Ceph stripes data: @@ -306,9 +323,9 @@ Three important variables determine how Ceph stripes data: enough to accomodate many stripe units, and should be a multiple of the stripe unit. -- **Stripe Unit:** Stripes have a configurable unit size (e.g., 64kb). +- **Stripe Width:** Stripes have a configurable unit size (e.g., 64kb). The Ceph client divides the data it will write to objects into equally - sized stripe units, except for the last stripe unit. A stripe unit, + sized stripe units, except for the last stripe unit. A stripe width, should be a fraction of the Object Size so that an object may contain many stripe units. @@ -347,7 +364,11 @@ storage disk. See `How Ceph Scales`_ for details. get mapped to placement groups in the same pool. So they use the same CRUSH map and the same access controls. -.. tip:: The objects Ceph stores in the Object Store are not striped. +.. tip:: The objects Ceph stores in the Object Store are not striped. RGW, RBD + and CephFS automatically stripe their data over multiple RADOS objects. + Clients that write directly to the Object Store via ``librados`` must + peform the the striping (and parallel I/O) for themselves to obtain these + benefits. Data Consistency From 724d5aaa3bf7e95075176582aa4d54d8e6a6caf2 Mon Sep 17 00:00:00 2001 From: Samuel Just Date: Tue, 4 Dec 2012 14:48:35 -0800 Subject: [PATCH 02/23] doc: added some descriptions in ms-ref and filestore-config-ref Signed-off-by: Samuel Just --- doc/rados/configuration/filestore-config-ref.rst | 12 ++++++------ doc/rados/configuration/ms-ref.rst | 6 +++--- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/doc/rados/configuration/filestore-config-ref.rst b/doc/rados/configuration/filestore-config-ref.rst index e45c0f7a9fc..80aed8e81a4 100644 --- a/doc/rados/configuration/filestore-config-ref.rst +++ b/doc/rados/configuration/filestore-config-ref.rst @@ -205,7 +205,7 @@ Journal ``filestore journal parallel`` -:Description: +:Description: Enables parallel journaling, default for btrfs. :Type: Boolean :Required: No :Default: ``false`` @@ -213,7 +213,7 @@ Journal ``filestore journal writeahead`` -:Description: +:Description: Enables writeahead journaling, default for xfs. :Type: Boolean :Required: No :Default: ``false`` @@ -221,7 +221,7 @@ Journal ``filestore journal trailing`` -:Description: +:Description: Deprecated, never use. :Type: Boolean :Required: No :Default: ``false`` @@ -233,7 +233,7 @@ Misc ``filestore merge threshold`` -:Description: +:Description: Min number of files in a subdir before merging into parent :Type: Integer :Required: No :Default: ``10`` @@ -241,7 +241,7 @@ Misc ``filestore split multiple`` -:Description: +:Description: filestore_split_multiple*filestore_merge_threshold*16 is the max files in a subdir before splitting into child directories. :Type: Integer :Required: No :Default: ``2`` @@ -249,7 +249,7 @@ Misc ``filestore update to`` -:Description: +:Description: Limits filestore auto upgrade to specified version. :Type: Integer :Required: No :Default: ``1000`` diff --git a/doc/rados/configuration/ms-ref.rst b/doc/rados/configuration/ms-ref.rst index d76f7f3bb25..9777abb1a6b 100644 --- a/doc/rados/configuration/ms-ref.rst +++ b/doc/rados/configuration/ms-ref.rst @@ -5,7 +5,7 @@ ``ms tcp nodelay`` -:Description: +:Description: Disables nagle's algorithm on messenger tcp sessions. :Type: Boolean :Required: No :Default: ``true`` @@ -29,7 +29,7 @@ ``ms nocrc`` -:Description: +:Description: Disables crc on network messages. May increase performance if cpu limited. :Type: Boolean :Required: No :Default: ``false`` @@ -45,7 +45,7 @@ ``ms dispatch throttle bytes`` -:Description: +:Description: Throttles total size of messages waiting to be dispatched. :Type: 64-bit Unsigned Integer :Required: No :Default: ``100 << 20`` From 3cf2197c9598162613f68fabd4d7dce5d26a8fd5 Mon Sep 17 00:00:00 2001 From: Greg Farnum Date: Tue, 4 Dec 2012 14:43:45 -0800 Subject: [PATCH 03/23] doc: write descriptions for the remaining msgr options Signed-off-by: Greg Farnum --- doc/rados/configuration/ms-ref.rst | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/doc/rados/configuration/ms-ref.rst b/doc/rados/configuration/ms-ref.rst index 9777abb1a6b..d0b1b172d7f 100644 --- a/doc/rados/configuration/ms-ref.rst +++ b/doc/rados/configuration/ms-ref.rst @@ -13,7 +13,7 @@ ``ms initial backoff`` -:Description: +:Description: The initial time to wait before reconnecting on a fault. :Type: Double :Required: No :Default: ``.2`` @@ -21,7 +21,7 @@ ``ms max backoff`` -:Description: +:Description: The maximum time to wait before reconnecting on a fault. :Type: Double :Required: No :Default: ``15.0`` @@ -37,7 +37,7 @@ ``ms die on bad msg`` -:Description: +:Description: Debug option; do not configure. :Type: Boolean :Required: No :Default: ``false`` @@ -53,7 +53,7 @@ ``ms bind ipv6`` -:Description: +:Description: Enable if you want your daemons to bind to IPv6 address instead of IPv4 ones. (Not required if you specify a daemon or cluster IP.) :Type: Boolean :Required: No :Default: ``false`` @@ -61,7 +61,7 @@ ``ms rwthread stack bytes`` -:Description: +:Description: Debug option for stack size; do not configure. :Type: 64-bit Unsigned Integer :Required: No :Default: ``1024 << 10`` @@ -69,7 +69,7 @@ ``ms tcp read timeout`` -:Description: +:Description: Controls how long (in seconds) the messenger will wait before closing an idle connection. :Type: 64-bit Unsigned Integer :Required: No :Default: ``900`` @@ -77,7 +77,7 @@ ``ms inject socket failures`` -:Description: +:Description: Debug option; do not configure. :Type: 64-bit Unsigned Integer :Required: No :Default: ``0`` From 3986564b44171dc33afb3ea7dc5d8c6787161c0e Mon Sep 17 00:00:00 2001 From: tamil Date: Tue, 4 Dec 2012 15:42:12 -0800 Subject: [PATCH 04/23] Dropping xfs tests 179 and 183 as they are causing nightly failures Signed-off-by: tamil --- qa/run_xfstests.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qa/run_xfstests.sh b/qa/run_xfstests.sh index 1eba38a248d..3bcd8b5a636 100644 --- a/qa/run_xfstests.sh +++ b/qa/run_xfstests.sh @@ -49,7 +49,7 @@ XFS_MKFS_OPTIONS="-l su=32k" # until we can work through getting them all passing reliably. TESTS="1-9 11-15 17 19-21 26-29 31-34 41 46-48 50-54 56 61 63-67 69-70 74-76" TESTS="${TESTS} 78 79 84-89 91-92 100 103 105 108 110 116-121 124 126" -TESTS="${TESTS} 129-135 137-141 164-167 179 182-184 186-190 192 194" +TESTS="${TESTS} 129-135 137-141 164-167 182 184 186-190 192 194" TESTS="${TESTS} 196 199 201 203 214-216 220-227 234 236-238 241 243-249" TESTS="${TESTS} 253 257-259 261 262 269 273 275 277 278 280 285 286" # 275 was the highest available test as of 4/10/12. From cb19e994f2de15dc0bc7e9d0b35d2327f6c88e41 Mon Sep 17 00:00:00 2001 From: Josh Durgin Date: Wed, 5 Dec 2012 12:50:24 -0800 Subject: [PATCH 05/23] doc: ceph osd create takes a uuid, not an osd id This was updated by 36e7b077a77fa0a6c87289f400391c85dcdb1d42, but accidentally reverted in later changes. Signed-off-by: Josh Durgin --- doc/rados/operations/control.rst | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/doc/rados/operations/control.rst b/doc/rados/operations/control.rst index 4a88955d3f4..ced336d376c 100644 --- a/doc/rados/operations/control.rst +++ b/doc/rados/operations/control.rst @@ -151,10 +151,10 @@ Mark an OSD as lost. This may result in permanent data loss. Use with caution. : ceph osd lost [--yes-i-really-mean-it] -Create a new OSD. If no ID is given, a new ID is automatically selected -if possible. :: +Create a new OSD. If no UUID is given, it will be set automatically when the OSD +starts up. :: - ceph osd create [{id}] + ceph osd create [{uuid}] Remove the given OSD(s). :: From 27793255963f8d3ce329ce70326316175b2a101e Mon Sep 17 00:00:00 2001 From: Yehuda Sadeh Date: Thu, 29 Nov 2012 13:39:22 -0800 Subject: [PATCH 06/23] rgw: fix rgw_tools get_obj() The original implementation broke whenever data exceeded the chunk size. Also don't keep cache for objects that exceed the chunk size as cache is not designed for it. Increased chunk size to 512k. Signed-off-by: Yehuda Sadeh --- src/rgw/rgw_cache.h | 5 +++++ src/rgw/rgw_tools.cc | 23 +++++++++++------------ 2 files changed, 16 insertions(+), 12 deletions(-) diff --git a/src/rgw/rgw_cache.h b/src/rgw/rgw_cache.h index fb6ca10692d..e4002f6af25 100644 --- a/src/rgw/rgw_cache.h +++ b/src/rgw/rgw_cache.h @@ -268,6 +268,11 @@ int RGWCache::get_obj(void *ctx, void **handle, rgw_obj& obj, bufferlist& obl return r; } + if (obl.length() == end + 1) { + /* in this case, most likely object contains more data, we can't cache it */ + return r; + } + bufferptr p(r); bufferlist& bl = info.data; bl.clear(); diff --git a/src/rgw/rgw_tools.cc b/src/rgw/rgw_tools.cc index b6d9f284771..e83e49a0652 100644 --- a/src/rgw/rgw_tools.cc +++ b/src/rgw/rgw_tools.cc @@ -10,7 +10,7 @@ #define dout_subsys ceph_subsys_rgw -#define READ_CHUNK_LEN (16 * 1024) +#define READ_CHUNK_LEN (512 * 1024) static map ext_mime_map; @@ -41,25 +41,24 @@ int rgw_get_obj(RGWRados *rgwstore, void *ctx, rgw_bucket& bucket, string& key, bufferlist::iterator iter; int request_len = READ_CHUNK_LEN; rgw_obj obj(bucket, key); - ret = rgwstore->prepare_get_obj(ctx, obj, NULL, NULL, pattrs, NULL, - NULL, NULL, NULL, NULL, NULL, NULL, &handle, &err); - if (ret < 0) - return ret; - do { - ret = rgwstore->get_obj(ctx, &handle, obj, bl, 0, request_len - 1); + ret = rgwstore->prepare_get_obj(ctx, obj, NULL, NULL, pattrs, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, &handle, &err); if (ret < 0) - goto done; + return ret; + + ret = rgwstore->get_obj(ctx, &handle, obj, bl, 0, request_len - 1); + rgwstore->finish_get_obj(&handle); + if (ret < 0) + return ret; + if (ret < request_len) break; bl.clear(); request_len *= 2; } while (true); - ret = 0; -done: - rgwstore->finish_get_obj(&handle); - return ret; + return 0; } void parse_mime_map_line(const char *start, const char *end) From ef24f5318c09b84f5885d8910a4d7920168da970 Mon Sep 17 00:00:00 2001 From: John Wilkins Date: Thu, 6 Dec 2012 14:20:00 -0800 Subject: [PATCH 07/23] doc: Change per doc request. Signed-off-by: John Wilkins --- doc/rados/deployment/mkcephfs.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/rados/deployment/mkcephfs.rst b/doc/rados/deployment/mkcephfs.rst index a6531ec84d7..7c89081d1c4 100644 --- a/doc/rados/deployment/mkcephfs.rst +++ b/doc/rados/deployment/mkcephfs.rst @@ -19,7 +19,7 @@ Enter a password for the root user. On the admin host, generate an ``ssh`` key without specifying a passphrase and use the default locations. :: - sudo -s + sudo -i ssh-keygen Generating public/private key pair. Enter file in which to save the key (/root/.ssh/id_rsa): @@ -34,7 +34,7 @@ OSD host. For example:: ssh-copy-id root@myserver01 ssh-copy-id root@myserver02 -Modify your ``~/.ssh/config`` file to login as ``root``, as follows:: +Modify your ``/root/.ssh/config`` file to login as ``root``, as follows:: Host myserver01 Hostname myserver01.fully-qualified-domain.com From 4d43c86389baf46f5a85a5ffd133621685b6fd59 Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Fri, 7 Dec 2012 04:09:16 -0800 Subject: [PATCH 08/23] doc: fix bobtail version in os-recommendations Signed-off-by: Sage Weil --- doc/install/os-recommendations.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/install/os-recommendations.rst b/doc/install/os-recommendations.rst index 52e9c2fff89..5fe647e01c0 100644 --- a/doc/install/os-recommendations.rst +++ b/doc/install/os-recommendations.rst @@ -54,7 +54,7 @@ Argonaut (0.48) | Debian | 7.0 | Wheezy | linux-3.2.0 | 1, 2 | B | +----------+----------+--------------------+--------------+---------+------------+ -Bobtail (0.55) +Bobtail (0.56) -------------- +----------+----------+--------------------+--------------+---------+------------+ From f81d7207663633d82ad591d438c5a7ddbee26ff3 Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Fri, 7 Dec 2012 04:10:02 -0800 Subject: [PATCH 09/23] doc/install/os-recommendations: fix syncfs notes For argonaut, squeeze and wheezy lack syncfs. For bobtail, only older kernels are problematic; we don't depend on glibc support. Signed-off-by: Sage Weil --- doc/install/os-recommendations.rst | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/doc/install/os-recommendations.rst b/doc/install/os-recommendations.rst index 5fe647e01c0..2f101dc4271 100644 --- a/doc/install/os-recommendations.rst +++ b/doc/install/os-recommendations.rst @@ -24,7 +24,8 @@ glibc - **syncfs(2)**: For non-btrfs filesystems such as XFS and ext4 where more than one ``ceph-osd`` daemon is used on a single server, Ceph performs signficantly better with the ``syncfs(2)`` system call - (added in kernel 2.6.39 and glibc 2.14). + (added in kernel 2.6.39 and glibc 2.14). New versions of Ceph (v0.55 and + later) do not depend on glibc support. Platforms @@ -49,9 +50,9 @@ Argonaut (0.48) +----------+----------+--------------------+--------------+---------+------------+ | Ubuntu | 12.10 | Quantal Quetzal | linux-3.5.4 | 2 | B | +----------+----------+--------------------+--------------+---------+------------+ -| Debian | 6.0 | Squeeze | linux-2.6.32 | 1, 2 | B | +| Debian | 6.0 | Squeeze | linux-2.6.32 | 1, 2, 3 | B | +----------+----------+--------------------+--------------+---------+------------+ -| Debian | 7.0 | Wheezy | linux-3.2.0 | 1, 2 | B | +| Debian | 7.0 | Wheezy | linux-3.2.0 | 1, 2, 3 | B | +----------+----------+--------------------+--------------+---------+------------+ Bobtail (0.56) @@ -62,17 +63,17 @@ Bobtail (0.56) +==========+==========+====================+==============+=========+============+ | Ubuntu | 11.04 | Natty Narwhal | linux-2.6.38 | 1, 2, 3 | B | +----------+----------+--------------------+--------------+---------+------------+ -| Ubuntu | 11.10 | Oneric Ocelot | linux-3.0.0 | 1, 2, 3 | B | +| Ubuntu | 11.10 | Oneric Ocelot | linux-3.0.0 | 1, 2 | B | +----------+----------+--------------------+--------------+---------+------------+ | Ubuntu | 12.04 | Precise Pangolin | linux-3.2.0 | 1, 2 | B, I, C | +----------+----------+--------------------+--------------+---------+------------+ | Ubuntu | 12.10 | Quantal Quetzal | linux-3.5.4 | 2 | B | +----------+----------+--------------------+--------------+---------+------------+ -| Debian | 6.0 | Squeeze | linux-2.6.32 | 1, 2 | B | +| Debian | 6.0 | Squeeze | linux-2.6.32 | 1, 2, 3 | B | +----------+----------+--------------------+--------------+---------+------------+ | Debian | 7.0 | Wheezy | linux-3.2.0 | 1, 2 | B | +----------+----------+--------------------+--------------+---------+------------+ -| CentOS | 6.3 | N/A | linux-2.6.32 | 1, 2, 3 | B, I | +| CentOS | 6.3 | N/A | linux-2.6.32 | 1, 2 | B, I | +----------+----------+--------------------+--------------+---------+------------+ | Fedora | 17.0 | Beefy Miracle | linux-3.3.4 | 1, 2 | B | +----------+----------+--------------------+--------------+---------+------------+ @@ -93,10 +94,10 @@ Notes for kernel client (kernel RBD or the Ceph file system). Upgrade to a recommended kernel. -- **3**: The installed version of ``glibc`` does not support the - ``syncfs(2)`` system call. Putting multiple ``ceph-osd`` daemons - using ``XFS`` or ``ext4`` on the same host will not perform as well as - they could. +- **3**: The default kernel or installed version of ``glibc`` does not + support the ``syncfs(2)`` system call. Putting multiple + ``ceph-osd`` daemons using ``XFS`` or ``ext4`` on the same host will + not perform as well as they could. Testing ------- From 413b5d0a865c3f4e245b3f8dc4354b92af8d8991 Mon Sep 17 00:00:00 2001 From: John Wilkins Date: Fri, 7 Dec 2012 14:34:10 -0800 Subject: [PATCH 10/23] doc: inverted the steps per doc feedback. Signed-off-by: John Wilkins --- doc/rados/deployment/mkcephfs.rst | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/doc/rados/deployment/mkcephfs.rst b/doc/rados/deployment/mkcephfs.rst index 7c89081d1c4..feca7388885 100644 --- a/doc/rados/deployment/mkcephfs.rst +++ b/doc/rados/deployment/mkcephfs.rst @@ -27,12 +27,6 @@ and use the default locations. :: Enter same passphrase again: Your identification has been saved in /root/.ssh/id_rsa. Your public key has been saved in /root/.ssh/id_rsa.pub. - -You may use RSA or DSA keys. Once you generate your keys, copy them to each -OSD host. For example:: - - ssh-copy-id root@myserver01 - ssh-copy-id root@myserver02 Modify your ``/root/.ssh/config`` file to login as ``root``, as follows:: @@ -43,6 +37,11 @@ Modify your ``/root/.ssh/config`` file to login as ``root``, as follows:: Hostname myserver02.fully-qualified-domain.com User root +You may use RSA or DSA keys. Once you generate your keys, copy them to each +OSD host. For example:: + + ssh-copy-id root@myserver01 + ssh-copy-id root@myserver02 Copy Configuration File to All Hosts ==================================== From 778bad12a04144ed26b7b6768da268b669ff6e5c Mon Sep 17 00:00:00 2001 From: John Wilkins Date: Fri, 7 Dec 2012 14:49:27 -0800 Subject: [PATCH 11/23] doc: Moved sudo to before ssh instead of before tee. Signed-off-by: John Wilkins --- doc/rados/deployment/mkcephfs.rst | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/doc/rados/deployment/mkcephfs.rst b/doc/rados/deployment/mkcephfs.rst index feca7388885..b33dbc7447c 100644 --- a/doc/rados/deployment/mkcephfs.rst +++ b/doc/rados/deployment/mkcephfs.rst @@ -54,9 +54,9 @@ if you are using ``mkcephfs`` to deploy Ceph. :: - ssh myserver01 sudo tee /etc/ceph/ceph.conf < /etc/ceph/ceph.conf - ssh myserver02 sudo tee /etc/ceph/ceph.conf < /etc/ceph/ceph.conf - ssh myserver03 sudo tee /etc/ceph/ceph.conf < /etc/ceph/ceph.conf + sudo ssh myserver01 tee /etc/ceph/ceph.conf < /etc/ceph/ceph.conf + sudo ssh myserver02 tee /etc/ceph/ceph.conf < /etc/ceph/ceph.conf + sudo ssh myserver03 tee /etc/ceph/ceph.conf < /etc/ceph/ceph.conf Create the Default Directories From e0761fbdb2868bb06c896dea176c980aa151773a Mon Sep 17 00:00:00 2001 From: John Wilkins Date: Fri, 7 Dec 2012 15:48:29 -0800 Subject: [PATCH 12/23] doc: Added sudo to the service start command. Signed-off-by: John Wilkins --- doc/rados/deployment/mkcephfs.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/rados/deployment/mkcephfs.rst b/doc/rados/deployment/mkcephfs.rst index b33dbc7447c..fc37c7b7922 100644 --- a/doc/rados/deployment/mkcephfs.rst +++ b/doc/rados/deployment/mkcephfs.rst @@ -114,7 +114,7 @@ root password. See `Authentication`_ when running with ``cephx`` enabled. When you start or stop your cluster, you will not have to use ``sudo`` or provide passwords. For example:: - service ceph -a start + sudo service ceph -a start See `Operating a Cluster`_ for details. From d4c6a22d798ff6de1bee31824144aa33bbf5e608 Mon Sep 17 00:00:00 2001 From: caleb miles Date: Mon, 22 Oct 2012 11:26:07 -0400 Subject: [PATCH 13/23] rgw: document admin api web interface. Signed-off-by: caleb miles --- doc/radosgw/admin/adminops.rst | 1507 +++++++++++++++++++++++++++++++- 1 file changed, 1504 insertions(+), 3 deletions(-) diff --git a/doc/radosgw/admin/adminops.rst b/doc/radosgw/admin/adminops.rst index 211a8e21259..b90c8a93f86 100644 --- a/doc/radosgw/admin/adminops.rst +++ b/doc/radosgw/admin/adminops.rst @@ -67,17 +67,17 @@ If successful, the response contains the requested information. ``usage`` -:Description: A container for the usage information +:Description: A container for the usage information. :Type: Container ``entries`` -:Description: A container for the usage entries information +:Description: A container for the usage entries information. :Type: Container ``user`` -:Description: A container for the user data information +:Description: A container for the user data information. :Type: Container ``owner`` @@ -192,3 +192,1504 @@ Request Parameters :Required: No +Get User Info +============= + +Get user information. + +Syntax +~~~~~~ + +:: + + GET /{admin}/user HTTP/1.1 + Host: {fqdn} + + +Request Parameters +~~~~~~~~~~~~~~~~~~ + +``uid`` + +:Description: The user for which the information is requested. +:Type: String +:Required: Yes + + +Response Entities +~~~~~~~~~~~~~~~~~ + +If successful, the response contains the user information. + +``user`` + +:Description: A container for the user data information. +:Type: Container + +``user_id`` + +:Description: The user id. +:Type: String + +``display_name`` + +:Description: Display name for the user. +:Type: String + +``suspended`` + +:Description: True if the user is suspended. +:Type: Boolean + +``max_buckets`` + +:Description: The maximum number of buckets to be owned by the user. +:Type: Integer + +``subusers`` + +:Description: Subusers associated with this user account. +:Type: Container + +``keys`` + +:Description: S3 keys associated with this user account. +:Type: Container + +``swift_keys`` + +:Description: Swift keys associated with this user account. +:Type: Container + +``caps`` + +:Description: User capabilities. +:Type: Container + + +Create User +=========== + +Create a new user. + +Syntax +~~~~~~ + +:: + + PUT /{admin}/user HTTP/1.1 + Host: {fqdn} + + + +Request Parameters +~~~~~~~~~~~~~~~~~~ + +``uid`` + +:Description: The user ID to be created. +:Type: String +:Example ``foo_user`` +:Required: Yes + +``display-name`` + +:Description: The display name of the user to be created. +:Type: String +:Example: ``foo user`` +:Required: Yes + + +``email`` + +:Description: The email address associated with the user. +:Type: String +:Example" ``foo@bar.com`` +:Required: No + +``key-type`` + +:Description: Key type to be generated, options are: swift, s3 (default) +:Type: String +:Example: ``s3`` +:Required: No + +``secret`` + +:Description: Specify secret key +:Type: String +:Example: ``0AbCDEFg1h2i34JklM5nop6QrSTUV+WxyzaBC7D8`` +:Required: No + + +Response Entities +~~~~~~~~~~~~~~~~~ + +If successful, the response contains the user information. + +``user`` + +:Description: A container for the user data information. +:Type: Container + +``user_id`` + +:Description: The user id. +:Type: String + +``display_name`` + +:Description: Display name for the user. +:Type: String + +``suspended`` + +:Description: True if the user is suspended. +:Type: Boolean + +``max_buckets`` + +:Description: The maximum number of buckets to be owned by the user. +:Type: Integer + +``subusers`` + +:Description: Subusers associated with this user account. +:Type: Container + +``keys`` + +:Description: S3 keys associated with this user account. +:Type: Container + +``swift_keys`` + +:Description: Swift keys associated with this user account. +:Type: Container + +``caps`` + +:Description: User capabilities. +:Type: Container + +Modify User +=========== + +Modify a user. + +Syntax +~~~~~~ + +:: + + POST /{admin}/user HTTP/1.1 + Host: {fqdn} + + +Request Parameters +~~~~~~~~~~~~~~~~~~ + +``uid`` + +:Description: The user ID to be modified. +:Type: String +:Example ``foo_user`` +:Required: No + +``display-name`` + +:Description: The display name of the user to be modified. +:Type: String +:Example: ``foo user`` +:Required: No + +``email`` + +:Description: The email address to be associated with the user. +:Type: String +:Example" ``foo@bar.com`` +:Required: No + +``gen-secret`` + +:Description: Generate a new secret key. +:Type: Boolean +:Example: True +:Required: No + +``key-type`` + +:Description: Key type to be generated, options are: swift, s3 (default) +:Type: String +:Example: ``s3`` +:Required: No + + +Response Entities +~~~~~~~~~~~~~~~~~ + +If successful, the response contains the user information. + +``user`` + +:Description: A container for the user data information. +:Type: Container + +``user_id`` + +:Description: The user id. +:Type: String + +``display_name`` + +:Description: Display name for the user. +:Type: String + +``suspended`` + +:Description: True if the user is suspended. +:Type: Boolean + +``max_buckets`` + +:Description: The maximum number of buckets to be owned by the user. +:Type: Integer + +``subusers`` + +:Description: Subusers associated with this user account. +:Type: Container + +``keys`` + +:Description: S3 keys associated with this user account. +:Type: Container + +``swift_keys`` + +:Description: Swift keys associated with this user account. +:Type: Container + +``caps`` + +:Description: User capabilities. +:Type: Container + +Remove User +=========== + +Remove an existing user. + +Syntax +~~~~~~ + +:: + + DELETE /{admin}/user HTTP/1.1 + Host: {fqdn} + + +Request Parameters +~~~~~~~~~~~~~~~~~~ + +``uid`` + +:Description: The user ID to be removed. +:Type: String +:Example ``foo_user`` +:Required: Yes. + +``purge-data`` + +:Description: When specified the buckets and objects belonging + to the user will also be removed. +:Type: Boolean +:Example: True +:Required: No + +Response Entities +~~~~~~~~~~~~~~~~~ + +TBD. + +Create Subuser +============== + +Create a new subuser (primarily useful for clients using the Swift API) + +Syntax +~~~~~~ + +:: + + PUT /{admin}/user/?subuser + Host {fqdn} + + +Request Parameters +~~~~~~~~~~~~~~~~~~ + +``uid`` + +:Description: The user ID under which a subuser is to be created. +:Type: String +:Example ``foo_user`` +:Required: Yes + + +``subuser`` + +:Description: The subuser ID to be created +:Type: String +:Example: ``sub_foo`` +:Required: Yes + +``gen-secret`` + +:Description: Generate a secret key for the subuser. +:Type: Boolean +:Example: True +:Required: No + +``key-type`` + +:Description: Key type to be generated, options are: swift, s3 (default) +:Type: String +:Example: ``swift`` +:Required: No + +``access`` + +:Description: Set access permissions for sub-user, should be one + of read, write, readwrite, full +:Type: String +:Example: ``read`` +:Required: No + + +Response Entities +~~~~~~~~~~~~~~~~~ + +If successful, the response contains the user information. + +``user`` + +:Description: A container for the user data information. +:Type: Container + +``user_id`` + +:Description: The user id. +:Type: String + +``display_name`` + +:Description: Display name for the user. +:Type: String + +``suspended`` + +:Description: True if the user is suspended. +:Type: Boolean + +``max_buckets`` + +:Description: The maximum number of buckets to be owned by the user. +:Type: Integer + +``subusers`` + +:Description: Subusers associated with this user account. +:Type: Container + +``keys`` + +:Description: S3 keys associated with this user account. +:Type: Container + +``swift_keys`` + +:Description: Swift keys associated with this user account. +:Type: Container + +``caps`` + +:Description: User capabilities. +:Type: Container + +Modify Subuser +============== + +Modify an existing subuser + +Syntax +~~~~~~ + +:: + + POST /{admin}/user/?subuser + Host {fqdn} + + +Request Parameters +~~~~~~~~~~~~~~~~~~ + +``uid`` + +:Description: The user ID under which the subuser is to be modified. +:Type: String +:Example ``foo_user`` +:Required: Yes + + +``subuser`` + +:Description: The subuser ID to be modified. +:Type: String +:Example: ``sub_foo`` +:Required: Yes + +``gen-secret`` + +:Description: Generate a new secret key for the subuser. +:Type: Boolean +:Example: True +:Required: No + +``key-type`` + +:Description: Key type to be generated, options are: swift, s3 (default) +:Type: String +:Example: ``s3`` +:Required: No + +``access`` + +:Description: Set access permissions for sub-user, should be one + of read, write, readwrite, full +:Type: String +:Example: ``read`` +:Required: No + + +Response Entities +~~~~~~~~~~~~~~~~~ + +If successful, the response contains the user information. + +``user`` + +:Description: A container for the user data information. +:Type: Container + +``user_id`` + +:Description: The user id. +:Type: String + +``display_name`` + +:Description: Display name for the user. +:Type: String + +``suspended`` + +:Description: True if the user is suspended. +:Type: Boolean + +``max_buckets`` + +:Description: The maximum number of buckets to be owned by the user. +:Type: Integer + +``subusers`` + +:Description: Subusers associated with this user account. +:Type: Container + +``keys`` + +:Description: S3 keys associated with this user account. +:Type: Container + +``swift_keys`` + +:Description: Swift keys associated with this user account. +:Type: Container + +``caps`` + +:Description: User capabilities. +:Type: Container + +Remove Subuser +============== + +Remove an existing subuser + +Syntax +~~~~~~ + +:: + + DELETE /{admin}/subuser + Host {fqdn} + + +Request Parameters +~~~~~~~~~~~~~~~~~~ + +``uid`` + +:Description: The user ID under which the subuser is to be removed. +:Type: String +:Example ``foo_user`` +:Required: Yes + + +``subuser`` + +:Description: The subuser ID to be removed. +:Type: String +:Example: ``sub_foo`` +:Required: Yes + +``purge-keys`` + +:Description: Remove keys belonging to the subuser. +:Type: Boolean +:Example: True +:Required: No + +``purge-data`` +:Description: Remove data belonging to the subuser. +:Type: Boolean +:Example: True +:Required: No + +Response Entities +~~~~~~~~~~~~~~~~~ + +If successful, the response contains the user information. + +``user`` + +:Description: A container for the user data information. +:Type: Container + +``user_id`` + +:Description: The user id. +:Type: String + +``display_name`` + +:Description: Display name for the user. +:Type: String + +``suspended`` + +:Description: True if the user is suspended. +:Type: Boolean + +``max_buckets`` + +:Description: The maximum number of buckets to be owned by the user. +:Type: Integer + +``subusers`` + +:Description: Subusers associated with this user account. +:Type: Container + +``keys`` + +:Description: S3 keys associated with this user account. +:Type: Container + +``swift_keys`` + +:Description: Swift keys associated with this user account. +:Type: Container + +``caps`` + +:Description: User capabilities. +:Type: Container + +Create Key +========== + +Create a new key. + +Syntax +~~~~~~ + +:: + + PUT /{admin}/key + Host {fqdn} + + +Request Parameters +~~~~~~~~~~~~~~~~~~ + +``uid`` + +:Description: The user ID to receive the new key. +:Type: String +:Example ``foo_user`` +:Required: Yes + +``subuser`` + +:Description: The subuser ID to receive the new key. +:Type: String +:Example: ``sub_foo`` +:Required: No + +``key-type`` + +:Description: Key type to be generated, options are: swift, s3 (default). +:Type: String +:Example: ``s3`` +:Required: No + +``secret`` + +:Description: Specify the secret key +:Type: String +:Example: ``0ab/CdeFGhij1klmnopqRSTUv1WxyZabcDEFgHij`` +:Required: No + +Remove Key +========== + +Remove an existing key. + +Syntax +~~~~~~ + +:: + + DELETE /{admin}/key + Host {fqdn} + + +Request Parameters +~~~~~~~~~~~~~~~~~~ + +``access-key`` + +:Description: The S3 access key belonging to the S3 keypair to remove. +:Type: String +:Example: ``AB01C2D3EF45G6H7IJ8K`` +:Required: Yes + +``uid`` + +:Description: The user to remove the key from. +:Type: String +:Example ``foo_user`` +:Required: No + +``subuser`` + +:Description: The subuser to remove the key from. +:Type: String +:Example: ``sub_foo`` +:Required: No + +``key-type`` + +:Description: Key type to be removed, options are: swift, s3. + NOTE: Required to remove swift key. +:Type: String +:Example: ``swift`` +:Required: No + + +Get Bucket +========== + +Get information for an existing bucket, if no request parameters are +included lists buckets. + +Syntax +~~~~~~ + +:: + + GET /{admin}/bucket + Host {fqdn} + + +Request Parameters +~~~~~~~~~~~~~~~~~~ + +``bucket`` + +:Description: The bucket to return info on. +:Type: String +:Example: ``foo_bucket`` +:Required: Yes + + +``list`` + +:Description: Return list of buckets. +:Type: Boolean +:Example: True +:Required: No + +``stats`` + +:Description: Return bucket statistics. +:Type: Boolean +:Example: True +:Required: No + +``check`` + +:Description: Check bucket index. +:Type: Boolean +:Example: False +:Required: No + +``fix`` + +:Description: Also fix the bucket index when checking. +:Type: Boolean +:Example: False +:Required: No + +Response Entities +~~~~~~~~~~~~~~~~~ + +If successful the request returns a buckets container containing +the desired bucket information. + +``buckets`` + +:Description: Contains a list of one or more bucket containers. +:Type: Container + +``stats`` + +:Description: Per bucket information. +:Type: Container + +``bucket`` + +:Description: The name of the bucket. +:Type: String + +``pool`` + +:Desciption: The pool the bucket is stored in. +:Type: String + +``id`` + +:Description: The unique bucket id. +:Type: String + +``marker`` + +:Description: +:Type: String + +``owner`` + +:Description: The user id of the bucket owner. +:Type: String + +``usage`` + +:Description: Storage usage information. +:Type: Container + +Check Bucket Index +================== + +Check the index of an existing bucket. + +Syntax +~~~~~~ + +:: + + GET /{admin}/bucket/?index + Host {fqdn} + + +Request Parameters +~~~~~~~~~~~~~~~~~~ + +``bucket`` + +:Description: The bucket to return info on. +:Type: String +:Example: ``foo_bucket`` +:Required: Yes + +``fix`` + +:Description: Also fix the bucket index when checking. +:Type: Boolean +:Example: False +:Required: No + +Response Entities +~~~~~~~~~~~~~~~~~ + +TBD + +Remove Bucket +============= + +Delete an existing bucket. + +Syntax +~~~~~~ + +:: + + DELETE /{admin}/bucket + Host {fqdn} + + + +Request Parameters +~~~~~~~~~~~~~~~~~~ + +``bucket`` + +:Description: The bucket to remove. +:Type: String +:Example: ``foo_bucket`` +:Required: Yes + +``delete`` + +:Description: Parameter specifying the bucket is to be removed. +:Type: Boolean +:Example: True +:Required: Yes + +``purge-objects`` + +:Description: Remove a buckets objects before deletion. +:Type: Boolean +:Example: True +:Required: No + + +Unlink Bucket +============= + +Unlink a bucket from a specified user. + +Syntax +~~~~~~ + +:: + + DELETE /{admin}/bucket + Host {fqdn} + + +Request Parameters +~~~~~~~~~~~~~~~~~~ + +``bucket`` + +:Description: The bucket to unlink. +:Type: String +:Example: ``foo_bucket`` +:Required: Yes + +``unlink`` + +:Description: Parameter specifying that the bucket is to + be unlinked, not removed. +:Type: Boolean +:Example: True +:Required: Yes + +``uid`` + +:Description: The user ID to unlink the bucket from. +:Type: String +:Example ``foo_user`` +:Required: Yes + +Response Entities +~~~~~~~~~~~~~~~~~ + +TBD. + +Link Bucket +=========== + +Link a bucket to a specified user. + +Syntax +~~~~~~ + +:: + + PUT /{admin}/bucket + Host {fqdn} + + +Request Parameters +~~~~~~~~~~~~~~~~~~ + +``bucket`` + +:Description: The bucket to unlink. +:Type: String +:Example: ``foo_bucket`` +:Required: Yes + +``uid`` + +:Description: The user ID to link the bucket to. +:Type: String +:Example ``foo_user`` +:Required: Yes + +Response Entities +~~~~~~~~~~~~~~~~~ + +TBD. + +Get Object +========== + +Get an existing object. + +Syntax +~~~~~~ + +:: + + GET /{admin}/object + Host {fqdn} + +Request Parameters +~~~~~~~~~~~~~~~~~~ + +``bucket`` + +:Description: The bucket containing the object to be retrieved. +:Type: String +:Example: ``foo_bucket`` +:Required: Yes + +``object`` + +:Description: The object to be retrieved. +:Type: String +:Example: ``foo.txt`` +:Required: Yes + +Response Entities +~~~~~~~~~~~~~~~~~ + +If successful, returns the desired object. + +``object`` + +:Description: The desired object. +:Type: Object + +Remove Object +============= + +Remove an existing object. + +Syntax +~~~~~~ + +:: + + DELETE /{admin}/object + Host {fqdn} + +Request Parameters +~~~~~~~~~~~~~~~~~~ + +``bucket`` + +:Description: The bucket containing the object to be removed. +:Type: String +:Example: ``foo_bucket`` +:Required: Yes + +``object`` + +:Description: The object to remove. +:Type: String +:Example: ``foo.txt`` +:Required: Yes + +Response Entities +~~~~~~~~~~~~~~~~~ + +TBD. + +Get Cluster Info +================ + +Get cluster information. + +Syntax +~~~~~~ + +:: + + GET /{admin}/cluster + Host {fqdn} + + +Response Entities +~~~~~~~~~~~~~~~~~ + +If successful, returns cluster pool configuration. + +``cluster`` + +:Description: Contains current cluster pool configuration. +:Type: Container + + +Add Placement Pool +================== + +Make a pool available for data placement. + +Syntax +~~~~~~ + +:: + + PUT /{admin}/pool + Host {fqdn} + + +Request Parameters +~~~~~~~~~~~~~~~~~~ + +``pool`` + +:Description: The pool to be made available for data placement. +:Type: String +:Example: ``foo_pool`` +:Required: Yes + +``create`` + +:Description: Creates the data pool if it does not exist. +:Type: Boolean +:Example: False +:Required: No + +Response Entities +~~~~~~~~~~~~~~~~~ + +TBD. + +Remove Placement Pool +===================== + +Make a pool unavailable for data placement. + +Syntax +~~~~~~ + +:: + + DELETE /{admin}/pool + Host {fqdn} + + +Request Parameters +~~~~~~~~~~~~~~~~~~ + +``pool`` + +:Description: The existing pool to be made available for data placement. +:Type: String +:Example: ``foo_pool`` +:Required: Yes + +``destroy`` + +:Description: Destroys the pool after removing it from the active set. +:Type: Boolean +:Example: False +:Required: No + +Response Entities +~~~~~~~~~~~~~~~~~ + +TBD. + +List Available Data Placement Pools +=================================== + +List current pools available for data placement. + +Syntax +~~~~~~ + +:: + + GET /{admin}/pool + Host {fqdn} + + +Response Entities +~~~~~~~~~~~~~~~~~ + +If successful, returns a list of pools available for data placement. + +``pools`` + +:Description: Contains currently available pools for data placement. +:Type: Container + +Get Bucket or Object Policy +=========================== + +Read the policy of an object or bucket. + +Syntax +~~~~~~ + +:: + + GET /{admin}/policy + Host {fqdn} + + +Request Parameters +~~~~~~~~~~~~~~~~~~ + +``bucket`` + +:Description: The bucket to read the policy from. +:Type: String +:Example: ``foo_bucket`` +:Required: No + +``object`` + +:Description: The object to read the policy from. +:Type: String +:Example: ``foo.txt`` +:Required: No + +Response Entities +~~~~~~~~~~~~~~~~~ + +If successful, returns the object or bucket policy + +``policy`` + +:Description: Access control policy. +:Type: Container + +Add A User Capability +===================== + +Add an administrative capability to a specified user. + +Syntax +~~~~~~ + +:: + + PUT /{admin}/caps + Host {fqdn} + +Request Parameters +~~~~~~~~~~~~~~~~~~ + +``uid`` + +:Description: The user ID to add an administrative capability to. +:Type: String +:Example ``foo_user`` +:Required: Yes + +``caps`` + +:Description: The administrative capability to add to the user. +:Type: String +:Example: ``usage=read, write`` +:Required: Yes + +Response Entities +~~~~~~~~~~~~~~~~~ + +If successful, the response contains the user information. + +``user`` + +:Description: A container for the user data information. +:Type: Container + +``user_id`` + +:Description: The user id. +:Type: String + +``display_name`` + +:Description: Display name for the user. +:Type: String + +``suspended`` + +:Description: True if the user is suspended. +:Type: Boolean + +``max_buckets`` + +:Description: The maximum number of buckets to be owned by the user. +:Type: Integer + +``subusers`` + +:Description: Subusers associated with this user account. +:Type: Container + +``keys`` + +:Description: S3 keys associated with this user account. +:Type: Container + +``swift_keys`` + +:Description: Swift keys associated with this user account. +:Type: Container + +``caps`` + +:Description: User capabilities. +:Type: Container + +Remove A User Capability +======================== + +Remove an administrative capability from a specified user. + +Syntax +~~~~~~ + +:: + + DELETE /{admin}/caps + Host {fqdn} + +Request Parameters +~~~~~~~~~~~~~~~~~~ + +``uid`` + +:Description: The user ID to remove an administrative capability from. +:Type: String +:Example ``foo_user`` +:Required: Yes + +``caps`` + +:Description: The administrative capabilities to remove from the user. +:Type: String +:Example: ``usage=read, write`` +:Required: Yes + +Response Entities +~~~~~~~~~~~~~~~~~ + +If successful, the response contains the user information. + +``user`` + +:Description: A container for the user data information. +:Type: Container + +``user_id`` + +:Description: The user id. +:Type: String + +``display_name`` + +:Description: Display name for the user. +:Type: String + +``suspended`` + +:Description: True if the user is suspended. +:Type: Boolean + +``max_buckets`` + +:Description: The maximum number of buckets to be owned by the user. +:Type: Integer + +``subusers`` + +:Description: Subusers associated with this user account. +:Type: Container + +``keys`` + +:Description: S3 keys associated with this user account. +:Type: Container + +``swift_keys`` + +:Description: Swift keys associated with this user account. +:Type: Container + +``caps`` + +:Description: User capabilities. +:Type: Container + + +List Expired Garbage Collection Items +===================================== + +List objects scheduled for garbage collection. + +Syntax +~~~~~~ + +:: + + GET /{admin}/garbage + Host {fqdn} + +Request Parameters +~~~~~~~~~~~~~~~~~~ + +None. + +Response Entities +~~~~~~~~~~~~~~~~~ + +If expired garbage collection items exist, a list of such objects +will be returned. + +``garbage`` + +:Description: Expired garbage collection items. +:Type: Container + +``object`` + +:Description: A container garbage collection object information. +:Type: Container + +``name`` + +:Description: The name of the object. +:Type: String + +``expired`` + +:Description: The date at which the object expired. +:Type: String + +Manually Processes Garbage Collection Items +=========================================== + +List objects scheduled for garbage collection. + +Syntax +~~~~~~ + +:: + + DELETE /{admin}/garbage + Host {fqdn} + +Request Parameters +~~~~~~~~~~~~~~~~~~ + +None. + +Response Entities +~~~~~~~~~~~~~~~~~ + +If expired garbage collection items exist, a list of removed objects +will be returned. + +``garbage`` + +:Description: Expired garbage collection items. +:Type: Container + +``object`` + +:Description: A container garbage collection object information. +:Type: Container + +``name`` + +:Description: The name of the object. +:Type: String + +``expired`` + +:Description: The date at which the object expired. +:Type: String + +Show Log Objects +================ + +Show log objects + +Syntax +~~~~~~ + +:: + + GET /{admin}/log + Host {fqdn} + +Request Parameters +~~~~~~~~~~~~~~~~~~ + +``object`` + +:Description: The log object to return. +:Type: String: +:Example: ``2012-10-11-09-4165.2-foo_bucket`` +:Required: No + +Response Entities +~~~~~~~~~~~~~~~~~ + +If no object is specified, returns the full list of log objects. + +``log-objects`` + +:Description: A list of log objects. +:Type: Container + +``object`` + +:Description: The name of the log object. +:Type: String + +``log`` + +:Description: The contents of the log object. +:Type: Container From 47c81a3baac75b967a97609302b501ede6d9ef87 Mon Sep 17 00:00:00 2001 From: Yehuda Sadeh Date: Mon, 10 Dec 2012 10:16:02 -0800 Subject: [PATCH 14/23] Makefile.am: add missing flags to some tests targets adding CRYPTO_CXXFLAGS to some targets. This is required when building --with-nss. Signed-off-by: Yehuda Sadeh --- src/Makefile.am | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/Makefile.am b/src/Makefile.am index e6dc5a3f434..aa4f00bfb48 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -229,10 +229,12 @@ bin_DEBUGPROGRAMS += smalliobench smalliobenchfs_SOURCES = test/bench/small_io_bench_fs.cc test/bench/filestore_backend.cc test/bench/detailed_stat_collector.cc test/bench/bencher.cc smalliobenchfs_LDADD = librados.la -lboost_program_options $(LIBOS_LDA) $(LIBGLOBAL_LDA) +smalliobenchfs_CXXFLAGS = ${CRYPTO_CXXFLAGS} ${AM_CXXFLAGS} bin_DEBUGPROGRAMS += smalliobenchfs smalliobenchdumb_SOURCES = test/bench/small_io_bench_dumb.cc test/bench/dumb_backend.cc test/bench/detailed_stat_collector.cc test/bench/bencher.cc smalliobenchdumb_LDADD = librados.la -lboost_program_options $(LIBOS_LDA) $(LIBGLOBAL_LDA) +smalliobenchdumb_CXXFLAGS = ${CRYPTO_CXXFLAGS} ${AM_CXXFLAGS} bin_DEBUGPROGRAMS += smalliobenchdumb tpbench_SOURCES = test/bench/tp_bench.cc test/bench/detailed_stat_collector.cc @@ -863,6 +865,7 @@ test_mon_workloadgen_SOURCES = \ osdc/Objecter.cc \ osdc/Striper.cc test_mon_workloadgen_LDADD = $(LIBOS_LDA) $(LIBGLOBAL_LDA) +test_mon_workloadgen_CXXFLAGS = ${CRYPTO_CXXFLAGS} ${AM_CXXFLAGS} bin_DEBUGPROGRAMS += test_mon_workloadgen test_rados_api_io_SOURCES = test/librados/io.cc test/librados/test.cc From 3709519519f747345d254eff0304cd56f845e211 Mon Sep 17 00:00:00 2001 From: John Wilkins Date: Mon, 10 Dec 2012 10:24:32 -0800 Subject: [PATCH 15/23] doc: Fixed typo. Signed-off-by: John Wilkins --- doc/radosgw/config.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/radosgw/config.rst b/doc/radosgw/config.rst index 32ce66d0426..ca8cd30237e 100644 --- a/doc/radosgw/config.rst +++ b/doc/radosgw/config.rst @@ -113,7 +113,7 @@ See ` Directive`_ for additional details. .. _ Directive: http://httpd.apache.org/docs/2.2/mod/core.html#ifmodule Finally, you should configure Apache to allow encoded slashes, provide paths for -log files and to trun off server signatures. :: +log files and to turn off server signatures. :: ... From f4be3c8d98568379de3454cd5111144bda49a9dc Mon Sep 17 00:00:00 2001 From: John Wilkins Date: Mon, 10 Dec 2012 10:51:24 -0800 Subject: [PATCH 16/23] doc: Added sudo to ceph -k command. Signed-off-by: John Wilkins --- doc/radosgw/config.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/radosgw/config.rst b/doc/radosgw/config.rst index ca8cd30237e..12cca0168a9 100644 --- a/doc/radosgw/config.rst +++ b/doc/radosgw/config.rst @@ -171,7 +171,7 @@ Add to Ceph Keyring Entries Once you have created a keyring and key for RADOS GW, add it as an entry in the Ceph keyring. For example:: - ceph -k /etc/ceph/ceph.keyring auth add client.radosgw.gateway -i /etc/ceph/keyring.radosgw.gateway + sudo ceph -k /etc/ceph/ceph.keyring auth add client.radosgw.gateway -i /etc/ceph/keyring.radosgw.gateway Restart Services and Start the RADOS Gateway From 2e7cba7bca7f09d9f8dbde74eec24f25b44a85f7 Mon Sep 17 00:00:00 2001 From: John Wilkins Date: Mon, 10 Dec 2012 14:14:09 -0800 Subject: [PATCH 17/23] doc: fixed indent in python example. Signed-off-by: John Wilkins --- doc/radosgw/s3/python.rst | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/doc/radosgw/s3/python.rst b/doc/radosgw/s3/python.rst index 35261694538..c5a8432485a 100644 --- a/doc/radosgw/s3/python.rst +++ b/doc/radosgw/s3/python.rst @@ -32,9 +32,9 @@ This also prints out the bucket name and creation date of each bucket. .. code-block:: python for bucket in conn.get_all_buckets(): - print "{name}\t{created}".format( - name = bucket.name, - created = bucket.creation_date, + print "{name}\t{created}".format( + name = bucket.name, + created = bucket.creation_date, ) The output will look something like this:: From cf28e7872eb6081d366bcf12e09cce43a178e5b7 Mon Sep 17 00:00:00 2001 From: Yehuda Sadeh Date: Tue, 11 Dec 2012 16:09:42 -0800 Subject: [PATCH 18/23] docs: add rgw POST object as supported feature Signed-off-by: Yehuda Sadeh --- doc/radosgw/s3.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/radosgw/s3.rst b/doc/radosgw/s3.rst index 73b3a5eb54b..25e9d977d9a 100644 --- a/doc/radosgw/s3.rst +++ b/doc/radosgw/s3.rst @@ -66,7 +66,7 @@ The following table describes the support status for current Amazon S3 functiona +---------------------------------+-----------------+----------------------------------------+ | **Get Object Info (HEAD)** | Supported | | +---------------------------------+-----------------+----------------------------------------+ -| **POST Object** | Not Supported | | +| **POST Object** | Supported | | +---------------------------------+-----------------+----------------------------------------+ | **Copy Object** | Supported | | +---------------------------------+-----------------+----------------------------------------+ From 6a8a58dc4b71df6d291d67ddad0b5667289d6d3b Mon Sep 17 00:00:00 2001 From: Yehuda Sadeh Date: Tue, 11 Dec 2012 16:44:46 -0800 Subject: [PATCH 19/23] doc: document swift compatibility Add a table that specifies swift features compatibility Signed-off-by: Yehuda Sadeh --- doc/radosgw/index.rst | 2 +- doc/radosgw/swift.rst | 74 ++++++++++++++++++++++ doc/radosgw/swift/{index.rst => swift.rst} | 0 3 files changed, 75 insertions(+), 1 deletion(-) create mode 100644 doc/radosgw/swift.rst rename doc/radosgw/swift/{index.rst => swift.rst} (100%) diff --git a/doc/radosgw/index.rst b/doc/radosgw/index.rst index d9c2e3579bd..7f76c588c2d 100644 --- a/doc/radosgw/index.rst +++ b/doc/radosgw/index.rst @@ -40,7 +40,7 @@ one API and retrieve it with the other. Config Reference Purging Temp Data S3 API - Swift API + Swift API Admin API troubleshooting Manpage radosgw <../../man/8/radosgw> diff --git a/doc/radosgw/swift.rst b/doc/radosgw/swift.rst new file mode 100644 index 00000000000..d3fbcd1ca03 --- /dev/null +++ b/doc/radosgw/swift.rst @@ -0,0 +1,74 @@ +=============== +RADOS Swift API +=============== + +Ceph supports a RESTful API that is compatible with the the basic data access model of the Swift API. + +API +--- + +.. toctree:: + :maxdepth: 1 + + Common + Authentication + Service Ops + Container Ops + Object Ops + Tutorial + Java + Python + Ruby + + +Features Support +---------------- + +The following table describes the support status for current Swift functional features: + ++---------------------------------+-----------------+----------------------------------------+ +| Feature | Status | Remarks | ++=================================+=================+========================================+ +| **Authentication** | Supported | | ++---------------------------------+-----------------+----------------------------------------+ +| **Get Account Metadata** | Supported | No custom metadata | ++---------------------------------+-----------------+----------------------------------------+ +| **Swift ACLs** | Supported | Supports a subset of Swift ACLs | ++---------------------------------+-----------------+----------------------------------------+ +| **List Containers** | Supported | | ++---------------------------------+-----------------+----------------------------------------+ +| **Delete Container** | Supported | | ++---------------------------------+-----------------+----------------------------------------+ +| **Create Container** | Supported | | ++---------------------------------+-----------------+----------------------------------------+ +| **Get Container Metadata** | Supported | | ++---------------------------------+-----------------+----------------------------------------+ +| **Update Container Metadata** | Supported | | ++---------------------------------+-----------------+----------------------------------------+ +| **Delete Container Metadata** | Supported | | ++---------------------------------+-----------------+----------------------------------------+ +| **List Objects** | Supported | | ++---------------------------------+-----------------+----------------------------------------+ +| **Static Website** | Not Supported | | ++---------------------------------+-----------------+----------------------------------------+ +| **Create Object** | Supported | | ++---------------------------------+-----------------+----------------------------------------+ +| **Create Large Object** | Supported | | ++---------------------------------+-----------------+----------------------------------------+ +| **Delete Object** | Supported | | ++---------------------------------+-----------------+----------------------------------------+ +| **Get Object** | Supported | | ++---------------------------------+-----------------+----------------------------------------+ +| **Copy Object** | Supported | | ++---------------------------------+-----------------+----------------------------------------+ +| **Get Object Metadata** | Supported | | ++---------------------------------+-----------------+----------------------------------------+ +| **Update Object Metadata** | Supported | | ++---------------------------------+-----------------+----------------------------------------+ +| **Expiring Objects** | Not Supported | | ++---------------------------------+-----------------+----------------------------------------+ +| **Object Versioning** | Not Supported | | ++---------------------------------+-----------------+----------------------------------------+ +| **CORS** | Not Supported | | ++---------------------------------+-----------------+----------------------------------------+ + diff --git a/doc/radosgw/swift/index.rst b/doc/radosgw/swift/swift.rst similarity index 100% rename from doc/radosgw/swift/index.rst rename to doc/radosgw/swift/swift.rst From 8e6a53531b00153eccea023e017162179973d3a1 Mon Sep 17 00:00:00 2001 From: Josh Durgin Date: Tue, 11 Dec 2012 17:18:14 -0800 Subject: [PATCH 20/23] qa: exclude some more xfstests These worked on a newer kernel, but I forgot I had not updated it for the final image. Signed-off-by: Josh Durgin --- qa/run_xfstests_qemu.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/qa/run_xfstests_qemu.sh b/qa/run_xfstests_qemu.sh index 0b5b86de090..d2df8a563ba 100644 --- a/qa/run_xfstests_qemu.sh +++ b/qa/run_xfstests_qemu.sh @@ -3,5 +3,7 @@ mkdir /tmp/cephtest wget https://raw.github.com/ceph/ceph/master/qa/run_xfstests.sh chmod +x run_xfstests.sh -# tests excluded require extra packages for advanced acl and quota support -./run_xfstests.sh -c 1 -f xfs -t /dev/vdb -s /dev/vdc 1-26 28-49 51-63 65-83 85-233 235-291 +# tests excluded fail in the current testing vm regardless of whether +# rbd is used + +./run_xfstests.sh -c 1 -f xfs -t /dev/vdb -s /dev/vdc 1-17 19-26 28-49 51-61 63 66-79 83 85-105 108-110 112-135 137-170 172-204 206-217 220-227 230-231 233 235-241 243-249 251-262 264-278 281-286 288-289 From 5f55b38827e9dec04604722785abcad7e39c1187 Mon Sep 17 00:00:00 2001 From: John Wilkins Date: Wed, 12 Dec 2012 14:38:22 -0800 Subject: [PATCH 21/23] doc: Updated per comments in the mailing list. Signed-off-by: John Wilkins --- doc/rados/operations/add-or-rm-osds.rst | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/doc/rados/operations/add-or-rm-osds.rst b/doc/rados/operations/add-or-rm-osds.rst index fa377b3c58f..f60ddc6970f 100644 --- a/doc/rados/operations/add-or-rm-osds.rst +++ b/doc/rados/operations/add-or-rm-osds.rst @@ -107,10 +107,9 @@ hard disks than older hosts in the cluster (i.e., they may have greater weight). ssh {new-osd} sudo tee /etc/ceph/ceph.conf < /etc/ceph/ceph.conf -#. Create the OSD. :: +#. Create the OSD. If no UUID is given, it will be set automatically when the OSD starts up. :: - ceph osd create {osd-num} - ceph osd create 123 #for example + ceph osd create [{uuid}] #. Initialize the OSD data directory. :: From 4605fddcf66258ec65a0d937143812b98246ff46 Mon Sep 17 00:00:00 2001 From: Sam Lang Date: Wed, 12 Dec 2012 14:28:12 -1000 Subject: [PATCH 22/23] filestore: Don't keep checking for syncfs if found Valgrind outputs a warning for unrecognized system calls, and does so for the syscall(__SYS_syncfs,...) and syscall(__NR_syncfs, ...) calls. This patch avoids making those calls (and the warning, when run in valgrind) if the syncfs libc call is available. INFO:teuthology.task.ceph.osd.1.err:--10568-- WARNING: unhandled syscall: 306 INFO:teuthology.task.ceph.osd.1.err:--10568-- You may be able to write your own handler. INFO:teuthology.task.ceph.osd.1.err:--10568-- Read the file README_MISSING_SYSCALL_OR_IOCTL. INFO:teuthology.task.ceph.osd.1.err:--10568-- Nevertheless we consider this a bug. Please report INFO:teuthology.task.ceph.osd.1.err:--10568-- it at http://valgrind.org/support/bug_reports.html. Signed-off-by: Sam Lang --- src/os/FileStore.cc | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/os/FileStore.cc b/src/os/FileStore.cc index 8cb8720738e..99cea7f22da 100644 --- a/src/os/FileStore.cc +++ b/src/os/FileStore.cc @@ -1227,16 +1227,14 @@ int FileStore::_detect_fs() } else { dout(0) << "mount syncfs(2) syscall supported by glibc BUT NOT the kernel" << dendl; } -#endif -#ifdef SYS_syncfs +#elif defined(SYS_syncfs) if (syscall(SYS_syncfs, fd) == 0) { dout(0) << "mount syscall(SYS_syncfs, fd) fully supported" << dendl; have_syncfs = true; } else { dout(0) << "mount syscall(SYS_syncfs, fd) supported by libc BUT NOT the kernel" << dendl; } -#endif -#ifdef __NR_syncfs +#elif defined(__NR_syncfs) if (syscall(__NR_syncfs, fd) == 0) { dout(0) << "mount syscall(__NR_syncfs, fd) fully supported" << dendl; have_syncfs = true; From f16e571757ef2ce860ed955936257569edb9f9fb Mon Sep 17 00:00:00 2001 From: Sam Lang Date: Thu, 13 Dec 2012 17:23:27 -1000 Subject: [PATCH 23/23] client: Add config option to inject sleep for tick Testing the tick delay with a fork/suspend is causing corruption in the lockdep code. This approach uses a config option to sleep the tick thread for a number of seconds, avoiding the entire fork/suspend mess. Signed-off-by: Sam Lang --- src/client/Client.cc | 6 +++++ src/common/config_opts.h | 1 + src/test/libcephfs/caps.cc | 50 ++------------------------------------ 3 files changed, 9 insertions(+), 48 deletions(-) diff --git a/src/client/Client.cc b/src/client/Client.cc index 0ca174b4536..d876454f0f4 100644 --- a/src/client/Client.cc +++ b/src/client/Client.cc @@ -3656,6 +3656,12 @@ void Client::flush_cap_releases() void Client::tick() { + if (cct->_conf->client_debug_inject_tick_delay > 0) { + sleep(cct->_conf->client_debug_inject_tick_delay); + assert(0 == cct->_conf->set_val("client_debug_inject_tick_delay", "0")); + cct->_conf->apply_changes(NULL); + } + ldout(cct, 21) << "tick" << dendl; tick_event = new C_C_Tick(this); timer.add_event_after(cct->_conf->client_tick_interval, tick_event); diff --git a/src/common/config_opts.h b/src/common/config_opts.h index b9e317b82dc..bd5b733bd64 100644 --- a/src/common/config_opts.h +++ b/src/common/config_opts.h @@ -183,6 +183,7 @@ OPTION(client_oc_target_dirty, OPT_INT, 1024*1024* 8) // target dirty (keep this OPTION(client_oc_max_dirty_age, OPT_DOUBLE, 5.0) // max age in cache before writeback OPTION(client_oc_max_objects, OPT_INT, 1000) // max objects in cache OPTION(client_debug_force_sync_read, OPT_BOOL, false) // always read synchronously (go to osds) +OPTION(client_debug_inject_tick_delay, OPT_INT, 0) // delay the client tick for a number of seconds // note: the max amount of "in flight" dirty data is roughly (max - target) OPTION(fuse_use_invalidate_cb, OPT_BOOL, false) // use fuse 2.8+ invalidate callback to keep page cache consistent OPTION(fuse_big_writes, OPT_BOOL, true) diff --git a/src/test/libcephfs/caps.cc b/src/test/libcephfs/caps.cc index 5a421ea410c..96f1a90024d 100644 --- a/src/test/libcephfs/caps.cc +++ b/src/test/libcephfs/caps.cc @@ -26,60 +26,14 @@ #include #include -void do_sigusr1(int s) {} - -// wait_and_suspend() forks the process, waits for the -// child to signal SIGUSR1, suspends the child with SIGSTOP -// sleeps for s seconds, and then unsuspends the child, -// waits for the child to exit, and then returns the exit code -// of the child -static int _wait_and_suspend(int s) { - - int fpid = fork(); - if (fpid != 0) { - // wait for child to signal - signal(SIGUSR1, &do_sigusr1); - sigset_t set; - sigaddset(&set, SIGUSR1); - int sig; - sigwait(&set, &sig); - - // fork and suspend child, sleep for 20 secs, and resume - kill(fpid, SIGSTOP); - sleep(s); - kill(fpid, SIGCONT); - int status; - wait(&status); - if (WIFEXITED(status)) - return WEXITSTATUS(status); - return 1; - } - return -1; -} - -// signal_for_suspend sends the parent the SIGUSR1 signal -// and sleeps for 1 second so that it can be suspended at the -// point of the call -static void _signal_for_suspend() { - kill(getppid(), SIGUSR1); -} - TEST(Caps, ReadZero) { - int w = _wait_and_suspend(20); - if (w >= 0) { - ASSERT_EQ(0, w); - return; - } - - pid_t mypid = getpid(); + int mypid = getpid(); struct ceph_mount_info *cmount; ASSERT_EQ(0, ceph_create(&cmount, NULL)); ASSERT_EQ(0, ceph_conf_read_file(cmount, NULL)); ASSERT_EQ(0, ceph_mount(cmount, "/")); - ASSERT_EQ(0, ceph_conf_set(cmount, "client_cache_size", "10")); - int i = 0; for(; i < 30; ++i) { @@ -114,7 +68,7 @@ TEST(Caps, ReadZero) { ASSERT_EQ(expect, caps & expect); } - _signal_for_suspend(); + ASSERT_EQ(0, ceph_conf_set(cmount, "client_debug_inject_tick_delay", "20")); for(i = 0; i < 30; ++i) {