Commit Graph

327 Commits

Author SHA1 Message Date
Gregory Farnum
2e375b6f4e Merge pull request #1675 from guangyy/wip-bench
Make rados/rest bench work for multiple write instances without metadata conflict.

Reviewed-by: Greg Farnum <greg@inktank.com>
2014-04-16 21:57:41 -07:00
Guang Yang
8c7a5ab861 Use string instead of char* when saving arguments for rest-bench 2014-04-16 01:28:16 +00:00
Guang Yang
308758b787 Make rados/rest bench work for multiple write instances without metadata conflict.
Signed-off-by: Guang Yang <yguang@yahoo-inc.com>
2014-04-15 07:48:37 +00:00
Dan Mick
d0a7632a31 Use cpp_strerror() wherever possible, and use autoconf for portability
strerror_r is not portable; on Gnu libc it returns char * and sometimes
does not fill in the supplied buffer.  Use autoconf to test which
version this platform uses and adapt.

Clean up the random calls to strerror and strerror_r (along with all
their private little one-use buffers) and regularize the code to use
cpp_strerror almost everywhere.  Where changed, any negation of the
error code is also removed, since cpp_strerror() will do that.

Note: some tools were using their own calls to strerror/strerror_r, so
will now get a (%d) in their output that wasn't there before; hence
the change to test/cli/monmaptool/print-nonexistent.t

Fixes: #8041
Signed-off-by: Dan Mick <dan.mick@inktank.com>
2014-04-14 13:07:17 -07:00
David Zafman
edd542e420 tools: Improve ceph_scratchtoolpp
Minor output improvements
Remove clone_range code that was asserting

Signed-off-by: David Zafman <david.zafman@inktank.com>
2014-04-09 11:35:05 -07:00
Sage Weil
fc1a424e83 ceph-conf: use global_pre_init to avoid starting logging
This avoids starting up logging, which is not appropriate when we are
examining the config state and not actually starting up the entity in
question.

Fixes: #7849
Signed-off-by: Sage Weil <sage@inktank.com>
2014-03-29 22:00:47 -07:00
Sage Weil
780fa91ce7 Revert "ceph-conf: do not log"
This reverts commit acc31e75a3.
2014-03-28 18:11:13 -07:00
Sage Weil
b5a632073b Revert "ceph-conf: no admin_socket"
This reverts commit 72715b235a.

This breaks the ceph cli, which uses ceph-conf --show-config-value ... to
get the admin socket.
2014-03-28 18:11:12 -07:00
Sage Weil
72715b235a ceph-conf: no admin_socket
We don't need to worry about pidfile because that is done by the fork
functions, which ceph-conf doesn't call.

Signed-off-by: Sage Weil <sage@inktank.com>
2014-03-27 12:30:39 -07:00
Sage Weil
acc31e75a3 ceph-conf: do not log
If you are querying the conf for an osd and it has a log configured, we
should not generate any log activity.

This isn't super pretty, but it is much less intrusive that wiring a 'do
not log' flag down into CephContext and a zillion other places.

Fixes: #7849
Signed-off-by: Sage Weil <sage@inktank.com>
2014-03-27 11:36:42 -07:00
Gregory Farnum
83661c273e Merge pull request #1363 from ceph/wip-3863
Add ceph-client-debug inode lookup

Reviewed-by: Greg Farnum <greg@inktank.com>
2014-03-25 10:49:51 -07:00
John Spray
9d77ce170b tools/rados: Allow binary file output of omap data
Extends getomapval and getompaheader to take an output
file argument the same way 'get' does.  Removes misleading
'-o' line from usage(), there doesn't appear to be any
such
option.

Signed-off-by: John Spray <john.spray@inktank.com>
2014-03-17 13:56:26 +00:00
David Zafman
31a6679180 tools: Fix ceph_filestore_dump to fully operate on EC pools
Add spg_t and ghobject_t handling

Fixes: #7698

Signed-off-by: David Zafman <david.zafman@inktank.com>
2014-03-14 15:19:45 -07:00
David Zafman
f633a03e44 tools: Cleanups in ceph_filestore_dump
Fix usage output of ceph_filestore_dump
Add missing error checking
Output full object name
Improve message consistency
Fix program exit value

Signed-off-by: David Zafman <david.zafman@inktank.com>
2014-03-14 15:18:36 -07:00
Sage Weil
f2c6ff33b7 tools/: make filenames consistent
_ for source files, - for (shippable) build targets.

Signed-off-by: Sage Weil <sage@inktank.com>
2014-03-14 13:15:22 -07:00
Sage Weil
74ad3e30d5 Merge remote-tracking branch 'gh/wip-coverity-20140409'
Reviewed-by: Sage Weil <sage@inktank.com>
2014-03-14 13:04:21 -07:00
Sage Weil
5ec493600e Merge remote-tracking branch 'gh/firefly' 2014-03-13 15:15:49 -07:00
John Spray
88cb1c496a tools: Create ceph-client-debug
For exposing test/dev functionality which uses
the cephfs client interface.

Initially just provides lookup-by-ino.

Fixes: #3863

Signed-off-by: John Spray <john.spray@inktank.com>
2014-03-13 18:33:01 +00:00
Sage Weil
f52af3063e Merge pull request #1437 from ceph/wip-7650
tools/rados/rados.cc: use write_full for sync_write for ec pools

Reviewed-by: Sage Weil <sage@inktank.com>
2014-03-12 10:44:50 -07:00
Sage Weil
b70db7e735 Merge remote-tracking branch 'gh/firefly' 2014-03-11 19:20:27 -07:00
Danny Al-Gaaf
2daabc1ecd scratchtoolpp.cc: check return value of getchar()
CID 716865 (#1 of 1): Unchecked return value from library (CHECKED_RETURN)
 1. check_return: Calling function "getchar()" without checking return
  value. This library function may fail and return an error code.
 2. unchecked_value: No check of the return value of "getchar()"

Check really for 'enter' as the user asked for.

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
2014-03-10 20:01:22 +01:00
Danny Al-Gaaf
d61fcfa262 ceph-filestore-dump.cc: pass OSDSuperblock by reference
CID 1100693 (#1 of 1): Big parameter passed by value (PASS_BY_VALUE)
 pass_by_value: Passing parameter superblock of type OSDSuperblock
 (size 240 bytes) by value.

CID 1100694 (#1 of 1): Big parameter passed by value (PASS_BY_VALUE)
 pass_by_value: Passing parameter sb of type OSDSuperblock (size 240 bytes)
 by value.

CID 1100695 (#1 of 1): Big parameter passed by value (PASS_BY_VALUE)
 pass_by_value: Passing parameter sb of type OSDSuperblock (size 240 bytes)
 by value.

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
2014-03-10 18:14:16 +01:00
Ilya Dryomov
f581bda5cf rados: add set-alloc-hint command
Set allocation hint for an object.

Signed-off-by: Ilya Dryomov <ilya.dryomov@inktank.com>
2014-03-08 12:20:32 +02:00
Samuel Just
5f7efec1a4 tools/rados/rados.cc: use write_full for sync_write for ec pools
Fixes: #7650
Signed-off-by: Samuel Just <sam.just@inktank.com>
2014-03-07 12:43:38 -08:00
Noah Watkins
0e376ee742 compat: avoid unused warn with TEMP_FAILURE_RETRY
The version of TEMP_FAILURE_RETRY found on Linux has a GNU extension
that squashes the unused return value warning where applicable. This
adds a VOID_TEMP_FAILURE_RETRY to make the case explicit, casting the
expression value to void to avoid the warning.

Signed-off-by: Noah Watkins <noahwatkins@gmail.com>
2014-02-23 11:17:42 -08:00
Danny Al-Gaaf
9e8882e06c BackedUpObject::get_xattr() pass function parameter by reference
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
2014-02-19 18:40:12 +01:00
Samuel Just
035d6cc2a3 osd/: refer to pg by spg_t and replica by pg_shard_t
We may have multiple pg shards on the same osd for an
ec pool.  Thus, replicas must be referred to by <osd, shard>
and pgs by <pgid, shard>.

Signed-off-by: Samuel Just <sam.just@inktank.com>
2014-02-17 20:12:10 -08:00
Samuel Just
1c93e03f04 osd/: Add a shard parameter to SnapMapper to handle multiple pg shards
Signed-off-by: Samuel Just <sam.just@inktank.com>
2014-02-17 20:11:05 -08:00
Sage Weil
af848d4a4a Merge pull request #1176 from ceph/wip-primary-affinity
osd: primary affinity

Added primary-affinity thrashing to thrashosd.py.

Reviewed-by: Loic Dachary <loic@dachary.org>
2014-02-15 16:59:35 -08:00
Sage Weil
c360c604aa ceph_psim: some futzing to test primary_affinity
- map to acting
- count first position, primary

Signed-off-by: Sage Weil <sage@inktank.com>
2014-02-15 10:50:09 -08:00
Loic Dachary
d8964b2f33 Merge pull request #1235 from ceph/wip-osdmaptool-pool-fix
wip-osdmaptool-pool-fix

Reviewed-by: Loic Dachary <loic@dachary.org>
2014-02-14 13:33:26 +01:00
Ilya Dryomov
f98435a45f osdmaptool: add --pool option for --test-map-pgs mode to usage()
--test-map-pgs mode allows to map all pgs from either all pools or just
one pool.  Mention it in usage output.

Signed-off-by: Ilya Dryomov <ilya.dryomov@inktank.com>
2014-02-14 12:24:32 +02:00
Ilya Dryomov
eedbf501e6 osdmaptool: fix --pool option for --test-map-object mode
Commit 7f1b12f2ef ("osdmaptool: add --test-map-pgs mode") broke
--pool for --test-map-object mode.  Fix it, and improve --pool option
handling for both modes while at it (report strict_strtol() errors,
check if specified pool exists).

Signed-off-by: Ilya Dryomov <ilya.dryomov@inktank.com>
2014-02-14 12:24:25 +02:00
Loic Dachary
8533b6ac2e Merge pull request #1185 from ceph/wip-crush
crush: "vary_r" tunable

Reviewed-by: Loic Dachary <loic@dachary.org>
2014-02-11 23:42:53 +01:00
Sage Weil
e20a55d906 crush: add infrastructure around new chooseleaf_vary_r tunable
- encoding
- feature bit
- decompile/compile

Signed-off-by: Sage Weil <sage@inktank.com>
2014-02-11 08:48:14 -08:00
Josh Durgin
32aa9fdf66 Merge branch wip-librados-timeout
Reviewed-by: Sage Weil <sage@inktank.com>
Reviewed-by: Loic Dachary <loic@dachary.org>
2014-02-10 14:12:35 -08:00
Josh Durgin
79c1874346 rados: check return values for commands that can now fail
A few places were not checking the return values of commands, since
they could not fail before timeouts were added.

Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
2014-02-10 12:53:12 -08:00
Sage Weil
9caaef716f osdmaptool: allow a completely random placement
This useful for comparison purposes and sanity-checking the results.

Signed-off-by: Sage Weil <sage@inktank.com>
2014-02-07 07:10:13 -08:00
Sage Weil
7f1b12f2ef osdmaptool: add --test-map-pgs mode
This command will map all pgs from all pools (or just one pool) to osds
and summarize the placement and calculate the actual standard deviation and
the expected value.

Signed-off-by: Sage Weil <sage@inktank.com>
2014-02-07 07:10:13 -08:00
Noah Watkins
4c4e1d0d47 libc++: use ceph:: namespaced data types
Switches the implemetnation of smart pointers and unordered map/set to
use the ceph:: versions.

Signed-off-by: Noah Watkins <noahwatkins@gmail.com>
2014-01-18 14:03:20 -08:00
Greg Farnum
93d481a5d2 mon, osdmaptool: switch to primary-specifying pg_to_up_acting_osds
Signed-off-by: Greg Farnum <greg@inktank.com>
2014-01-15 16:33:05 -08:00
Greg Farnum
5b699782d1 OSDMap: switch pg_to_osds to have an explicit primary param
Use pointers instead of references for the out params, too!

Signed-off-by: Greg Farnum <greg@inktank.com>
2014-01-15 16:33:05 -08:00
Sage Weil
de8e8b5d09 osd/ReplicatedPG: make cache-[try-]flush CACHE instead of WR ops
This will allow us to send a flush op on a snap.

Signed-off-by: Sage Weil <sage@inktank.com>
2014-01-13 16:19:43 -08:00
Sage Weil
4e8259db4f osd/ReplicatedPG: allow cache-evict on snaps
We do three things here:

 - make cache-evict a CACHE instead of WR op, allowing us to submit it
   on snaps (not just head)
 - allow eviction of a snap
 - verify that all snaps are missing before evicting a head

Signed-off-by: Sage Weil <sage@inktank.com>
2014-01-13 16:19:42 -08:00
Loic Dachary
26f7fa96b0 crush: crushtool copyright notice update
Signed-off-by: Loic Dachary <loic@dachary.org>
2014-01-12 17:48:33 +01:00
Loic Dachary
b705e52304 crush: crushtool emacs compile helper
Signed-off-by: Loic Dachary <loic@dachary.org>
2014-01-12 17:48:33 +01:00
Loic Dachary
d3d75a2165 crush: crushtool --build informative messages
* dump the crush tree created by --build at debug level 1.

* display a warning at debug level 1 if there is more than one root. In
  most cases it is not what the user wants and it may be confusing
  because the ruleset will only apply to the first of root and have less
  devices under it as expected.

Signed-off-by: Loic Dachary <loic@dachary.org>
2014-01-12 17:48:33 +01:00
Loic Dachary
5b28405a85 crush: crushtool --build uses OSDMap helpers for rulesets
Instead of creating a ruleset from scratch, use the
OSDMap::build_simple_crush_rulesets helper. It is more likely to match
the user expecations.

Signed-off-by: Loic Dachary <loic@dachary.org>
2014-01-12 17:48:33 +01:00
Loic Dachary
1368229e04 crush: print --build debug information when verbose 2
instead of verbose 0

Signed-off-by: Loic Dachary <loic@dachary.org>
2014-01-12 17:48:32 +01:00
Loic Dachary
5b95d183c8 crush: display args on crushtool failure
When the number of args provided to --build is not a multiple of 3,
display the arguments which do not comply.

For instance the --debug_crush 0 option is not consumed by global_init
in crushtool because, unlike most ceph tools, the arguments are not
passed to global_init. As a result --debug_crush 0 become part of the
arguments and triggers the failure.

   crushtool --debug_crush 0 --build --num_osds 320 node straw 4
   remaining args: [--debug_crush,0,node,straw,4]
   layers must be specified with 3-tuples of (name, buckettype, size)

Signed-off-by: Loic Dachary <loic@dachary.org>
2014-01-12 17:48:32 +01:00