Commit Graph

57037 Commits

Author SHA1 Message Date
Kefu Chai
20320f3091 msg/async: fix compiler warnings
fix warnings like
```
comparison between signed and unsigned integer expressions
[-Wsign-compare]
```

Signed-off-by: Kefu Chai <kchai@redhat.com>
2016-08-17 14:38:46 +08:00
Kefu Chai
6c55d73cef cls_rgw: fix the compiler warning
fixes the warning of
```
warning:
/srv/autobuild-ceph/gitbuilder.git/build/out~/ceph-11.0.0-1566-ga98ddf7/src/objclass/objclass.h:35:72:
format ‘%lu’ expects argument of type ‘long unsigned int’, but argument
6 has type ‘std::basic_string::size_type {aka unsigned int}’ [-Wformat=]
cls_log(level, " %s:%d: " fmt, __FILE__, __LINE__, ##__VA_ARGS__)
^
/srv/autobuild-ceph/gitbuilder.git/build/out~/ceph-11.0.0-1566-ga98ddf7/src/cls/rgw/cls_rgw.cc:477:7:
note: in expansion of macro ‘CLS_LOG’
CLS_LOG(20, "start_key=%s len=%lu", start_key.c_str(),
start_key.size());
^
```

Signed-off-by: Kefu Chai <kchai@redhat.com>
2016-08-17 14:31:17 +08:00
Jiaying Ren
befac18a3f rgw: fix flush_read_list() error msg
Signed-off-by: Jiaying Ren <jiaying.ren@umcloud.com>
2016-08-17 14:19:48 +08:00
oliveiradan
f1ad760366 test: gcc 6.1.1 complains about missing include: <random>. 4.8.3 does not complain about it
Signed-off-by: Daniel Oliveira <doliveira@suse.com>
2016-08-16 23:22:49 -06:00
xie xingguo
fa33357c8a mon/LogMonitor: remove "host" and "fsid" from handle_conf_change()
Because these two fields are not used and tracked.

Signed-off-by: xie xingguo <xie.xingguo@zte.com.cn>
2016-08-17 12:37:13 +08:00
xie xingguo
e3f618906d osd/OSDMonitor: drop redundant check of assert
Below here version can never be identical to osdmap.epoch,
otherwise we shall have returned above.

Signed-off-by: xie xingguo <xie.xingguo@zte.com.cn>
2016-08-17 12:37:13 +08:00
xie xingguo
20327d6516 osd/OSDMonitor: drop redundant null check of max_failed_since
Because the "max_failed_since < failed_since" will catch both.

Signed-off-by: xie xingguo <xie.xingguo@zte.com.cn>
2016-08-17 12:37:13 +08:00
xie xingguo
fcae36d119 mon/OSDMonitor: add sanity check before setting use_gmt_hitset attribute
As "use_gmt_hitset" is a tier-specified attribute which is not applicable
for normal pools.

Signed-off-by: xie xingguo <xie.xingguo@zte.com.cn>
2016-08-17 12:37:13 +08:00
Kefu Chai
a98ddf708e rgw: do not try to encode or decode time_t
time_t is `signed int` on linux, which is ambiguous when encode() or decode() on i386-linux.
see also 8f9e7b0b.

Signed-off-by: Kefu Chai <kchai@redhat.com>
2016-08-17 12:15:08 +08:00
Kefu Chai
e354918ec8 Merge pull request #10264 from yuyuyu101/wip-async-abstract-backend
msg/async: allow other async backend implementations

Reviewed-by: Kefu Chai <kchai@redhat.com>
2016-08-17 02:18:39 +08:00
Samuel Just
200cae8c9d PG: use upset rather than up for _update_calc_stats
Fixes: http://tracker.ceph.com/issues/16998
Signed-off-by: Samuel Just <sjust@redhat.com>
2016-08-16 09:44:38 -07:00
Haomai Wang
f6c3fd9994 test_msgr: ensure wait for ms_dispatch executed
Otherwise in slow runner, ms_dispatch may not executed when assert

Signed-off-by: Haomai Wang <haomai@xsky.com>
2016-08-16 23:19:25 +08:00
Haomai Wang
9bfd11e7f9 msg/async/Event: remove global_centers assert
In tests we allow to reset EventCenter instance in the same CephContext,
so it may let global_centers->centers to set the same position multi times.

Signed-off-by: Haomai Wang <haomai@xsky.com>
2016-08-16 23:19:25 +08:00
Haomai Wang
6d3e495de2 test_async_networkstack: add networkstack tests
Signed-off-by: Haomai Wang <haomai@xsky.com>
2016-08-16 23:19:25 +08:00
Haomai Wang
3a43a0bb34 msg/async/AsyncConnection: fix _conn_prefix racing when stopped
When the connection is lossy and enter fault, it will dispatch reset event.
If cleanup handler is executed as well as ms_handle_reset call mark_down,
it may exists racing for "cs". cleanup handler will reset "cs" but
_conn_prefix in mark_down will access "cs".

Signed-off-by: Haomai Wang <haomai@xsky.com>
2016-08-16 23:19:25 +08:00
Haomai Wang
1d4ff2a30a msg/async: readd set_priority call
Signed-off-by: Haomai Wang <haomai@xsky.com>
2016-08-16 23:19:25 +08:00
Haomai Wang
154376b211 msg/async: allow EventCenter::set_owner reentry
If daemonlize we need to respawn event threads, it need to allow set_owner again

Signed-off-by: Haomai Wang <haomai@xsky.com>
2016-08-16 23:19:25 +08:00
Haomai Wang
8d63e2c709 msg/async/Stack: register fork watcher
Signed-off-by: Haomai Wang <haomai@xsky.com>
2016-08-16 23:19:25 +08:00
Haomai Wang
524553ff31 common/ceph_context: add prefork/postfork wathcher support
Because daemon() will termniate all existing threads, it will make something go
wrong.

So we want to add hook at CephContext, do something before/after fork.

Signed-off-by: Haomai Wang <haomai@xsky.com>
2016-08-16 23:19:25 +08:00
Haomai Wang
31833e8b48 msg/async/Stack: disable smart thread spawn now
New async msgr runtime need to spawn threads when binding, but ceph-osd will
call daemon() after binding port. So we need to respawn threads if forked.

Then thread spawn delay will increase complexity for this change and it's
really a simple strategy which help less, we disable auto spawn now.

Signed-off-by: Haomai Wang <haomai@xsky.com>
2016-08-16 23:19:23 +08:00
Haomai Wang
4e57181b54 msg/async/PosixStack: increase log level
AsyncMessenger will try to loop the bind port range, so it will produce
some addr inuse errors which is not abnormal.

Signed-off-by: Haomai Wang <haomai@xsky.com>
2016-08-16 23:17:55 +08:00
Haomai Wang
f62f28ceea msg/async/Event: remove event wakeup flag
Now only dispatch external event will wakeup event thread(previously
delete_time_event will call wakeup), we only need to use
"external_num_events" to indicate whether we have extra events.

Signed-off-by: Haomai Wang <haomai@xsky.com>
2016-08-16 23:17:55 +08:00
Haomai Wang
fca0de1f07 msg/async/Event: debug event address when dispatching and executing
Signed-off-by: Haomai Wang <haomai@xsky.com>
2016-08-16 23:17:55 +08:00
Haomai Wang
d0cd88b3ee msg/async/AsyncConnection: support NetworkStack api instead of posix
1. replace sd to ConnectedSocket
2. Replace WorkerPool with Stack
3. Use Stack worker

Signed-off-by: Haomai Wang <haomai@xsky.com>
2016-08-16 23:17:55 +08:00
Haomai Wang
57629c6700 msg/async/net_handler: let set_socket_options return value
Signed-off-by: Haomai Wang <haomai@xsky.com>
2016-08-16 23:17:55 +08:00
Haomai Wang
31bbe39ac2 msg/async: add PosixStack support
Add default posix backend support, it should be the full replacement for
the original AsyncMessenger IO logics.

Signed-off-by: Haomai Wang <haomai@xsky.com>
2016-08-16 23:17:55 +08:00
Haomai Wang
0ba42237e2 msg/async/Stack: add abstract Stack
Stack is a network IO framework which encapsulates all necessary basic network
interface, then it manages threads to work.

Different network backend like posix, dpdk even RDMA need to inherit Stack
class to implement necessary interfaces. So it will make ease for other
network backend to integrated into ceph. Otherwise, each backend need to
implement the whole Messenger logics like reconnect, policy handle, session
maintain...

Signed-off-by: Haomai Wang <haomai@xsky.com>
2016-08-16 23:16:07 +08:00
Casey Bodley
ced2eb2c73 rgw: fix for assertion in RGWMetaSyncCR
while testing with multiple gateways per zone, i started seeing
omap-get-keys requests fail with EIO. this led to a failed
'assert(next)' in RGWMetaSyncCR due to a bug in error handling

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

Signed-off-by: Casey Bodley <cbodley@redhat.com>
2016-08-16 11:00:20 -04:00
MinSheng Lin
7f4e147885 doc: remove the description of deleted options
Fixes: http://tracker.ceph.com/issues/17041

Signed-off-by: MinSheng Lin <minsheng.l@inwinstack.com>
2016-08-16 22:13:12 +08:00
Jason Dillaman
3545d9ed19 test: fixed unused function warnings in unittest_rbd_mirror
Signed-off-by: Jason Dillaman <dillaman@redhat.com>
2016-08-16 09:11:07 -04:00
Jason Dillaman
beaef377d6 rbd-mirror: prevent syncing to non-primary image after failover
Signed-off-by: Jason Dillaman <dillaman@redhat.com>
2016-08-16 09:11:07 -04:00
Jason Dillaman
a6901ca1a0 rbd-mirror: demote/promote in same cluster results in split-brain
Fixes: http://tracker.ceph.com/issues/16855
Signed-off-by: Jason Dillaman <dillaman@redhat.com>
2016-08-16 09:11:07 -04:00
Jason Dillaman
ac590e85a4 librbd: normalize journal promotion/demotion events
A non-primary image's commit possition won't accurately reflect
the current demotion/promotion chain. Therefore, directly specify
the predecessor for promotion events.

Signed-off-by: Jason Dillaman <dillaman@redhat.com>
2016-08-16 09:11:07 -04:00
Jason Dillaman
8b195e1fc8 librbd: block RPC requests when demoting the image
Signed-off-by: Jason Dillaman <dillaman@redhat.com>
2016-08-16 09:11:07 -04:00
Jason Dillaman
718befdae7 librbd: separate journal::TagData predecessor data into new struct
Signed-off-by: Jason Dillaman <dillaman@redhat.com>
2016-08-16 09:11:06 -04:00
Jason Dillaman
47d1e62500 rbd-mirror: include tag tid in bootstrap debug log messages
Signed-off-by: Jason Dillaman <dillaman@redhat.com>
2016-08-16 09:09:52 -04:00
Jason Dillaman
e6aa18ea0d qa/workunits/rbd: demote/promote image on same cluster
Signed-off-by: Jason Dillaman <dillaman@redhat.com>
2016-08-16 09:09:52 -04:00
Yan, Zheng
bb5f0327bf Merge pull request #10691 from ceph/wip-jlayton-dotdot
Clean up handling of "/.." in ceph client
2016-08-16 08:08:17 -05:00
Mykola Golub
e012d555e4 Merge pull request #10733 from dillaman/wip-16608
rbdmap: specify bash shell interpreter

Reviewed-by: Mykola Golub <mgolub@mirantis.com>
2016-08-16 16:05:57 +03:00
Ilya Dryomov
c05ee0de78 Merge pull request #10735 from dillaman/wip-17030
librbd: always respond to "release lock" request if lock owner

Reviewed-off-by: Ilya Dryomov <idryomov@gmail.com>
2016-08-16 14:58:56 +02:00
Mykola Golub
0a9ccf2b96 Merge pull request #10712 from dillaman/wip-16740
librbd: permit disabling journaling if in corrupt state

Reviewed-by: Mykola Golub <mgolub@mirantis.com>
2016-08-16 15:54:40 +03:00
Mykola Golub
e8363da6ab Merge pull request #10711 from dillaman/wip-16984
librbd: fix possible inconsistent state when disabling mirroring fails

Reviewed-by: Mykola Golub <mgolub@mirantis.com>
2016-08-16 15:51:48 +03:00
Mykola Golub
9f2c559984 Merge pull request #10708 from dillaman/wip-16967
rbd: bench io-size should not be larger than image size

Reviewed-by: Mykola Golub <mgolub@mirantis.com>
2016-08-16 15:50:19 +03:00
Mykola Golub
062362befb Merge pull request #10714 from dillaman/wip-16529
qa/workunits: support filtering cls_rbd unit test cases

Reviewed-by: Mykola Golub <mgolub@mirantis.com>
2016-08-16 15:48:40 +03:00
Loic Dachary
10e9a2748d Merge pull request #9688 from shylesh/wip-16280
ceph-disk: change ownership of initfile to ceph:ceph

Reviewed-by: Loic Dachary <ldachary@redhat.com>
2016-08-16 14:43:32 +02:00
Josh Durgin
0b84e0d45d Merge pull request #10376 from onyb/wip-rbd-pypi
pybind: Rework rbd/setup.py for PyPI

Reviewed-by: Kefu Chai <kchai@redhat.com>
Reviewed-by: Jason Dillaman <dillaman@redhat.com>
Reviewed-by: Josh Durgin <jdurgin@redhat.com>
2016-08-16 00:05:24 -07:00
weiqiaomiao
ea5d7fdd7f rgw: fix radosgw daemon core when reopen logs
the rgw_user_st_syn thread use the pointer meta_mgr in RGWUserStatsCache::sync_all_users() fuction, so we should close the thread before delete the pointer in RGWRados::finalize() function when close storage before reopen_logs.

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

Signed-off-by: weiqiaomiao <wei.qiaomiao@zte.com.cn>
2016-08-16 14:39:45 +08:00
Kefu Chai
1515e08e7d osd: set objecter.osdmap when starts
if any OSD is full or the pause flag is set in cluster, objecter will
always try to subscribe the next osdmap using the mon client shared with
OSD. but if the OSD's osdmap is very far behind on osd maps due to some
reasons, `MonClient::sub_want_increment()` will reject the subscribe
request from OSD, because it's asking for older maps while the mon client
is about to send the request from objecter for the *next* osdmap.

so we need to update objecter with the latest local osdmap, so it is
able to skip the new osdmaps if OSD needs to catch up with the cluster
first.

Fixes: http://tracker.ceph.com/issues/17023
Signed-off-by: Kefu Chai <kchai@redhat.com>
2016-08-16 09:19:39 +08:00
Kefu Chai
550814900e mon/MonClient: should update sub_sent with sub_new
std::map::insert() does not overwrite existing items with the same key.
so we need to do this in a different way. and we will check sub_sent
aftewards, so we need to keep an updated sub_sent around.

Fixes: http://tracker.ceph.com/issues/17023
Signed-off-by: Kefu Chai <kchai@redhat.com>
2016-08-16 09:19:39 +08:00
Jason Dillaman
d8e7946fff librbd: always respond to "release lock" request if lock owner
Fixes: http://tracker.ceph.com/issues/17030
Signed-off-by: Jason Dillaman <dillaman@redhat.com>
2016-08-15 17:37:30 -04:00