Commit Graph

5102 Commits

Author SHA1 Message Date
John Spray
54740dd568 common: remove usage of set_daemon_default for now
The code in common_preinit is still there to override
these settings as appropriate.

The set_daemon_default stuff was breaking ceph-conf tests (because
you would get the client-side defaults when asking about an OSD's
settings), and md_config_t isn't properly identifying daemons
using code_env yet.

Ticket to add it back in:
http://tracker.ceph.com/issues/20627

Signed-off-by: John Spray <john.spray@redhat.com>
2017-07-21 06:27:29 -04:00
John Spray
b0fbd7151c common: run validator on all defaults
RBD relies on this behaviour to get the int-ized
form for rbd_default_features.

Signed-off-by: John Spray <john.spray@redhat.com>
2017-07-21 06:27:29 -04:00
John Spray
7cde2e51e4 rgw: set mins on options to avoid unneeded max()
Signed-off-by: John Spray <john.spray@redhat.com>
2017-07-21 06:27:29 -04:00
John Spray
c3ba6ce588 common: update options.cc for master
Signed-off-by: John Spray <john.spray@redhat.com>
2017-07-21 06:27:28 -04:00
John Spray
1411953083 common: move validation in Option and add a test
Signed-off-by: John Spray <john.spray@redhat.com>
2017-07-21 06:27:28 -04:00
John Spray
a3054ef0d9 common: revert public_addr setting to a string
This was a string in the old schema, and tests
depended on that -- if we want to change its type
let's do that separately to the infrastructure changes.

Signed-off-by: John Spray <john.spray@redhat.com>
2017-07-21 06:27:28 -04:00
John Spray
1e9b62c1b6 tools: avoid max() calls on rbd config options
These were awkward for typing of the '1' literal vs.
the int64_t settings.  The whole max() thing is also
unnecessary now, if we set proper bounds on the option
definitions.

Signed-off-by: John Spray <john.spray@redhat.com>
2017-07-21 06:27:28 -04:00
John Spray
0f04dab0b7 common/options: separate "service" from "tags"
Signed-off-by: John Spray <john.spray@redhat.com>
2017-07-21 06:27:27 -04:00
John Spray
3f99f6ef20 common: enforce min/max/enum on config options
Signed-off-by: John Spray <john.spray@redhat.com>
2017-07-21 06:27:27 -04:00
John Spray
f777599baa common: update options.cc for latest additions
Signed-off-by: John Spray <john.spray@redhat.com>
2017-07-21 06:27:27 -04:00
John Spray
48c6d34418 common: pass up error strings from set_val
This is so that we can use it as a replacment
for the ugly injectargs.

Signed-off-by: John Spray <john.spray@redhat.com>
2017-07-21 06:27:26 -04:00
John Spray
241a547ba1 common: implement "config help" to output schema
Signed-off-by: John Spray <john.spray@redhat.com>
2017-07-21 06:27:26 -04:00
John Spray
b41dc4108e common: respect daemon defaults in config options
Signed-off-by: John Spray <john.spray@redhat.com>
2017-07-21 06:27:26 -04:00
John Spray
72d42de9d0 common: re-add unsigned config option type
As long as some options are being consumed
via md_config_t:: members, various users
of (unsigned) int values will get compile warnings
when they e.g. compare them with other unsigned values.

Signed-off-by: John Spray <john.spray@redhat.com>
2017-07-21 06:27:25 -04:00
John Spray
3933adef6a common: reinstate config opt validators
Signed-off-by: John Spray <john.spray@redhat.com>
2017-07-21 06:27:25 -04:00
John Spray
c1a6b497fb common: sync up options.cc with latest master
Signed-off-by: John Spray <john.spray@redhat.com>
2017-07-21 06:27:25 -04:00
John Spray
08731c3567 common/config: hook in new Option config descriptions
The C++ class member fields continue to exist for
settings defined in common/legacy_config_opts.h, but
all the schema information is coming from common/options.cc
now.

The values in md_config_t::values are automatically
copied into the C++ class member fields for legacy config
options as needed.

Signed-off-by: John Spray <john.spray@redhat.com>
2017-07-21 06:27:25 -04:00
John Spray
10f33a1bdd common: separate config opts definitions from subsys definitions
Previously these were all in one header and inclusions of it
got really verbose from everyone having to define SUBSYS and OPTION
macros even though they only wanted to pick out one or the other.

Also, this separates the subsys.h stuff (staying) from the legacy
config opt definitions (transitional, will go).

Signed-off-by: John Spray <john.spray@redhat.com>
2017-07-21 06:27:24 -04:00
John Spray
73086f1e4c common: remove ::validate definitions
These will be replaced by validate methods
on Option subclasses that need them.  The code
that was in these files moved to options.[h|cc]

Signed-off-by: John Spray <john.spray@redhat.com>
2017-07-21 06:27:24 -04:00
John Spray
f1ac8dc7a4 common: hook in 'safe' flag to new config options
It's a poor substitute for real a concurrency solution
but for the moment carry it forward so that the options
structure can replace the list of config_option
in md_config_t.

Signed-off-by: John Spray <john.spray@redhat.com>
2017-07-21 06:27:24 -04:00
John Spray
a5244f7c67 common: s/config_opts/legacy_config_opts/
Name change reflects that newly added config opts
don't need to go here.

Signed-off-by: John Spray <john.spray@redhat.com>
2017-07-21 06:27:24 -04:00
John Spray
4aa5f35b8c common: use a vector instead of array in options.cc
Avoids retro 80s style blank entry at the end :-)

Signed-off-by: John Spray <john.spray@redhat.com>
2017-07-21 06:27:24 -04:00
John Spray
26551776f2 common: rip out option code generation bit
We can have a legacy (static field) config object
that includes fields from config_opts.h, and
then switch to using dynamic get() for newly
added options, so that we don't need to do
code generation for the new config infrastructure.

Signed-off-by: John Spray <john.spray@redhat.com>
2017-07-21 06:27:23 -04:00
Sage Weil
6829384546 g++ ../src/convert.cc -o cv -I../src -I.
./cv > /tmp/foo
...and copy that into options.cc
bin/generate_option_header > ../src/common/config_fields.h

Signed-off-by: Sage Weil <sage@redhat.com>
2017-07-21 06:27:23 -04:00
Kefu Chai
bc3930a139 common/options: more constness
Signed-off-by: Kefu Chai <kchai@redhat.com>
2017-07-21 06:27:23 -04:00
Kefu Chai
2c6669c5a4 common/options: specialize on non bool integeral types
Signed-off-by: Kefu Chai <kchai@redhat.com>
2017-07-21 06:27:23 -04:00
Sage Weil
fe1c592c8c common/options: new options infrastructure
Define schema for config options.  Helper to generate a header fragment
to declare the types.

Unlike the old config_opts.h approach, we will not intialize values in
the header.  This avoids a recompile if there is a change and also allows
us to specify different defaults and do parsing and validation at runtime.
Instead, we'll intialize values in the constructure of the containing
class.

Signed-off-by: Sage Weil <sage@redhat.com>
2017-07-21 06:27:23 -04:00
Sage Weil
8463894575 common: remove max_open_files config option
The only user is init-ceph, and it can get at it via ceph-conf without
the option being declared here.

Signed-off-by: Sage Weil <sage@redhat.com>
2017-07-21 06:27:22 -04:00
Sage Weil
03ef427b31 ceph-syn: parse --num-client locally; remove global option
Signed-off-by: Sage Weil <sage@redhat.com>
2017-07-21 06:27:22 -04:00
Kefu Chai
41c59530c1 Merge pull request #16328 from neha-ojha/recovery_sleep_default
osd: Add recovery sleep configuration option for HDDs and SSDs

Reviewed-by: Sage Weil <sage@redhat.com>
2017-07-21 16:55:02 +08:00
Matt Benjamin
5f838c05c7 rgw_file: properly & |'d flags
Found by "Supriti Singh" <Supriti.Singh@suse.com>.

Fixes http://tracker.ceph.com/issues/20663

Signed-off-by: Matt Benjamin <mbenjamin@redhat.com>
2017-07-20 08:18:22 -04:00
Yuri Weinstein
5f5647afc2 Merge pull request #16291 from ZVampirEM77/wip-acl-grants-num-limit
rgw: acl grants num limit

Reviewed-by: Casey Bodley <cbodley@redhat.com>
2017-07-18 07:38:34 -07:00
Patrick Donnelly
bc58d6aa92
Merge PR 16039 into master
* refs/remotes/upstream/pull/16039/head:
	common/config_opts: drop unused opt(mds_kill_journal_at)

Reviewed-by: Zheng Yan <zyan@redhat.com>
2017-07-17 22:33:40 -07:00
Kefu Chai
c142f25a60 Merge pull request #16346 from liewegas/wip-20602
mon: skip crush smoke test when running under valgrind

Reviewed-by: Joao Eduardo Luis <joao@suse.de>
Reviewed-by: Kefu Chai <kchai@redhat.com>
2017-07-17 20:15:24 +08:00
Enming Zhang
a1b05dd2f6 rgw: acl grants num limit
According to AWS S3 in this document[1], an ACL can have up to 100
grants.

If the nums of grants is larger than 100, S3 will return like following:
400
<?xml version="1.0" encoding="UTF-8"?>
<Error><Code>MalformedACLError</Code><Message>The XML you provided was not well-formed or did not validate against our published schema</Message><RequestId>10EC67824572C378</RequestId><HostId>AWL3NnQChs/HCfOTu5MtyEc9uzRuxpYMhmvXQry2CovCcuxO2/tMqY1zGoWOur86ipQt3v/WEiA=</HostId></Error>

Now if the nums of request acl grants is larger than the maximum allowed, rgw will return
like following:
400
<?xml version="1.0" encoding="UTF-8"?><Error><Code>MalformedACLError</Code><Message>The request is rejected, because the acl grants number you requested is larger than the maximum 101 grants allowed in an acl.</Message><BucketName>222</BucketName><RequestId>tx000000000000000000017-00596b5fad-101a-default</RequestId><HostId>101a-default-default</HostId></Error>

The maximum number of acl grants can be configured in config file with the configuration item:

rgw_acl_grants_max_num

[1] http://docs.aws.amazon.com/AmazonS3/latest/dev/acl-overview.html

Signed-off-by: Enming Zhang <enming.zhang@umcloud.com>
2017-07-16 20:58:43 +08:00
Bassam Tabbara
bf49385679 mon: add support public_bind_addr option
To support running in dynamic enviornments (like Kubernetes) the mon needs
to be able to advertise and ip address that is different from the ip address
that it listens on locally.

Added a new config option "public_bind_addr" which if set becomes the address
that the mon will bind to locally. If empty (the default) the public_addr
will be used to bind locally.

added a new function on Messenger to set_addr which is called by ceph-mon to set
the advertised address after doing the bind.

also relaxed the "wrong node!" errors in AsyncMessenger and SimpleMessenger as
its now valid to talk to a peer whose peer_addr_of_me is different from what
we expect.

Signed-off-by: Bassam Tabbara <bassam.tabbara@quantum.com>
2017-07-14 10:41:49 -07:00
Sage Weil
75c923e7a0 mon: add mon_osd_crush_smoke_test=true
This option allows us to disable the crush smoke test when creating pools,
injecting crush maps, or making other changes.  DANGER DANGER.

Signed-off-by: Sage Weil <sage@redhat.com>
2017-07-14 11:51:47 -04:00
Sage Weil
76abfdba61 Merge pull request #16321 from Yan-waller/wip-walle-0712cephosd
common: misc cleanups in common, global, os, osd submodules

Reviewed-by: Jos Collin <jcollin@redhat.com>
2017-07-13 22:16:16 -05:00
Neha Ojha
0bedac2733 osd: Add recovery sleep configuration option for HDDs and SSDs
Signed-off-by: Neha Ojha <nojha@redhat.com>
2017-07-13 15:00:34 -07:00
Sage Weil
95c07fbe96 Merge pull request #16014 from xiexingguo/wip-autoclass
osd/OSD: auto class on osd start up

Reviewed-by: Sage Weil <sage@redhat.com>
2017-07-13 10:50:45 -05:00
Yan Jun
0cfd05db57 osd: cleanups
Signed-off-by: Yan Jun <yan.jun8@zte.com.cn>
2017-07-13 22:22:20 +08:00
Sage Weil
db0b2f6ede mon: shorten 'stuck' threshold from 5m -> 1m
Signed-off-by: Sage Weil <sage@redhat.com>
2017-07-12 12:52:02 -04:00
Sage Weil
b9cdb9fa7b mon/MgrMonitor: do not issue MGR_DOWN on new cluster
It is normal for the initial cluster to lack a mgr.  Wait for some
grace period before complaining about a missing mgr.

Default to 30m.

Signed-off-by: Sage Weil <sage@redhat.com>
2017-07-12 12:52:02 -04:00
Sage Weil
8e815abe4e mon: new health check framework
Signed-off-by: Sage Weil <sage@redhat.com>
2017-07-12 12:51:30 -04:00
Yuri Weinstein
ed075b05ff Merge pull request #15834 from prallabh/wip-20377
rgw: Do not fetch bucket stats by default upon bucket listing

Reviewed-by:  Radoslaw Zarzynski <rzarzyns@redhat.com>
2017-07-12 08:52:24 -07:00
Sage Weil
7f03169df4 Merge pull request #16235 from tchaikov/wip-timer
os/filestore: do not free event if not added

Reviewed-by: Josh Durgin <jdurgin@redhat.com>
2017-07-10 16:49:01 -05:00
Kefu Chai
11914dc351 common/Timer: return false if event not added
Signed-off-by: Kefu Chai <kchai@redhat.com>
2017-07-10 15:31:16 +08:00
xie xingguo
0c885d6800 osd/OSD: automatically set device class on start
Signed-off-by: xie xingguo <xie.xingguo@zte.com.cn>
2017-07-10 08:45:36 +08:00
Sage Weil
97cfc3cb69 mgr: allow/track service registrations
Signed-off-by: Sage Weil <sage@redhat.com>
2017-07-08 22:30:28 -04:00
Jos Collin
8fbe8b8c0e Merge pull request #16214 from liupan1111/wip-fix-mutex
common/Mutex.cc: fixed the error in comment

Reviewed-by: Jos Collin <jcollin@redhat.com>
2017-07-09 01:02:04 +00:00
Sage Weil
a0ba660afc Merge pull request #16025 from liewegas/wip-19964
mon: do crushtool test with fork and timeout, but w/o exec of crushtool

Reviewed-by: Mykola Golub <mgolub@mirantis.com>
2017-07-08 09:01:10 -05:00
Pan Liu
e4e8806dca common/Mutex.cc: fixed the error in comment
Signed-off-by: Pan Liu <wanjun.lp@alibaba-inc.com>
2017-07-08 13:49:28 +08:00
Josh Durgin
5cc892166f Merge pull request #15689 from jdurgin/wip-filestore-rand-split
os/filestore/HashIndex: randomize split threshold by a configurable amount

Reviewed-by: Sage Weil <sage@redhat.com>
2017-07-07 15:18:49 -07:00
Yuri Weinstein
795eccfe21 Merge pull request #16078 from xiexingguo/wip-misc
mon, osd: misc fixes

Reviewed-by: Kefu Chai <kchai@redhat.com>
2017-07-07 15:15:58 -07:00
Sage Weil
857867fabd crush/CrushTester: remove old test_with_crushtool helper
test_with_fork is superior in all ways :)

Signed-off-by: Sage Weil <sage@redhat.com>
2017-07-07 11:11:24 -04:00
Sage Weil
55f76d5ad8 common/fork_function: close all fds in children
Not strictly necessary, but a tidier.

Signed-off-by: Sage Weil <sage@redhat.com>
2017-07-07 11:11:24 -04:00
Sage Weil
f46d76edde common/fork_function: helper to run a function, forked, with a timeout
Signed-off-by: Sage Weil <sage@redhat.com>
2017-07-07 11:11:17 -04:00
Sage Weil
e46f1317c4 Merge pull request #16157 from xiexingguo/wip-bluestore-cache
os/bluestore: differ default cache size for hdd/ssd backends

Reviewed-by: Sage Weil <sage@redhat.com>
2017-07-07 10:08:57 -05:00
Kefu Chai
8c8220c39c common/Timer: do not add event if already shutdown
otherwise the callback is leaked.

Fixes: http://tracker.ceph.com/issues/20432
Signed-off-by: Kefu Chai <kchai@redhat.com>
2017-07-07 15:08:19 +08:00
xie xingguo
9008c8f715 os/bluestore: differ default cache size for hdd/ssd backends
This is a follow-up change of https://github.com/ceph/ceph/pull/15976
and makes the bluestore cache capacity being self-adaptive for
different backends.

Signed-off-by: xie xingguo <xie.xingguo@zte.com.cn>
2017-07-07 11:41:36 +08:00
Sage Weil
145999a497 Merge pull request #15786 from markhpc/wip-bluestore-cache-behavior
os/bluestore: cap rocksdb cache size

Reviewed-by: Sage Weil <sage@redhat.com>
Reviewed-by: Igor Fedotov <ifedotov@mirantis.com>
2017-07-06 21:59:43 -05:00
Sage Weil
5870a68c00 Merge pull request #15647 from gmayyyha/format-config-show
common,config: OPT_FLOAT and OPT_DOUBLE output format in config show

Reviewed-by: Kefu Chai <kchai@redhat.com>
2017-07-06 21:25:19 -05:00
Sage Weil
4e64eac6eb Merge pull request #15743 from yuyuyu101/wip-20330
msg: make listen backlog an option, increase from 128 to 512

Reviewed-by: Kefu Chai <kchai@redhat.com>
2017-07-06 21:24:22 -05:00
Jos Collin
de48170886 Merge pull request #15878 from renhwztetecs/renhw-wip-common-dns
common: Update the error string when res_nsearch() or res_search() fails 

Reviewed-by: Jos Collin <jcollin@redhat.com>
Reviewed-by: Sage Weil <sweil@redhat.com>
2017-07-07 01:40:52 +00:00
Mark Nelson
0681743391 common/config_opts: favor bluestore kv cache before meta until max.
Signed-off-by: Mark Nelson <mnelson@redhat.com>
2017-07-06 14:14:44 -05:00
Mark Nelson
7435ddd69f os/bluestore: limit kv cache size.
Signed-off-by: Mark Nelson <mnelson@redhat.com>
2017-07-06 11:13:13 -05:00
Mark Nelson
d9e078402f common/config_opts: Better rocksdb cache size description.
Signed-off-by: Mark Nelson <mnelson@redhat.com>
2017-07-06 11:13:13 -05:00
Mark Nelson
814904ae68 kv/RocksDBStore: default to disable row cache.
Signed-off-by: Mark Nelson <mnelson@redhat.com>
2017-07-06 11:13:13 -05:00
Kefu Chai
41531785ce Merge pull request #16032 from tanghaodong25/bluestore-aio-submit
os/bluestore/KernelDevice: batch aio submit

Reviewed-by: Sage Weil <sage@redhat.com>
2017-07-06 16:01:49 +08:00
huanwen ren
351a8a82b1 common: add query_str when res_search() failed
I don't know the abort information about DNS Resolver,
if not add "query_str".

Signed-off-by: huanwen ren <ren.huanwen@zte.com.cn>
2017-07-06 13:39:34 +08:00
Mykola Golub
2a9f56f818 Merge pull request #15860 from dillaman/wip-20168
librbd: fail IO request when exclusive lock cannot be obtained

Reviewed-by: Mykola Golub <mgolub@mirantis.com>
2017-07-05 14:52:55 +03:00
Kefu Chai
4fd72b48c4 Merge pull request #15964 from tchaikov/wip-5249
mon/MonClient: respect the priority in SRV RR

Reviewed-by: Gregory Farnum <gfarnum@redhat.com>
2017-07-05 18:48:29 +08:00
Willem Jan Withagen
356c919531 core: make the conversion from wire error to host OS work
- The key change is the type of rval,
   that will call the conversion when en/decoded
 - Remainder is fixes for the type change and promotions

Signed-off-by: Willem Jan Withagen <wjw@digiware.nl>
2017-07-05 11:39:50 +02:00
John Spray
b363e58530 Merge pull request #15958 from liewegas/wip-mgr-modules
mgr,mon: enable/disable mgr modules via 'ceph mgr module ...' commands

Reviewed-by: John Spray <john.spray@redhat.com>
2017-07-05 00:04:59 +01:00
xie xingguo
1333c475c0 mon/OSDMonitor: introduce osd_pool_default_type config option
In luminous we now have full support of ec pool, so it is not
good to continue hardcoding default pool type to "replicated".

Introduce a configurable osd_pool_default_type for this.

Signed-off-by: xie xingguo <xie.xingguo@zte.com.cn>
2017-07-04 18:22:09 +08:00
Kefu Chai
a5471e7710 Merge pull request #15823 from jdurgin/wip-omap-tp-heartbeat
osd/ReplicatedBackend: reset thread heartbeat after every omap entry …

Reviewed-by: Sage Weil <sage@redhat.com>
Reviewed-by: xie xingguo <xie.xingguo@zte.com.cn>
2017-07-04 14:46:18 +08:00
xie xingguo
01d7fbe102 common: fix log warnings
/home/jenkins-build/build/workspace/ceph-pull-requests/src/common/LogEntry.cc:54:24: warning: suggest parentheses around comparison in operand of ‘|’ [-Wparentheses]
   } else if (level_str == "warn" | level_str == "warning") {
                        ^
/home/jenkins-build/build/workspace/ceph-pull-requests/src/common/LogEntry.cc:56:24: warning: suggest parentheses around comparison in operand of ‘|’ [-Wparentheses]
   } else if (level_str == "error" | level_str == "err") {

Signed-off-by: xie xingguo <xie.xingguo@zte.com.cn>
2017-07-01 15:24:22 +08:00
Sage Weil
d04f5a1d74 Merge pull request #15924 from jcsp/wip-log-last-filters
mon: Filter `log last` output by severity and channel

Reviewed-by: Sage Weil <sage@redhat.com>
Reviewed-by: Kefu Chai <kchai@redhat.com>
2017-06-30 09:11:56 -05:00
Yanhu Cao
1c11d31c34 common/config_opts: drop unused opt(mds_kill_journal_at)
Signed-off-by: Yanhu Cao <gmayyyha@gmail.com>
2017-06-30 17:14:34 +08:00
Haodong Tang
2fc54306ee os/bluestore/KernelDevice: make the amount of reaped aio tunable
Signed-off-by: Haodong Tang <haodong.tang@intel.com>
2017-06-30 14:27:34 +08:00
Sage Weil
16fcee1f71 mon,mgr: manage mgr module list in mgrmap
Kill old mgr_modules option.

Add new mgr_initial_modules option, on the mon, for the initial cluster
mgrmap.

Add ls, enable, disable commands.

Respawn mgr if the module list changes.  In the future we could enable
new modules without a full restart, but disabling probably requires (and
is best handled by) a respawn.

Signed-off-by: Sage Weil <sage@redhat.com>
2017-06-29 23:10:51 -04:00
Sage Weil
a8dd57d8a0 Merge pull request #15976 from liewegas/wip-bluestore-big-cache
os/bluestore: default cache size of 3gb
2017-06-29 22:02:08 -05:00
Kefu Chai
7ee4907698 Merge pull request #15925 from jcsp/wip-fsstatus-cleanup
mgr: clean up fsstatus module

Reviewed-by: Sage Weil <sage@redhat.com>
Reviewed-by: Kefu Chai <kchai@redhat.com>
2017-06-30 09:31:02 +08:00
Josh Durgin
4bcd6f666b Merge pull request #14760 from dzafman/wip-19657
osd: On EIO from read recover the primary replica from another copy

Reviewed-by: Josh Durgin <jdurgin@redhat.com>
2017-06-29 14:00:18 -07:00
Kefu Chai
cf384a18dc common/dns_resolve: do not assert with misconfigured SRV RR
Signed-off-by: Kefu Chai <kchai@redhat.com>
2017-06-29 13:50:34 +08:00
Kefu Chai
c608d6e285 mon/MonClient: respect the priority in mon_info_t
* common/dns_resolve: collect the priority in the SRV records
  also
* mon/MonClient: only connect to the mon with highest priority
  (in context of SRV record, the lowest priority value), and prefer
  the mon with higher weight.

Fixes: http://tracker.ceph.com/issues/5249
Signed-off-by: Kefu Chai <kchai@redhat.com>
2017-06-29 13:50:01 +08:00
Sage Weil
ddc32d5d07 os/bluestore: default cache size of 3gb
Signed-off-by: Sage Weil <sage@redhat.com>
2017-06-28 10:48:45 -04:00
Kefu Chai
d59e0207df common/dns_resolve: refactor DNSResolver::resolve_cname() to remove gotos
trade gotos for better readablity

Signed-off-by: Kefu Chai <kchai@redhat.com>
2017-06-28 13:21:00 +08:00
Jason Dillaman
2d90bd8fdb common: improve the ability to mock PointerWQ classes
Signed-off-by: Jason Dillaman <dillaman@redhat.com>
2017-06-27 13:56:09 -04:00
Sage Weil
fe4d15191d Merge pull request #15874 from elliswuuuuuuuu/remove_unuse_config
common/config_opt: remove unused config

Reviewed-by: Kefu Chai <kchai@redhat.com>
2017-06-27 10:22:42 -05:00
Sage Weil
63c29d4358 Merge pull request #15864 from joscollin/wip-CID1412839-uninitialized-pointer-field
common: initialize array in struct BackTrace

Reviewed-by: Kefu Chai <kchai@redhat.com>
2017-06-27 10:22:26 -05:00
Sage Weil
6f6d6ed984 Merge pull request #15881 from joscollin/wip-1412776-explicit-null-dereferenced
common: Passing null pointer option_name to operator << in md_config_t::parse_option()

Reviewed-by: Kefu Chai <kchai@redhat.com>
2017-06-27 10:22:03 -05:00
Sage Weil
f6087a34e8 Merge pull request #15917 from xiexingguo/wip-upmap-fixes
mon/OSDMonitor: a couple of upmap and other fixes

Reviewed-by: Sage Weil <sage@redhat.com>
2017-06-27 10:19:41 -05:00
John Spray
ec09fc2f52 common: enable status module by default
It's still sort of awkward to prefix these commands
with "mgr tell" but this makes them at least
somewhat accessible to the average user.

Signed-off-by: John Spray <john.spray@redhat.com>
2017-06-27 06:53:33 -04:00
John Spray
f9f29c87a6 mon: helper function for string to log level
Signed-off-by: John Spray <john.spray@redhat.com>
2017-06-27 06:28:47 -04:00
Pavan Rallabhandi
80755e3396 rgw: Have an option to not to fetch bucket stats upon bucket listing
Fixes: http://tracker.ceph.com/issues/20377
Signed-off-by: Pavan Rallabhandi <PRallabhandi@walmartlabs.com>
2017-06-27 11:01:17 +05:30
Sage Weil
d96491b3ac Merge pull request #14997 from ivancich/wip-bring-in-dmclock-p2
osd/PG: Add two new mClock implementations of the PG sharded operator queue

Reviewed-by: Josh Durgin <jdurgin@redhat.com>
Reviewed-by: Sage Weil <sage@redhat.com>
2017-06-26 13:40:16 -05:00
xie xingguo
9205dd2059 mon/OSDMonitor: make blacklist expire configurable; fix potential races
Signed-off-by: xie xingguo <xie.xingguo@zte.com.cn>
2017-06-26 20:23:28 +08:00
Jos Collin
61cde7a0fa common: Passing null pointer option_name to operator << in md_config_t::parse_option()
Fixes the Coverity Scan Report:
CID 1412776 (#1 of 1): Explicit null dereferenced (FORWARD_NULL)19. var_deref_model: Passing null pointer option_name to operator <<, which dereferences it.

Fixed the review comments too in this commit.

Signed-off-by: Jos Collin <jcollin@redhat.com>
2017-06-26 14:48:05 +05:30
Sage Weil
82fcdd9175 Merge pull request #15890 from tchaikov/wip-19741
osdc/Objecter: release message if it's not handled

Reviewed-by: Josh Durgin <jdurgin@redhat.com>
2017-06-24 23:20:38 -05:00
David Zafman
af34e78cc5 osd debug: Add testing support by adding random read error only when building push ops
add osd_debug_random_push_read_error config option

Signed-off-by: David Zafman <dzafman@redhat.com>
2017-06-23 08:09:15 -07:00
David Zafman
83457ab69c osd debug: Add testing support for random read EIO errors
filestore_debug_random_read_err   Specify % of EIO all filestore reads

Signed-off-by: David Zafman <dzafman@redhat.com>
2017-06-23 08:09:15 -07:00
Yanhu Cao
35e3b0b34a common/config_opts: drop unused opt
Signed-off-by: Yanhu Cao <gmayyyha@gmail.com>
2017-06-23 17:15:47 +08:00
Jos Collin
4367361055 common: initialize array in struct BackTrace
Fixed the review comments.

Signed-off-by: Jos Collin <jcollin@redhat.com>
2017-06-23 10:02:42 +05:30
Jos Collin
22e1d8984b common: initialize array in struct BackTrace
Fixes the coverity scan report:
1412839 Uninitialized pointer field
CID 1412839 (#1 of 1): Uninitialized pointer field (UNINIT_CTOR)2. uninit_member: Non-static
class member array is not initialized in this constructor nor in any functions that it calls.

Signed-off-by: Jos Collin <jcollin@redhat.com>
2017-06-23 09:09:32 +05:30
Kefu Chai
fcc3effd8b crypto: allow PK11 module to load even if it's already initialized
there is chance that other pieces of application loads PK11 module
already and does not finalize it before calling common_init_finish().

also, upon fork, PK11 module resets its entire status including `nsc_init`,
by which PK11 module tell if it is initialized or not. so the behavior
of NSS_InitContext() could be different before and after fork. that's
another reason to ignore CKR_CRYPTOKI_ALREADY_INITIALIZED error (see
NSS_GetError()).

Fixes: http://tracker.ceph.com/issues/19741
Signed-off-by: Kefu Chai <kchai@redhat.com>
2017-06-23 11:31:07 +08:00
wujian
75e56c4c5d common/config_opt: remove unused config
Signed-off-by: alex.wu <wujian3659@163.com>
2017-06-23 05:41:28 +08:00
Matt Benjamin
e12fc13e25 rgw_file: avoid a recursive lane lock in LRU drain
While highly unlikely in normal fs operations, draining an
entire filesystem could induce a recursion on object delete/unref,
when provoked by cohort_lru::drain().

Adjusted to use intrusive slist rather than std:vector<T*>
after review.

Found running librgw_file_nfsns unit test.

Fixes: http://tracker.ceph.com/issues/20374

Signed-off-by: Matt Benjamin <mbenjamin@redhat.com>
2017-06-22 15:00:42 -04:00
Josh Durgin
15ce60830a osd/ReplicatedBackend: reset thread heartbeat after every omap entry in deep-scrub
Doing this every 100 entries could be after 100MB of reads. There's
little cost to reset this, so remove the option for configuring it.

This reduces the likelihood of crashing the osd due to too many omap
values on an object.

Fixes: http://tracker.ceph.com/issues/20375
Signed-off-by: Josh Durgin <jdurgin@redhat.com>
2017-06-21 15:05:49 -07:00
Sage Weil
1e7cd3550c Merge pull request #13683 from liewegas/wip-crush-rulesets
crush: detect and (usually) fix ruleset != rule id

Reviewed-by: Loic Dachary <ldachary@redhat.com>
2017-06-21 08:45:42 -05:00
J. Eric Ivancich
bf70c4b9b0 osd/PG: Add two new mClock implementations of the PG sharded operator queue
Create an mClock priority queue, which can in turn be used for two new
implementations of the PG shards operator queue. The first
(mClockOpClassQueue) prioritizes operations based on which class they
belong to (recovery, scrub, snaptrim, client op, osd subop). The
second (mClockClientQueue) also incorporates the client identifier, in
order to promote fairness between clients.

In addition, also remove OpQueue's remove_by_filter and all possible
associated subclass implementations and tests.

Signed-off-by: J. Eric Ivancich <ivancich@redhat.com>
2017-06-20 23:15:36 -04:00
Sage Weil
503de20927 Merge pull request #15728 from majianpeng/bluefs-remove-memcopy-for-continue-memory
os/bluestore/BlueFS: Rebuild memcopy for bufferlist::page_aligned_app…

Reviewed-by: Sage Weil <sage@redhat.com>
2017-06-20 16:53:45 -05:00
Jianpeng Ma
434656c610 common/buffer: add function bufferlist::claim_append_piecewise(list& bl).
This only useful for bl is bufferlist::page_aligned_appender. Using
this function can remove memcopy for continue ptrs.
Because page_aligned_appender::flush will split a ptr into two or
more ptrs. For this case, rebuild_aligned_size_and_memory can't handle,
it  will rebuild.

For example
a=bl.get_page_aligned_appender(1);
a.append(3K)
a.flush();
t.claim_append(bl);
a.append(1K);
a.flush();
t.claim_append(bl);

dst.claim_append(t);
//3K and 1K ptr are continue in memory. But they are two ptrs..
dst.is_aligned_size_and_memory(4096,4096) is false.

We add new function claim_append_piecewise() to specially
handle this case.

Signed-off-by: Jianpeng Ma <jianpeng.ma@intel.com>
2017-06-21 07:04:51 +08:00
Sage Weil
782b63ae9c Merge pull request #15751 from xiexingguo/wip-add-state-name
src/common/ceph_string: stringify new osd states

Reviewed-by: Kefu Chai <kchai@redhat.com>
2017-06-20 11:16:29 -05:00
Kefu Chai
405d1367ee Merge pull request #15742 from wjwithagen/wip-wjw-freebsd-host-errno-3
common/freebsd_errno.cc: fixed again a stupid typo

Reviewed-by: Kefu Chai <kchai@redhat.com>
2017-06-20 15:36:54 +08:00
Sage Weil
f337b4e75f Merge pull request #15651 from zealoussnow/wip-0613
config_opt: use bool instead of int for the default value of filestore_debug_omap_check
2017-06-19 22:39:55 -05:00
Sage Weil
6743fb203c Merge pull request #15676 from Linbing/wip-mon-delete-unused-config
mon: delete unused config opts of mon_sync_fs_threshold

Reviewed-by: Kefu Chai <kchai@redhat.com>
2017-06-19 22:37:58 -05:00
Sage Weil
80e3b73803 crush: simplify osd_pool_default_crush_rule config
Make an incompat change here with a release note since
this only affects pool creation, a rare event, and folks
who have customized their configs (also rare).

Keep it simple: a config sets the default rule, or else we pick
the first TYPE_REPLICATED pool in the crush map.

Signed-off-by: Sage Weil <sage@redhat.com>
2017-06-19 19:09:06 -04:00
xie xingguo
8467351048 src/common/ceph_string: stringify new osd states
In https://github.com/ceph/ceph/pull/15725 I introduce
two more osd states.

This patch pulls them in.

Signed-off-by: xie xingguo <xie.xingguo@zte.com.cn>
2017-06-19 10:25:13 +08:00
Haomai Wang
226cd6f6fd msg: make listen backlog become a option, increase from 128 to 512
Fixes: http://tracker.ceph.com/issues/20330
Signed-off-by: Haomai Wang <haomai@xsky.com>
2017-06-17 11:57:33 +08:00
Willem Jan Withagen
7b95e81f7d common/freebsd_errno.cc: fixed again a stupid typo
Signed-off-by: Willem Jan Withagen <wjw@digiware.nl>
2017-06-16 23:59:44 +02:00
Willem Jan Withagen
5b29a8f478 common/freebsd_errno.cc: fix missing ;
Signed-off-by: Willem Jan Withagen <wjw@digiware.nl>
2017-06-16 23:36:51 +02:00
Sage Weil
bcc4f9b8cb Merge pull request #15495 from wjwithagen/wip-wjw-freebsd-host-errno
core: introduce (and fix) code to pass errno to other OSes

Reviewed-by: Kefu Chai <kchai@redhat.com>
2017-06-16 16:14:19 -05:00
Sage Weil
94d33248ac Merge pull request #15251 from joscollin/wip-cleanup-redundant-headers-4
common: Remove redundant includes - 4

Reviewed-by: Willem Jan Withagen <wjw@digiware.nl>
2017-06-16 08:45:29 -05:00
Josh Durgin
78d0b278a6 HashIndex: randomize split threshold by a configurable amount
Store a random value up to the filestore_split_rand_factor for each
collection when it is created or apply-layout-settings is run. This
should help distribute the load of splitting directories across a
longer period of time.

Fixes: http://tracker.ceph.com/issues/15835
Signed-off-by: Josh Durgin <jdurgin@redhat.com>
2017-06-15 06:12:19 -07:00
Yanhu Cao
26cb1537c0 common,config: OPT_FLOAT and OPT_DOUBLE output format in "config show"
Fixes: http://tracker.ceph.com/issues/20104

Signed-off-by: Yanhu Cao <gmayyyha@gmail.com>
2017-06-15 10:51:02 +08:00
Yanhu Cao
988271e43d common,config: refactor method md_config_t::_get_val(const char *, char**, int) const
Signed-off-by: Yanhu Cao <gmayyyha@gmail.com>
2017-06-15 10:50:50 +08:00
Yuri Weinstein
3ace41f8d2 Merge pull request #15381 from xiexingguo/wip-noout-osdlist
mon/OSDMonitor: batch OSDs nodown/noout support

Reviewed-by: Josh Durgin <jdurgin@redhat.com>
Reviewed-by: Sage Weil <sage@redhat.com>
Reviewed-by: Piotr Dałek <piotr.dalek@corp.ovh.com>
2017-06-14 13:11:58 -07:00
Yuri Weinstein
5ad4ee86f5 Merge pull request #15535 from gregsfortytwo/wip-jumbo-ping
osd: heartbeat with packets large enough to require working jumbo frames

Reviewed-by: Sage Weil <sage@redhat.com>
Reviewed-by: Haomai Wang <haomai@xsky.com>
Reviewed-by: Josh Durgin <jdurgin@redhat.com>
2017-06-14 13:10:05 -07:00
Kefu Chai
1e1b108bb6 Merge pull request #15376 from tchaikov/wip-remove-boost-submodule
cmake: build boost as an external project

Reviewed-by: Casey Bodley <cbodley@redhat.com>
2017-06-15 00:40:28 +08:00
Kefu Chai
edd41a7015 common: #include <atomic> in headers where atomic<> is used
so these headers are self-contained.

Signed-off-by: Kefu Chai <kchai@redhat.com>
2017-06-14 23:53:50 +08:00
Leo Zhang
7e1dd4faab common: fix option "rados_mon_op_timeout" comment spell error
Signed-off-by: Leo Zhang <nguzcf@gmail.com>
2017-06-14 15:55:03 +08:00
linbing
7fc78257c3 mon: delete unused config opts of mon_sync_fs_threshold and remove it in mon-config-ref
Signed-off-by: linbing <linbing@t2cloud.net>
2017-06-14 13:20:22 +08:00
Matt Benjamin
2b4b718210 Merge pull request #14885 from rzarzynski/wip-rgw-auth-rework-cont-3-awsv4
rgw: continuation of the auth rework -- AWSv4
2017-06-13 17:16:20 -04:00
Greg Farnum
2096113d9e osd: heartbeat with packets large enough to require working jumbo frames.
We get periodic reports that users somehow misconfigure one of their switches
so that it drops jumbo frames, yet the servers are still passing them along. In
that case, MOSDOp messages generally don't get through because they are much
larger than the 1500-byte non-jumbo limit, but the MOSDPing messages have kept
going (as they are very small and dispatched independently, even when the
server is willing to make jumbo frames). This means peer OSDs won't mark down
the ones behind the broken switch, despite all IO hanging.
Push the MOSDPing message size over the 1500-byte limit so that anybody in
this scenario will see the OSDs stuck behind a bad switch get marked down.

Fixes: http://tracker.ceph.com/issues/20087

Signed-off-by: Greg Farnum <gfarnum@redhat.com>
2017-06-13 13:43:29 -07:00
Leo Zhang
6553a7c8de filestore: fix filestore_debug_omap_check option to a default bool value
Signed-off-by: Leo Zhang <nguzcf@gmail.com>
2017-06-13 11:18:28 +08:00
Sage Weil
c7f7500b88 Merge pull request #15615 from joscollin/wip-CID717210-Uninitialized-members
common: initialize _hash in LogEntryKey()

Reviewed-by: xie xingguo <xie.xingguo@zte.com.cn>
2017-06-12 14:12:40 -05:00
Sage Weil
e56f8273e9 Merge pull request #15580 from liewegas/wip-bluestore-memory
os/bluestore: configure rocksdb cache via bluestore_cache_kv_ratio

Reviewed-by: Mark Nelson <mnelson@redhat.com>
2017-06-12 09:57:07 -05:00
Jos Collin
915906dd56 common: initialize _hash in LogEntryKey()
Fixed:

** CID 717210:  Uninitialized members  (UNINIT_CTOR)
ceph/src/common/LogEntry.h: 70 in LogEntryKey::LogEntryKey()()
Non-static class member "_hash" is not initialized in this constructor nor in any functions that it calls.

Signed-off-by: Jos Collin <jcollin@redhat.com>
2017-06-12 08:58:47 +05:30
xie xingguo
4fec5b85f1 mon/OSDMonitor: batch OSDs nodown/noout support
This patch allow us to add batch OSDs(e.g., from a specific host which is currently in maintenance)
into a specific nodown/noout list, which can not be automatically marked down/out
and hence can be eliminated from data migration.

This has the same effect with the global nodown/noout flag but is more fine-grained.

Signed-off-by: xie xingguo <xie.xingguo@zte.com.cn>
2017-06-12 10:08:33 +08:00
Jos Collin
0c651cab73 common: Remove redundant includes
Fixed: error: field has incomplete type 'struct sockaddr_in'

Signed-off-by: Jos Collin <jcollin@redhat.com>
2017-06-10 15:37:55 +05:30
Sage Weil
a423270674 os/bluestore: set bluestore_cache_kv_ratio to configure rocksdb cache size
Devote 40% to kv (rocksdb), 50% to metadata (onodes etc), 10% to data.

Note that if we don't consume the data portion (e.g., no cache hints) that
the onode metadata will "borrow" that space.

Signed-off-by: Sage Weil <sage@redhat.com>
2017-06-09 10:50:56 -04:00
Sage Weil
3990137bf9 kv/RocksDBStore: rocksdb_cache_row_ratio
Specify portion of cache to devote to row cache (the rest goes to the
block cache).

Signed-off-by: Sage Weil <sage@redhat.com>
2017-06-09 10:50:55 -04:00
Sage Weil
c7464183ea kv/RocksDBStore: make rocksdb_cache_type tunable (lru or clock)
"[Clock is] Similar to NewLRUCache, but create a cache based on CLOCK
algorithm with better concurrent performance in some cases. See
[cache]/clock_cache.cc for more detail."

Signed-off-by: Sage Weil <sage@redhat.com>
2017-06-09 09:30:42 -04:00
Willem Jan Withagen
f240406794 common: add empty hostos_to_ceph_errno(), to allow linking to work
Signed-off-by: Willem Jan Withagen <wjw@digiware.nl>
2017-06-09 10:14:46 +02:00
Willem Jan Withagen
3186524633 common/freebsd_errno.cc: ceph_to_host and host_toc_ceph errno translation
Signed-off-by: Willem Jan Withagen <wjw@digiware.nl>
2017-06-09 10:14:46 +02:00
Willem Jan Withagen
8392c25523 core: introduce (and fix) code to pass errno to other OSes
- Some of the errno conversions were lost in the conversion
   to Cmake config
 - rename ceph_to_host_errno to _ceph_to_hostos_errno
   to indicate that the errnos are define per OS.

This is the second part, creating the basics.
Next it needs to be glued into communication with the peers.

Signed-off-by: Willem Jan Withagen <wjw@digiware.nl>
2017-06-09 10:14:45 +02:00
Sage Weil
f7187559af Merge pull request #15100 from kestrels/wip-crc32c-fastzero2
crc32c: Add ppc64le fast zero optimized assembly.

Reviewed-By: Piotr Dałek <piotr.dalek@corp.ovh.com>
2017-06-08 20:39:59 -05:00
Sage Weil
c2e346cf12 Merge pull request #15562 from tchaikov/wip-no-assert.h
common,osdc: remove atomic_t completely

Reviewed-by: Sage Weil <sage@redhat.com>
2017-06-08 20:38:23 -05:00
Casey Bodley
babd25fa36 Merge pull request #15301 from shashalu/rgw-ssl
rgw: add "rgw_verify_ssl" config

Reviewed-by: Casey Bodley <cbodley@redhat.com>
2017-06-08 16:01:47 -04:00