Commit Graph

43156 Commits

Author SHA1 Message Date
David Disseldorp
85a894697e systemd: activate disks via systemd service instead of udev
The udev(7) man page states:
  RUN
  ...
  This can only be used for very short-running foreground tasks. Running
  an event process for a long period of time may block all further
  events for this or a dependent device.

  Starting daemons or other long-running processes is not appropriate
  for udev; the forked processes, detached or not, will be
  unconditionally killed after the event handling has finished.

ceph-disk activate is far from a short-running task:
- check whether path is a block dev, for dirs call through to
  activate_dir()
- call blkid to obtain the filesystem type for the block dev
- pull mount options from hard-coded ceph.conf file
- mount the OSD dev at a temporary path
- check the ceph magic for mounted filesystem
- read cluster uuid and locate corresponding /etc/ceph/{cluster}.conf
  path
- read or generate (if missing) the OSD uuid
- create a file indicating init system usage (systemd)
- mount the device at a second (final) location
- umount (lazy) the temporary mount path
- enable the systemd ceph-osd@{osd_id} service
- start the systemd ceph-osd@{osd_id} service

This logic is therefore best left in a systemd service for execution. As
it is less limited in terms of execution time, and also allows for
improved event handling in future (fsck, dmcrypt mapping etc.).

This change sees 95-ceph-osd.rules.systemd trigger ceph-disk activate or
ceph-disk activate-journal via new ceph-disk-activate-journal@.service,
ceph-disk-activate@.service and ceph-disk-dmcrypt-activate@.service
systemd service files.

ceph-disk-dmcrypt-activate@.service makes use of the newly added
--dmcrypt parameter for ceph-disk activate.

Signed-off-by: David Disseldorp <ddiss@suse.de>
2015-08-01 09:58:34 -04:00
Sage Weil
ac16d83914 ceph.spec: use sysvinit rbdmap script for now
Signed-off-by: Sage Weil <sage@redhat.com>
2015-08-01 09:58:34 -04:00
David Disseldorp
29431944c7 ceph-disk: map dmcrypt devices prior to activation
Support mapping of dmcrypt devices during activation via the new
ceph-disk activate[-journal] --dmcrypt and --dmcrypt-key-dir parameters.

Signed-off-by: David Disseldorp <ddiss@suse.de>
2015-08-01 09:58:34 -04:00
David Disseldorp
4fd9cf2710 ceph-disk: split get_dmcrypt_key_path from key creation
In preparation for mapping dmcrypt cyphertext devs during activation.

Signed-off-by: David Disseldorp <ddiss@suse.de>
2015-08-01 09:58:34 -04:00
David Disseldorp
6cfb4b35ea ceph-disk: add --log-stdout parameter
This can be used when ceph-disk is run by systemd services, to ensure
that output is captured in the journal.

Signed-off-by: David Disseldorp <ddiss@suse.de>
2015-08-01 09:58:34 -04:00
Sage Weil
d1ce1782ce ceph.spec: no rcceph[-radosgw] with systemd
Signed-off-by: Sage Weil <sage@redhat.com>
2015-08-01 09:58:33 -04:00
Sage Weil
6842a20915 systemd: add ceph-create-keys@ service
Signed-off-by: Sage Weil <sage@redhat.com>
2015-08-01 09:58:33 -04:00
Sage Weil
e283222d0a ceph.spec: include systemd units files
Signed-off-by: Sage Weil <sage@redhat.com>
2015-08-01 09:58:33 -04:00
Sage Weil
43d6b12149 system: include all unit files
Signed-off-by: Sage Weil <sage@redhat.com>
2015-08-01 09:58:33 -04:00
Owen Synge
1ba4694d7e Autotools to install systemd unit files.
To simplify the spec file we should install as much using autotools
and as little as possible in the spec file.

Signed-off-by: Owen Synge <osynge@suse.com>
2015-08-01 09:58:33 -04:00
Owen Synge
d6213b61ab Add unit files to the spec file.
%{_unitdir}/ceph-mds@.service
%{_unitdir}/ceph-mon@.service
%{_unitdir}/ceph-osd@.service
%{_unitdir}/ceph.target

Signed-off-by: Owen Synge <osynge@suse.com>
2015-08-01 09:58:33 -04:00
Owen Synge
be4f878aaf radosgw systemd prestart moved to systemd
prestart scripts are going to be added to systemd to simplify the switching behavior.

Signed-off-by: Owen Synge <osynge@suse.com>
2015-08-01 09:58:33 -04:00
Owen Synge
fbc85e3ce1 radosgw systemd support
Added a radosgw systemd support and associated prestart script.
  - With improved checking over first revison.
  - ceph-radosgw-prestart.sh now installed in /usr/lib/ceph-radosgw

Signed-off-by: Owen Synge <osynge@suse.com>
2015-08-01 09:58:33 -04:00
Owen Synge
ef961be507 ceph.spec.in: Change redhat defaults for rgw
Changes
		--with-rgw-user=$USER \
		--with-rgw-group=$GROUP \

to
    USER=root
    GROUP=root

from
    USER=apache
    GROUP=apache

Signed-off-by: Owen Synge <osynge@suse.com>
2015-08-01 09:58:33 -04:00
Owen Synge
61240190c7 Added tmpfiles.d for rgw: templated user and group.
tmpfiles.d are part of system.d and define how temporary directories are setup.
rgw needs a socket directory. To do this we template tmpfiles.d user and group
for rgw and fill in the values using autotools.

Note1: Added to spec file.
Note2: Name changed to rgw from radosgw as is preferred name by Sage.
Note3: Adds configure options
    --with-rgw-user=UserName
    --with-rgw-group=GroupName
Note4: Defaults set for debian
Note5: spec file overrides defaults for redhat and suse

Signed-off-by: Owen Synge <osynge@suse.com>
2015-08-01 09:58:33 -04:00
Owen Synge
95db160da3 ceph.spec.in:Update rpm hooks and file content
Take rpm hooks from SUSE rpm and move upstream.
These are tested on SLE12 to include the correct files.

Signed-off-by: Owen Synge <osynge@suse.com>
2015-08-01 09:58:33 -04:00
Orit Wasserman
ef86e29259 Merge pull request #5445 from ceph/wip-12432
Wip 12432
2015-07-31 21:39:04 +02:00
Yehuda Sadeh
b8e28ab9f9 rgw: set http status in civetweb
Need to set the http status in civetweb so that we report it correctly.
Fixes: #12432

Signed-off-by: Yehuda Sadeh <yehuda@redhat.com>
2015-07-31 11:09:53 -07:00
Yehuda Sadeh
0451f19341 civetweb: update submodule to support setting of http status
Signed-off-by: Yehuda Sadeh <yehuda@redhat.com>
2015-07-31 11:09:53 -07:00
Yehuda Sadeh
c8653b11a8 Merge pull request #5258 from zhouyuan/rgw_skip_first_chunk
rgw: skip prefetch first chunk if range get falls to shadow objects

Reviewed-by: Yehuda Sadeh <yehuda@redhat.com>
2015-07-31 13:25:46 -04:00
Ilya Dryomov
3fbcf5e265 doc: krbd supports clones since 3.10
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
2015-07-31 19:50:58 +03:00
Loic Dachary
a9cb1b89f9 Merge pull request #5438 from ceph/fix-doc-build
doc: fix the build of placement-groups.rst

Reviewed-by: Kefu Chai <kchai@redhat.com>
2015-07-31 12:29:04 +02:00
Kefu Chai
81afcc206d doc: fix the build of placement-groups.rst
add a reference target of "mapping pgs to osds"

Signed-off-by: Kefu Chai <kchai@redhat.com>
2015-07-31 17:08:20 +08:00
Kefu Chai
f008440765 Merge pull request #5432 from ceph/wip-fix-rbd-build
make: fix the build of "rbd"

Reviewed-by: Loic Dachary <ldachary@redhat.com>
2015-07-31 16:47:55 +08:00
Loic Dachary
2d90da863c Merge pull request #5434 from tobegit3hub/remove_execute_mode
Remove execute mode of source files

Reviewed-by: Loic Dachary <ldachary@redhat.com>
2015-07-31 09:55:01 +02:00
tobe
f8554f9b8e Remove execute mode of source files 2015-07-31 15:47:43 +08:00
Haomai Wang
1a2f29050a Merge pull request #5398 from mingyuez/master
rbd:If the image has any protected snaps,'rbd snap purge image' will return failure without removing any snaps.

Reviewed-by: Josh During <jdurgin@redhat.com>
Reviewed-by: Haomai Wang <haomaiwang@gmail.com>
2015-07-31 15:41:32 +08:00
Kefu Chai
b255b4c51c make: fix the build of "rbd"
`CEPH_GLOBAL` was removed in fa78739, but the linked libraries does not
offer all needed symbols for "rbd". so add them back.

Signed-off-by: Kefu Chai <kchai@redhat.com>
2015-07-31 14:45:55 +08:00
mingyuez
8a7a52dd93 rbd:'rbd purge image' will return failure without removing any snaps if the image has a protected snap
Signed-off-by: mingyuez <zhao.mingyue@h3c.com>
2015-07-31 12:06:12 +08:00
Kefu Chai
d5142ba29e Merge pull request #5395 from tchaikov/wip-12512
common/syncfs: fall back to sync(2) if syncfs(2) not available

Reviewed-by: Haomai Wang <haomaiwang@gmail.com>
Reviewed-by: Sage Weil <sage@redhat.com>
Reviewed-by: Loic Dachary <ldachary@redhat.com>
2015-07-31 10:24:30 +08:00
Kefu Chai
f705d8c7e4 Merge pull request #5402 from ceph/wip-claim-sparse-read-buffer
osd/ReplicatedPG: claim the read buffer instead of copying it

Reviewed-by: David Zafman <dzafman@redhat.com>
2015-07-31 10:14:02 +08:00
Sage Weil
b7e5d2af47 Merge pull request #5428 from ceph/wip-kill-rest-bench
kill rest-bench

Reviewed-by: Ken Dreyer <kdreyer@redhat.com>
2015-07-30 22:13:40 -04:00
Yuan Zhou
95745550ce rgw: skip prefetch first chunk if range get falls to shadow objects
Currently the head object will be prefetched in each GET:
 a) This is unnecessary if the Range GET falls to shadow objects.
 b) The GET request would be quite slow if we have a big head object
This patch adds some check on the Range. If it's not in the head
object(>=rgw_max_chunk_size) then skip the prefetch.

Fixes: #12539
Signed-off-by: Yuan Zhou <yuan.zhou@intel.com>
2015-07-31 08:42:00 +08:00
Josh Durgin
03491ae843 Merge remote-tracking branch 'origin/next' 2015-07-30 16:35:01 -07:00
Josh Durgin
27fa210f40 Merge pull request #5425 from ceph/wip-12479-next
librbd: test crash during client upgrade suite

Reviewed-by: Josh Durgin <jdurgin@redhat.com>
2015-07-30 16:26:51 -07:00
Sage Weil
ca40bf0b30 Merge pull request #5423 from oddomatik/patch-1
doc: No CRUSH involvement in deciding PG target

Reviewed-by: Sage Weil <sage@redhat.com>
2015-07-30 17:32:52 -04:00
Josh Durgin
04d8766264 Merge pull request #5426 from ceph/wip-12383-next
rbd: remove dependency on non-ABI controlled CephContext

Reviewed-by: Josh Durgin <jdurgin@redhat.com>
2015-07-30 14:08:32 -07:00
Josh Durgin
115f370634 Merge pull request #5399 from tchaikov/wip-12458
rbd: add "--keyring" option to help message

Reviewed-by: Josh Durgin <jdurgin@redhat.com>
2015-07-30 14:00:15 -07:00
Yehuda Sadeh
d621d9878c Merge pull request #5414 from cxwshawn/master
doc: add bucket object version description.

Reviewed-by: Yehuda Sadeh <yehuda@redhat.com>
2015-07-30 13:52:06 -04:00
Sage Weil
a634ab34b2 remove libs3 submodule
Signed-off-by: Sage Weil <sage@redhat.com>
2015-07-30 13:24:00 -04:00
Sage Weil
bbe84578bf remove rest-bench
This is a weak tool; users should look to cosbench or others instead.

Signed-off-by: Sage Weil <sage@redhat.com>
2015-07-30 13:21:36 -04:00
Josh Durgin
744a71a81c Merge pull request #5419 from ceph/wip-kfsx-invalidate
test_librbd_fsx: invalidate before discard in krbd mode

Reviewed-by: Josh Durgin <jdurgin@redhat.com>
2015-07-30 09:25:30 -07:00
oddomatik
77cdb500af No CRUSH involvement in deciding PG target
Quoting from elsewhere "[we calculate] a placement group using the object name, a hash code, the number of PGs in the pool and the pool name"
2015-07-30 22:33:09 +08:00
Jason Dillaman
af0cade029 lockdep: allow lockdep to be dynamically enabled/disabled
librbd test cases attempt to enable lockdep coverage via the librados
API.  Use a configuration observer to register/unregister lockdep
support.

Signed-off-by: Jason Dillaman <dillaman@redhat.com>
2015-07-30 09:01:54 -04:00
Jason Dillaman
2c51aadb44 tests: librbd API test cannot use private md_config_t struct
Remove all depencencies on md_config_t and instead use librados API
methods to get/set configuration values.

Fixes: #12479
Backport: hammer
Signed-off-by: Jason Dillaman <dillaman@redhat.com>
2015-07-30 09:01:53 -04:00
Jason Dillaman
4d03c664f2 librados_test_stub: implement conf get/set API methods
Signed-off-by: Jason Dillaman <dillaman@redhat.com>
2015-07-30 09:01:36 -04:00
Kefu Chai
258cb348d6 rbd: add "--keyring" option to help message
Refs: #12458
Signed-off-by: Kefu Chai <kchai@redhat.com>
2015-07-30 11:56:29 +08:00
Kefu Chai
7fbf013d44 Merge pull request #5401 from ceph/wip-12450
tools/rados: change the default max_ops to 16

Reviewed-by: David Zafman <dzafman@redhat.com>
2015-07-30 11:36:37 +08:00
shawn
5c395ff856 doc: add bucket object version description.
bucket object version has been supported, but do not have description in the docs,
so add this part.

Signed-off-by: shawn chen <cxwshawn@gmail.com>
2015-07-30 10:09:16 +08:00
Ilya Dryomov
f217865cf7 test_librbd_fsx: invalidate before discard in krbd mode
Commit bd050240ce ("test_librbd_fsx: flush before discard in krbd
mode") added an fsync() before BLKDISCARD.  Don't know what I was
thinking at the time, but I missed the invalidate part, for which we
need to use the BLKFLSBUF ioctl.

Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
2015-07-29 21:01:08 +03:00