Commit Graph

33224 Commits

Author SHA1 Message Date
Gregory Farnum
a84ae7b14e Merge pull request #4343 from ceph/wip-11356
client: fix uninline data funtion

Reviewed-by: Sage Weil <sage@redhat.com>
Reviewed-by: Greg Farnum <gfarnum@redhat.com>
2015-04-19 17:53:52 -07:00
Gregory Farnum
0f2de92db3 Merge pull request #4223 from ceph/wip-11254
mds: make sure lock state not stay in XLOCK/XLOCKDONE indefinitely

Reviewed-by: Greg Farnum <gfarnum@redhat.com>
2015-04-19 17:53:00 -07:00
Gregory Farnum
0b94bf547d Merge pull request #4218 from ceph/wip-11048
mds: persist completed_requests reliably

Reviewed-by: Greg Farnum <gfarnum@redhat.com>
2015-04-19 17:52:09 -07:00
Gregory Farnum
b25e9e130b Merge pull request #4204 from ceph/wip-10368-mk3
mds: separate MDLog::safe_pos from journaler

Reviewed-by: Greg Farnum <gfarnum@redhat.com>
2015-04-19 17:51:12 -07:00
Mykola Golub
cc5f144a51 mon: osd df: fix average_util calculation
average_util should be calculated from the same set of nodes that
dump_item considers when calculating the stddev.

While here, remove unnecessary check for kb > 0:
get_bucket_utilization returns false if kb <= 0.

Also, update get_bucket_utilization accordingly to the preferred
convention to use pointers and not references for output arguments.

Signed-off-by: Mykola Golub <mgolub@mirantis.com>
2015-04-19 20:18:24 +03:00
Ilya Dryomov
e4ebe10894 test/cli-integration/rbd: add unmap test
Add a test to exercise rbd unmap.  This was inspired by and is mostly
for rbd unmap <image-name> (aka spec), but rbd unmap <device> is tested
as well.  Any significant change to krbd.cc or corresponding rbd cli
should be tested in the following three configurations at least:

- kernel < 3.14
- kernel >= 3.14, rbd.single_major=N
- kernel >= 3.14, rbd.single_major=Y

Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
2015-04-19 14:45:37 +03:00
Ilya Dryomov
b1d3f918fb rbd: allow unmapping by spec
Make use of krbd_unmap_by_spec() and allow unmapping by <image-name>
(i.e. pool/image@snap spec) with a bunch of careful adjustments to the
fragile command args/options parsing process to make --pool, --image
and --snap options work as expected for rbd unmap <image-name> case.

Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
2015-04-19 14:45:37 +03:00
Ilya Dryomov
087ed06340 krbd: add krbd_unmap_by_spec()
Make unmapping by (pool, image, snap) spec possible.  For specs mapped
multiple times unmap one device per krbd_unmap_by_spec() call.

Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
2015-04-19 14:41:53 +03:00
Ilya Dryomov
a1363c41f2 krbd: rename should_match_minor() to have_minor_attr()
Rename and clarify why simply checking kernel version doesn't work.

Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
2015-04-19 14:41:53 +03:00
Yan, Zheng
7df2cf243b client: drop inode when rmdir request finishes
Current client code relies on cap message to trim unlinked inode
from cache. This method is too sensitive to message ordering. If
client receives the cap message while directory inode still contains
dentries that are referenced by unsafe requests, the inode can't
get trimmed.

The fix is, when rmdir/rename request finishes, try trimming the
unlinked inode again.

Fixes: #11339
Signed-off-by: Yan, Zheng <zyan@redhat.com>
2015-04-19 11:01:08 +08:00
Josh Durgin
69e3ec8a6b Merge pull request #4380 from ceph/wip-nodebug-build
tests: separate check_PROGRAMS from TESTS

Reviewed-by: Josh Durgin <jdurgin@redhat.com>
2015-04-17 21:52:21 -07:00
Jason Dillaman
933332be6f tests: separate check_PROGRAMS from TESTS
Not all programs that should be built during 'make check' should
be executed as tests.  A new variable, check_TESTPROGRAMS, was
introduced to specify which programs should be executed as a test
during a 'make check'.

Signed-off-by: Jason Dillaman <dillaman@redhat.com>
2015-04-17 20:08:59 -04:00
Sage Weil
4a1de06128 Merge pull request #4311 from yuyuyu101/wip-async-fix-4
Wip async fix 4

Reviewed-by: Sage Weil <sage@redhat.com>
2015-04-17 10:58:53 -07:00
Sage Weil
e948a3c659 Merge pull request #4358 from gerhardqux/gerhardqux-nokey-exit-1
ceph-authtool: exit(1) when printing a non-existing key

Reviewed-by: Sage Weil <sage@redhat.com>
2015-04-16 10:14:23 -07:00
Samuel Just
27aac3d070 Merge pull request #4012 from majianpeng/cache-tier-fadvise
Cache tier fadvise

Reviewed-by: Sage Weil <sage@redhat.com>
2015-04-16 09:58:55 -07:00
Samuel Just
1ee0a7101b Merge pull request #3606 from wonzhq/hitset-insert
osd: avoid inserting an op into hit set multiple times

Reviewed-by: Sage Weil <sage@redhat.com>
2015-04-16 09:58:17 -07:00
Gerhard Muntingh
16a3fbd56b ceph-authtool: exit(1) when printing a non-existing key
When printing a non-existing key, ceph-authtool exits with a success
value:

[root@ip-172-31-3-178 ~]# ceph-authtool /etc/ceph/ceph.mon.keyring -p -n
client.doesntexist ; echo $?
entity client.doesntexist not found
0

Expected result: 1

Signed-off-by: Gerhard Muntingh <gerhard@qux.nl>
2015-04-16 16:42:13 +02:00
Kefu Chai
409cd51692 Merge pull request #4339 from ceph/wip-da-SCA-20150317
Various SCA and Coverity fixes

Reviewed-by: Kefu Chai <kchai@redhat.com>
2015-04-16 14:46:26 +08:00
Loic Dachary
414b613255 Merge pull request #4367 from ceph/wip-ceph-disk-default-cluster
ceph-disk: set '--cluster=ceph' in 'prepare' subcommand

Reviewed-by: Loic Dachary <ldachary@redhat.com>
2015-04-16 08:41:27 +02:00
Xiaoxi Chen
932d59d084 os/LevelDBStore:fix bug when compact_on_mount
Initialize the performance counter(l_rocksdb_compact)
before use it in compact().

Signed-off-by: Xiaoxi Chen <xiaoxi.chen@intel.com>
2015-04-16 13:43:23 +08:00
Xiaoxi Chen
36db6d2dc4 os/RocksDBStore: fix bug when compact_on_mount
Initialize the performance counter(l_rocksdb_compact)
before use it in compact().

Signed-off-by: Xiaoxi Chen <xiaoxi.chen@intel.com>
2015-04-16 13:39:57 +08:00
Yehuda Sadeh
518931be58 Merge pull request #4366 from BCLibCoop/bclibcoop/rgw-hostnames
rgw: Document & improve region hostnames

Reviewed-by: Yehuda Sadeh <yehuda@redhat.com>
2015-04-15 09:20:24 -07:00
Danny Al-Gaaf
3b60f5f69d TestPGLog.cc: fix -Wsign-compare
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
2015-04-15 12:34:51 +02:00
Danny Al-Gaaf
b1dd699adb TestErasureCodeShec.cc: fix -Wsign-compare
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
2015-04-15 12:34:50 +02:00
Danny Al-Gaaf
c77ee1339d test_async_driver.cc: fix UNINIT
Fix for:

CID 1254380 (#1 of 1): Uninitialized scalar variable (UNINIT)
 uninit_use_in_call: Using uninitialized value sa. Field
 sa.sin_zero is uninitialized when calling connect

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
2015-04-15 12:34:50 +02:00
Danny Al-Gaaf
655c12ac50 psim.cc: change initialzation of VLAs
Use memset to fill integer VLAs.

Fix for:

CID 1219649 (#1 of 1): Uninitialized scalar variable (UNINIT)
 uninit_use: Using uninitialized value primary_count[primary]

CID 1219648 (#1 of 1): Uninitialized scalar variable (UNINIT)
 uninit_use: Using uninitialized value first_count[osds[0UL]]

CID 1219647 (#1 of 1): Uninitialized scalar variable (UNINIT)
 uninit_use: Using uninitialized value count[osds[i]]

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
2015-04-15 12:34:50 +02:00
Danny Al-Gaaf
c3b2e872d3 systest_runnable.h: mark copy ctor as explicit
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
2015-04-15 12:34:50 +02:00
Danny Al-Gaaf
d508510d70 common/Thread.h: mark copy/move ctor as explicit
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
2015-04-15 12:34:50 +02:00
Danny Al-Gaaf
dfe9f1d06b cls_rbd.cc: reduce scope of local variable
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
2015-04-15 12:34:50 +02:00
Danny Al-Gaaf
dc50f43572 ReplicatedBackend.cc: init 'Message *commit' to NULL
Init variable with NULL to make sure it crashes in error
case (would be a bug) if NDEBUG disable the assert() call.

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
2015-04-15 12:34:50 +02:00
Danny Al-Gaaf
d36f665aa6 osd/PG.h: mark copy ctor explicit
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
2015-04-15 12:24:12 +02:00
Danny Al-Gaaf
ed8c284709 msg/Dispatcher.h: make copy/move ctor explicit
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
2015-04-15 12:24:12 +02:00
Danny Al-Gaaf
cebeac94ae test_shared_cache.cc: reduce scope of variable
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
2015-04-15 12:24:12 +02:00
Danny Al-Gaaf
feb989cdaa rgw_rest_user.cc: UserQuotas init vars in ctor init list
Fix for:

[src/rgw/rgw_rest_user.cc:631]: (performance) Variable 'bucket_quota' is
 assigned in constructor body. Consider performing initialization in
 initialization list.
[src/rgw/rgw_rest_user.cc:632]: (performance) Variable 'user_quota' is
 assigned in constructor body. Consider performing initialization in
 initialization list.

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
2015-04-15 12:24:12 +02:00
Danny Al-Gaaf
8077b5232d client/Client.cc: fix uninit variables
This is caused by assert(). If assert is disabled we run into use
of uninitialized variables. Return -EINVAL in case assert() is
disabled.

Fix for:

[src/client/Client.cc:7791]: (error) Uninitialized variable: lock_state
[src/client/Client.cc:7829]: (error) Uninitialized variable: lock_type

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
2015-04-15 12:24:12 +02:00
Danny Al-Gaaf
53c9dd4d2d libcephfs.h: fix unnecessary forward declarations
This is an issue in case non-cpp code. Move the declaration of
inodeno_t and vinodeno_t structs into __cplusplus block where
they are needed.

Fix for cppcheck issue:

[src/include/cephfs/libcephfs.h:89] -> [src/include/cephfs/libcephfs.h:74]:
 The struct 'inodeno_t' forward declaration is unnecessary. Type struct is
 already declared earlier.
[src/include/cephfs/libcephfs.h:93] -> [src/include/cephfs/libcephfs.h:83]:
 The struct 'vinodeno_t' forward declaration is unnecessary. Type struct is
 already declared earlier.

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
2015-04-15 12:24:12 +02:00
Danny Al-Gaaf
4a1bdc72b9 os/FileStore.cc: fix format qualifier in COMMIT_SNAP_ITEM
All places COMMIT_SNAP_ITEM is used the variables are
'unsigned long long'. Change the format qualifier to reflect
this and to fix:

[src/os/FileStore.cc:1341]: (warning) %lld in format string (no. 1)
 requires 'long long *' but the argument type is 'unsigned long long *'.

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
2015-04-15 12:21:15 +02:00
Danny Al-Gaaf
35f61a30dc mds/MDCache.cc: fix potential null pointer dereference
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
2015-04-15 12:21:15 +02:00
Danny Al-Gaaf
3ed57641a2 test/../chain_xattr.cc: fix suspicious usage of 'sizeof'
Use sizeof(char) instead of sizeof('\0').

Fix for:

[src/test/objectstore/chain_xattr.cc:164]: (warning) Suspicious
 usage of 'sizeof' with a numeric constant as parameter.

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
2015-04-15 12:21:15 +02:00
Danny Al-Gaaf
6a69e9020d TestErasureCodeShec: fix some -Wsign-compare
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
2015-04-15 12:21:15 +02:00
Danny Al-Gaaf
0074e0947a rgw_rest_log.h: remove http_ret from some RGWOp_*_list classes
Remove http_ret from child class since there is already an integer
with the same name in the parent/base class.

Fix for:

[src/rgw/rgw_rest_log.h:79] -> [src/rgw/rgw_rest.h:275]: (warning) The
 class 'RGWOp_MDLog_List' defines member variable with name 'http_ret'
 also defined in its parent class 'RGWRESTOp'.
[src/rgw/rgw_rest_log.h:99] -> [src/rgw/rgw_rest.h:275]: (warning) The
 class 'RGWOp_MDLog_Info' defines member variable with name 'http_ret'
 also defined in its parent class 'RGWRESTOp'.
[src/rgw/rgw_rest_log.h:182] -> [src/rgw/rgw_rest.h:275]: (warning) The
 class 'RGWOp_DATALog_List' defines member variable with name 'http_ret'
 also defined in its parent class 'RGWRESTOp'.
[src/rgw/rgw_rest_log.h:202] -> [src/rgw/rgw_rest.h:275]: (warning) The
 class 'RGWOp_DATALog_Info' defines member variable with name 'http_ret'
 also defined in its parent class 'RGWRESTOp'.

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
2015-04-15 12:21:15 +02:00
Guang Yang
e4df0345f1 qa : misc fixes to stabilize test-erasure-code suite
Signed-off-by: Guang Yang <yguang@yahoo-inc.com>
2015-04-15 09:42:40 +00:00
Kefu Chai
ba57fb68cf ceph-disk: set '--cluster=ceph' in 'prepare' subcommand
otherwise the 'ceph' default value won't be catched by "main_prepare()",
this breaks TEST_corrupt_and_repair_replicated. seems the behaviour
was changed in python 2.7.9, so we move the default value to where
the '--cluster' argument is added instead of setting it in the
main argument parser.

Signed-off-by: Kefu Chai <kchai@redhat.com>
2015-04-15 16:07:28 +08:00
Kefu Chai
b0435e0d4f Merge pull request #4335 from liewegas/wip-osd-df
mon: fix min/max variance for 'cpeh osd df' when osds are marked out

Reviewed-by: Kefu Chai <kchai@redhat.com>
2015-04-15 14:18:48 +08:00
Robin H. Johnson
b55f3dbbfe rgw: Document a lurking problem I see with subdomain/domain splitting
Signed-off-by: Robin H. Johnson <robbat2@gentoo.org>
2015-04-14 18:31:18 -07:00
Robin H. Johnson
044060fd40 rgw: Speed up the building of valid de-duplicated hostnames for regions.
Signed-off-by: Robin H. Johnson <robbat2@gentoo.org>
2015-04-14 18:30:16 -07:00
Josh Durgin
275c1be604 Merge pull request #4316 from Ved-vampir/librdb
librdb: add perf counters descriptions

Reviewed-by: Josh Durgin <jdurgin@redhat.com>
2015-04-14 13:40:56 -07:00
Yehuda Sadeh
4cfeca03ad Merge pull request #4361 from oritwas/wip-11091
rgw: shouldn't return content-type: application/xml if content length is 0

Reviewed-by: Yehuda Sadeh <yehuda@redhat.com>
2015-04-14 11:53:49 -07:00
Josh Durgin
3819055c75 Merge pull request #4351 from ceph/wip-11256
Wip 11256

Reviewed-by: Josh Durgin <jdurgin@redhat.com>
2015-04-14 10:45:34 -07:00
Sage Weil
718faf0e69 mon: make note about osd df calc bug
Signed-off-by: Sage Weil <sage@redhat.com>
2015-04-14 09:35:04 -07:00
Sage Weil
f3ce75c164 mon: fix min variance calc in 'osd df'
If the reweight is 0, ignore the osd for the purposes of calculating the
min.

Signed-off-by: Sage Weil <sage@redhat.com>
2015-04-14 09:32:22 -07:00
Orit Wasserman
5cc92bb27c rgw: shouldn't return content-type: application/xml if content length is 0
Fixed: #11091

Signed-off-by: Orit Wasserman <owasserm@redhat.com>
2015-04-14 16:48:24 +02:00
Boris Ranto
ef2164725f Move ceph-dencoder build to client
The patch simply moves the ceph-dencoder build from server part of the
Makefiles to client part of the Makefiles.

Refs: #10691

Signed-off-by: Boris Ranto <branto@redhat.com>
2015-04-14 13:51:49 +02:00
Boris Ranto
c2b3a35fb3 Rework mds/Makefile.am to support a dencoder client build
The patch adds all the mds sources to DENCODER_SOURCES to allow a
dencoder client build. The patch also splits the Makefile.am file to
better accomodate the change.

Refs: #10691

Signed-off-by: Boris Ranto <branto@redhat.com>
2015-04-14 13:51:31 +02:00
Boris Ranto
0b264331f5 rgw/Makefile.am: Populate DENCODER_SOURCES properly
Dencoder is built if ENABLE_CLIENT is set. However, the rgw/Makefile.am
populated DENCODER_SOURCES only if WITH_RADOSGW was set. The patch fixes
this and populates DENCODER_SOURES if ENABLE_CLIENT is set.

Signed-off-by: Boris Ranto <branto@redhat.com>
2015-04-14 13:46:58 +02:00
Boris Ranto
fb11c74d1d Dencoder should never be built with tcmalloc
The patch adds disabled perfglue stubs to DENCODER sources in order to
avoid tcmalloc-enabled ceph-dencoder builds.

Refs: #10691

Signed-off-by: Boris Ranto <branto@redhat.com>
2015-04-14 13:44:27 +02:00
Joao Eduardo Luis
f04117a5ba Merge pull request #4348 from ceph/wip-mon-clean
mon: remove dead MonitorStore code

Reviewed-by: Joao Eduardo Luis <joao@suse.de>
2015-04-14 11:02:49 +01:00
Ved-vampir
570ff6d934 librdb: add perf counters descriptions
Sign-off-by: Alyona Kiseleva <akiselyova@mirantis.com>
2015-04-14 12:53:55 +03:00
Yan, Zheng
df47e1f3e1 client: fix uninline data funtion
For CEPH_OSD_CMPXATTR_MODE_U64, OSD expects the u64 to be encoded
as string in object's xattr

Fixes: #11356
Signed-off-by: Yan, Zheng <zyan@redhat.com>
2015-04-14 08:53:35 +08:00
Yehuda Sadeh
55594623e2 ceph_json: add decode / encoder for multimap
Signed-off-by: Yehuda Sadeh <yehuda@redhat.com>
2015-04-13 16:33:17 -07:00
Yehuda Sadeh
4e6a66b55e cls_rgw: use multimap to keep pending operations in bucket index
Fixes: #11256
Multiple concurrent requests might be sent using the same tag, need the
entry map to be able to hold multiple entries.

Signed-off-by: Yehuda Sadeh <yehuda@redhat.com>
2015-04-13 16:15:56 -07:00
Yehuda Sadeh
edc0627a1d rgw: generate new tag for object when setting object attrs
Fixes: #11256
Backport: firefly, hammer

Beforehand we were reusing the object's tag, which is problematic as
this tag is used for bucket index updates, and we might be clobbering a
racing update (like object removal).

Signed-off-by: Yehuda Sadeh <yehuda@redhat.com>
2015-04-13 16:15:56 -07:00
BJ Lougee
27ed729c10 Check that delta_sum.stats.sum.num_object_copies and delta_sum.stats.sum.num_object are greater than zero
This fixes division by zero.

Signed-off-by BJ Lougee <almightybeeij@gmail.com>
2015-04-13 11:24:38 -05:00
Sage Weil
4b23926018 mon: remove dead MonitorStore code
Signed-off-by: Sage Weil <sage@redhat.com>
2015-04-13 08:42:47 -07:00
Loic Dachary
2773ae5aeb Merge pull request #4341 from dachary/wip-test-timeout
tests: display ceph report when stuck

Reviewed-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
2015-04-13 11:30:29 +02:00
Haomai Wang
190ec03b83 AsyncConnection: Discard all prefetch buffer when replacing
Signed-off-by: Haomai Wang <haomaiwang@gmail.com>
2015-04-12 15:01:50 +08:00
Loic Dachary
464999e1b7 tests: display ceph report when stuck
When the cluster is stuck (wait_for_clean times out), display ceph
report to stderr for debugging purposes.

Signed-off-by: Loic Dachary <ldachary@redhat.com>
2015-04-11 14:14:53 +02:00
Josh Durgin
796f810398 Merge pull request #4239 from yuyuyu101/wip-librbd-conf
Wip librbd conf

Reviewed-by: Josh Durgin <jdurgin@redhat.com>
2015-04-10 23:10:34 -07:00
Josh Durgin
2239dcb71d Merge pull request #4323 from ceph/wip-11363
librbd: ImageWatcher should cancel in-flight ops on watch error

Reviewed-by: Josh Durgin <jdurgin@redhat.com>
2015-04-10 18:04:30 -07:00
Josh Durgin
458901dfb2 Merge pull request #4140 from ceph/wip-rbd-rebuild-object-map
rbd: add ability to rebuild corrupt/missing object maps

Reviewed-by: Josh Durgin <jdurgin@redhat.com>
2015-04-10 17:56:48 -07:00
Josh Durgin
0593611fe9 Merge pull request #4325 from wonzhq/async-resize-2
librbd/AsyncResize: avoid dup incrementing refresh seq

Reviewed-by: Josh Durgin <jdurgin@redhat.com>
2015-04-10 17:32:58 -07:00
Josh Durgin
ef5c2b7b89 Merge pull request #4336 from ceph/wip-11369
librbd: failure to update the object map should always return success

Reviewed-by: Josh Durgin <jdurgin@redhat.com>
2015-04-10 17:26:14 -07:00
Josh Durgin
523272cf22 Merge pull request #4319 from ceph/wip-11348
librbd: update default image format to version 2

Reviewed-by: Josh Durgin <jdurgin@redhat.com>
2015-04-10 14:07:43 -07:00
Jason Dillaman
06f30fc18d librbd: notify of header update after rebuilding object map
This will allow clients to detect that the object map is no longer
invalid and to reload the object map from disk.

Signed-off-by: Jason Dillaman <dillaman@redhat.com>
2015-04-10 15:46:22 -04:00
Jason Dillaman
58be49e592 librbd: rebuilding object map shouldn't update piecemeal
The object map is now rebuilt in-memory and written back to the
OSDs as a single operation.

Signed-off-by: Jason Dillaman <dillaman@redhat.com>
2015-04-10 15:46:22 -04:00
Jason Dillaman
3ec68db139 tests: add test case for cls_rbd object_map_save
Signed-off-by: Jason Dillaman <dillaman@redhat.com>
2015-04-10 15:46:22 -04:00
Jason Dillaman
24c923e22e cls_rbd_client: add object_map_save helper method
Signed-off-by: Jason Dillaman <dillaman@redhat.com>
2015-04-10 15:46:22 -04:00
Jason Dillaman
e5adbaa80b cls_rbd: add object_map_save method
Allow the object map rebuild process to build the full object map
in memory and save it to disk with one operation.

Signed-off-by: Jason Dillaman <dillaman@redhat.com>
2015-04-10 15:46:22 -04:00
Jason Dillaman
8ca6220fc2 tests: add ImageWatcher test for new rebuild object map request
Signed-off-by: Jason Dillaman <dillaman@redhat.com>
2015-04-10 15:46:22 -04:00
Jason Dillaman
852592a565 tests: added rebuild_object_map test to test_librbd
Signed-off-by: Jason Dillaman <dillaman@redhat.com>
2015-04-10 15:46:21 -04:00
Jason Dillaman
7ba4f1003a tests: librados_test_stub reads should deep-copy
If a client of librados_test_stub modified a bufferlist
retrieved via a read call, the client will actually be
changing the contents of the file.  Therefore, read calls
should deep-copy the contents of the buffer::ptrs.

Signed-off-by: Jason Dillaman <dillaman@redhat.com>
2015-04-10 14:10:05 -04:00
Jason Dillaman
e714800c48 librbd: allow snapshot object maps to be updated
Rebuild will need to be able to update/resize the object maps
for image snapshots.  This was previously not permitted.

Signed-off-by: Jason Dillaman <dillaman@redhat.com>
2015-04-10 14:10:05 -04:00
Jason Dillaman
92a42561f8 librbd: update in-memory object map before on-disk update completes
When multiple IO updates are occurring within the same object, this
will allow only a single object map update request to be sent to the
OSD.

Signed-off-by: Jason Dillaman <dillaman@redhat.com>
2015-04-10 14:10:05 -04:00
Jason Dillaman
1b7f8c13f9 cls_rbd: treat zero-byte object maps as missing
Acquiring the lock on a missing object map will create an
empty object. Treat the empty object as a non-existant
object map to support rebuilding corrupt object maps while
holding the exclusive lock.

Signed-off-by: Jason Dillaman <dillaman@redhat.com>
2015-04-10 14:10:05 -04:00
Jason Dillaman
6ce79ab008 rbd: add object map rebuild command
An invalid object map can now be rebuilt via the rbd CLI.

Signed-off-by: Jason Dillaman <dillaman@redhat.com>
2015-04-10 14:10:05 -04:00
Jason Dillaman
cc3890eea8 librbd: add rebuild_object_map to public API
Signed-off-by: Jason Dillaman <dillaman@redhat.com>
2015-04-10 14:10:05 -04:00
Jason Dillaman
844136d07f librados_test_stub: add another overload of aio_operate
Signed-off-by: Jason Dillaman <dillaman@redhat.com>
2015-04-10 14:10:04 -04:00
Jason Dillaman
7ae1b14966 librbd: connect async rebuild object map to state machine
Signed-off-by: Jason Dillaman <dillaman@redhat.com>
2015-04-10 14:10:04 -04:00
Jason Dillaman
2db758cb4c librbd: require callers to ObjectMap::aio_update to acquire lock
This is needed to allow an atomic compare and update operation
from the rebuild object map utility.

Signed-off-by: Jason Dillaman <dillaman@redhat.com>
2015-04-10 14:10:04 -04:00
Jason Dillaman
c0cd3829e0 librbd: added RebuildObjectMapRequest state machine
It will verify the object map is properly sized, verify
the existence of each object within the image (snapshot),
and clear the invalid object map flag once complete.

Signed-off-by: Jason Dillaman <dillaman@redhat.com>
2015-04-10 14:10:04 -04:00
Jason Dillaman
1aa801a013 librbd: correct basic object map errors during refresh
If the object map is corrupt on-disk or too small for the image,
correct these basic issues as soon as possible.  The object map
is still flagged as invalid, but there will be less required repair
work if future IO is able to properly update the object map.

Signed-off-by: Jason Dillaman <dillaman@redhat.com>
2015-04-10 14:10:04 -04:00
Jason Dillaman
18fd6ca7f5 librbd: use generic helper for issuing async requests
resize, flatten, and rebuild object map now use the same
bootstrap code for sending the request to the remote lock owner
or executing the request locally.

Signed-off-by: Jason Dillaman <dillaman@redhat.com>
2015-04-10 14:10:04 -04:00
Jason Dillaman
df55d6450f librbd: connect ImageWatch rebuild request to async rebuild method
Signed-off-by: Jason Dillaman <dillaman@redhat.com>
2015-04-10 14:10:04 -04:00
Jason Dillaman
d49788b7d3 librbd: add preliminary methods for rebuilding object map
Signed-off-by: Jason Dillaman <dillaman@redhat.com>
2015-04-10 14:10:04 -04:00
Jason Dillaman
1479161b74 librbd: add hooks for rebuild object map to ImageWatcher
Signed-off-by: Jason Dillaman <dillaman@redhat.com>
2015-04-10 14:10:04 -04:00
Jason Dillaman
a8f828b8b8 librbd: add new notify payload for rebuild object map
The request will be sent to the client which owns the exclusive
lock to rebuild the object map for the current image HEAD.

Signed-off-by: Jason Dillaman <dillaman@redhat.com>
2015-04-10 14:10:04 -04:00
Jason Dillaman
99f5a7d595 librbd: failure to update the object map should always return success
If an object map update fails, the object map will be flagged as
invalid.  However, if a subsequent update failure occurs, the error
code will propagate back to the caller.

Fixes: #11369
Signed-off-by: Jason Dillaman <dillaman@redhat.com>
2015-04-10 13:32:20 -04:00
Jason Dillaman
76fe8d73ff tests: librados_test_stub reads should deep-copy
If a client of librados_test_stub modified a bufferlist
retrieved via a read call, the client will actually be
changing the contents of the file.  Therefore, read calls
should deep-copy the contents of the buffer::ptrs.

Signed-off-by: Jason Dillaman <dillaman@redhat.com>
2015-04-10 12:54:27 -04:00
Jason Dillaman
fc2e511b2a librbd: ImageWatcher should cancel in-flight ops on watch error
Upon an watch error notification from librados, pending requests
should be canceled and in-flight IO should be flushed prior to
unlocking the image.

Fixes: #11363
Signed-off-by: Jason Dillaman <dillaman@redhat.com>
2015-04-10 11:23:54 -04:00
Loic Dachary
77788e36d1 tests: add Dockerfile for fedora 21
Signed-off-by: Loic Dachary <ldachary@redhat.com>
2015-04-10 15:09:00 +02:00
Haomai Wang
5f1259cdf0 librbd: Fix image_watcher test
Signed-off-by: Haomai Wang <haomaiwang@gmail.com>
2015-04-10 16:51:52 +08:00
Haomai Wang
dcf2b3b9e9 Librbd: Don't affect global md_config_t
Signed-off-by: Haomai Wang <haomaiwang@gmail.com>
2015-04-10 16:44:47 +08:00
Haomai Wang
16d66167ef Librbd: Don't apply to global configserver
Signed-off-by: Haomai Wang <haomaiwang@gmail.com>
2015-04-10 14:36:28 +08:00
Zhiqiang Wang
15cc83b8e6 librbd/AsyncResize: avoid dup incrementing refresh seq
The refresh_seq is incremented in notify_change when calling
notify_async_complete after the locker owner completes the resize
request.

Signed-off-by: Zhiqiang Wang <zhiqiang.wang@intel.com>
2015-04-10 13:44:07 +08:00
Yan, Zheng
47c2cecc21 mds: update snaptable when renaming snapshot
Signed-off-by: Yan, Zheng <zyan@redhat.com>
2015-04-10 09:48:46 +08:00
Yan, Zheng
f311ac161a mds: rename snapshot support
Fixes: #3645
Signed-off-by: Yan, Zheng <zyan@redhat.com>
2015-04-10 09:48:44 +08:00
Loic Dachary
c4c2927a39 Merge pull request #4320 from liewegas/wip-crush-straw2-div0
crush/mapper: fix divide-by-0 in straw2

Reviewed-by: Yann Dupont <yann@objoo.org>
Reviewed-by: Loic Dachary <ldachary@redhat.com>
2015-04-10 00:05:36 +02:00
Sage Weil
64d1e900ec crush/mapper: fix divide-by-0 in straw2
If the item weight is 0 we don't want to divide; instead draw a minimal
value.

Fixes: #11357
Reported-by: Yann Dupont <yd@objoo.org>
Tested-by: Yann Dupont <yd@objoo.org>
Signed-off-by: Sage Weil <sage@redhat.com>
2015-04-09 14:42:34 -07:00
Jason Dillaman
3b95edb5bd tests: ensure old-format RBD tests still work
Override the RBD default image format back to version 1
to ensure tests properly cover the old format.

Signed-off-by: Jason Dillaman <dillaman@redhat.com>
2015-04-09 15:07:41 -04:00
Jason Dillaman
808e4a881a rbd: deprecate --new-format command-line option
Image formats can be explicitly chosen via the --image-format X
command-line option.

Signed-off-by: Jason Dillaman <dillaman@redhat.com>
2015-04-09 15:07:41 -04:00
Jason Dillaman
4b55af5b12 common/config_opts: updated rbd_default_format
New images will now default to format 2 RBD images.

Fixes: #11348
Signed-off-by: Jason Dillaman <dillaman@redhat.com>
2015-04-09 15:07:32 -04:00
Jason Dillaman
0344910402 librados_test_stub: added rados_ioctx_cct implementation
Signed-off-by: Jason Dillaman <dillaman@redhat.com>
2015-04-09 14:58:16 -04:00
Samuel Just
aec2f5de3b Merge pull request #4174 from trociny/wip-10976.master
osd: fix PG::all_unfound_are_queried_or_lost for non-existent osds

Reviewed-by: Kefu Chai <tchaikov@gmail.com
Reviewed-by: Samuel Just <sjust@redhat.com>
2015-04-09 11:25:03 -07:00
Samuel Just
eeb2cf5cc1 Merge pull request #4111 from wonzhq/hitsets-check
osd/ReplicatedPG: correct the checking if the promoting object is in other hit sets

Reviewed-by: Kefu Chai <tchaikov@gmail.com>
2015-04-09 11:22:55 -07:00
Samuel Just
7ae9e6bc15 Merge pull request #4136 from XinzeChi/wip-pg-delete-sleep
osd: return fast if PG::deleting is true in snap_trimmer and PG::scrub

Reviewed-by: Sage Weil <sage@redhat.com>
2015-04-09 11:21:37 -07:00
Samuel Just
c8f662cba3 Merge pull request #4178 from XinzeChi/wip-tracker-message
osd: more useful message to find out potential unhealth osd

Reviewed-by: Samuel Just <sjust@redhat.com>
Reviewed-by: Sage Weil <sage@redhat.com>
2015-04-09 11:21:20 -07:00
Samuel Just
52efad3aac Merge pull request #4155 from wonzhq/prdop
osd/ReplicatedPG: don't check order in finish_proxy_read

Reviewed-by: Kefu Chai <tchaikov@gmail.com>
Reviewed-by: Sage Weil <sage@redhat.com>
2015-04-09 11:20:24 -07:00
Samuel Just
b7e62c63da Merge pull request #4139 from Ved-vampir/oscnt
Perf counters descriptions

Reviewed-by: Greg Farnum <gfarnum@redhat.com>
Reviewed-by: Samuel Just <sjust@redhat.com>
2015-04-09 11:19:23 -07:00
Samuel Just
a9b497600c Merge pull request #3928 from dmitryya/rados_bench_with_iops_metric
rados bench: Add IOPS metric to `rados bench'

Reviewed-by: Loic Dachary <ldachary@redhat.com>
2015-04-09 11:17:55 -07:00
Samuel Just
1b66dfbaec Merge pull request #4253 from majianpeng/scrub-fix2
Scrub bug fix

Reviewed-by: Samuel Just <sjust@redhat.com>
2015-04-09 11:16:56 -07:00
Yehuda Sadeh
306c7eba2b Merge pull request #4224 from rzarzynski/wip-10682_bucketlisting
rgw: add support for end_marker parameter for GET on Swift container.

Reviewed-by: Yehuda Sadeh <yehuda@redhat.com>
2015-04-09 10:02:08 -07:00
Yehuda Sadeh
5d866ad7e0 Merge pull request #4305 from Ved-vampir/rgw
rgw: add perf counters descriptions

Reviewed-by: Yehuda Sadeh <yehuda@redhat.com>
2015-04-09 09:55:25 -07:00
Yehuda Sadeh
4e425c2585 Merge pull request #4240 from 9seconds/post_check_quotas
rgw: Quota not respected in POST object

Reviewed-by: Yehuda Sadeh <yehuda@redhat.com>
2015-04-09 09:51:35 -07:00
Yehuda Sadeh
290ee5d12e Merge pull request #4268 from guangyy/wip-11322
rgw : Issue AIO for next chunk first before flush the (cached) data.

Reviewed-by: Yehuda Sadeh <yehuda@redhat.com>
2015-04-09 09:50:02 -07:00
Haomai Wang
899a0e1a23 Librbd: aware_metadata_confs->apply_metadata_confs
Signed-off-by: Haomai Wang <haomaiwang@gmail.com>
2015-04-09 16:06:06 +08:00
Haomai Wang
31070a5645 Librbd: Use boost:assign to init aware_confs
Signed-off-by: Haomai Wang <haomaiwang@gmail.com>
2015-04-09 16:04:07 +08:00
Haomai Wang
ea2edf36e1 Event: process event before pop it to avoid releasing
Signed-off-by: Haomai Wang <haomaiwang@gmail.com>
2015-04-09 15:11:59 +08:00
Josh Durgin
21f60a9d26 Merge pull request #4233 from ceph/wip-librbd-aio-request
librbd: simplify AioRequest constructor parameters

Reviewed-by: Josh Durgin <jdurgin@redhat.com>
2015-04-08 15:19:24 -07:00
Josh Durgin
94ceeb94ba Merge remote-tracking branch 'origin/wip-2862'
Reviewed-by: Josh Durgin <jdurgin@redhat.com>

Conflicts:
	src/common/ceph_argparse.cc
	src/rbd.cc
2015-04-08 13:55:13 -07:00
Dan Mick
28820a55b8 Merge pull request #4307 from dzafman/wip-dz-cmd-fix
osd: Fix wrong usage for "ceph tell osd.* debug dump_missing"

Reviewed-by: Dan Mick <dmick@redhat.com>
2015-04-08 13:28:12 -07:00
David Zafman
88f5ef4c39 osd: Fix wrong usage for "ceph tell osd.* debug dump_missing"
Signed-off-by: David Zafman <dzafman@redhat.com>
2015-04-08 12:45:37 -07:00
John Spray
7c4d0a295a Merge pull request #4304 from Ved-vampir/mds
mds: add perf counters descriptions

Reviewed-by: John Spray <john.spray@redhat.com>
2015-04-08 19:12:05 +01:00
Ved-vampir
22834ca667 rgw: add perf counters descriptions
Sign-off-by: Alyona Kiseleva <akiselyova@mirantis.com>
2015-04-08 20:48:00 +03:00
Ved-vampir
0498b6abc8 mds: add perf counters descriptions
Sign-off-by: Alyona Kiseleva <akiselyova@mirantis.com>
2015-04-08 20:08:09 +03:00
Kefu Chai
93e7c3c914 Merge pull request #4274 from liewegas/wip-osd-cleanup
osd: remove some dead(ish) code

Reviewed-by: Kefu Chai <kchai@redhat.com>
2015-04-08 23:56:54 +08:00
Kefu Chai
89aae1929e Merge pull request #4289 from dachary/wip-docker-user
tests: allow multiple users of docker-tests.sh

Reviewed-by: Kefu Chai <kchai@redhat.com>
2015-04-08 16:28:51 +08:00
Kefu Chai
de0528dca6 Merge pull request #4210 from trociny/fix-11261
ceph_argparse: return false instead exiting when argument is missed

Reviewed-by: Kefu Chai <kchai@redhat.com>
2015-04-08 15:19:29 +08:00
Rajesh Nambiar
fb51175acd TestCase: Change in testcase output
For the local sanity test to pass this change is needed as the output message changes.

Signed-off-by: Rajesh Nambiar <rajesh.n@msystechnologies.com>
2015-04-07 23:40:58 -07:00
Rajesh Nambiar
b15f6d0231 Fix to some of the command line parsing (including rbd)
Fix#: 2862

Changes to some of the common files for command line parsing

Change to ceph_argparse.cc
-------------------------

Added function ceph_arg_value_type()
  Given an input it will determine
   i) If that input is an option or not
   ii) If input is numeric in nature or not.

  It will set the flag bool_option and bool_numeric appropriately.
  This function is called by ceph_argparse_witharg() to figure out if
  the input parameter to those functions are numeric in nature and not
  an option.  If the input parameter to ceph_argparse_witharg()
  happens to be an option then it implies that user didn't supply
  value to the option.

Changes to strol.cc
-------------------
Changes to strict_strtoll() and strict_strtol()

  Both these functions reponsibility is to convert the string to long or to int.
  I felt it may be not be good for it to display error message within this function,
  rather caller of this function who has better understanding of the function's purpose
  can display the error message.

  Made change in this function to just create a generic error message,Its the
  caller of this function decides what to do with this message.

Signed-off-by: Rajesh Nambiar <rajesh.n@msystechnologies.com>
2015-04-07 23:39:07 -07:00
Rajesh Nambiar
b0172d870e rbd: create command throws inappropriate error messages
Fixes: #2862

Changes related to rbd file

Changes to rbd.cc
-----------------

Change 1: line# 2744 to 2747

 If the option is --order then do the check of its value if its less
 than 12 or greaterthan 25 then throw error. Correct value of --order
 is 12 to 25.

Change 2: Removal of validation from line# 3205 to 3209

  Since the check for correct value of --order is done before hence the
  check here is not needed.

Signed-off-by: Rajesh Nambiar <rajesh.n@msystechnologies.com>
2015-04-07 23:31:48 -07:00
Josh Durgin
6210f589e5 Merge pull request #4292 from ceph/wip-11342
librbd: moved snap_create header update notification to initiator

Reviewed-by: Josh Durgin <jdurgin@redhat.com>
2015-04-07 15:55:33 -07:00
Josh Durgin
25015f9aeb Merge pull request #4281 from wonzhq/readahead
librbd: readahead fixes

Reviewed-by: Josh Durgin <jdurgin@redhat.com>
2015-04-07 14:47:44 -07:00
Jason Dillaman
6e20ed6834 librbd: moved snap_create header update notification to initiator
When handling a proxied snap_create operation, the client which
invoked the snap_create should send the header update notification
to avoid a possible race condition where snap_create completes but
the client doesn't see the new snapshot (since it didn't yet receive
the notification).

Fixes: #11342
Signed-off-by: Jason Dillaman <dillaman@redhat.com>
2015-04-07 16:12:01 -04:00
Yehuda Sadeh
b13161dadc Merge pull request #4283 from oritwas/multizone
rgw: remove meta file after deleting bucket

Reviewed-by: Yehuda Sadeh <yehuda@redhat.com>
2015-04-07 10:43:31 -07:00
Jason Dillaman
46515971ed librbd: simplify AioRequest constructor parameters
Moved all parent overlap computation to within AioRequest so that
callers don't need to independently compute the overlap.  Also
removed the need to pass the snap_id for write operations since
it can only be CEPH_NOSNAP.

Signed-off-by: Jason Dillaman <dillaman@redhat.com>
2015-04-07 11:26:57 -04:00
Radoslaw Zarzynski
29073d8464 rgw: send Content-Length in response for HEAD on Swift account.
Backport: hammer
Signed-off-by: Radoslaw Zarzynski <rzarzynski@mirantis.com>
2015-04-07 17:15:20 +02:00
Radoslaw Zarzynski
d260a93405 rgw: send Content-Length in response for DELETE on Swift container.
Backport: hammer
Signed-off-by: Radoslaw Zarzynski <rzarzynski@mirantis.com>
2015-04-07 17:15:20 +02:00
Radoslaw Zarzynski
10c1f1aa1e rgw: send Content-Length in response for PUT on Swift container.
Fixes: #11036
Backport: hammer
Signed-off-by: Radoslaw Zarzynski <rzarzynski@mirantis.com>
2015-04-07 17:15:20 +02:00
Radoslaw Zarzynski
5a64fb5430 rgw: send Content-Length in response for GET on Swift container.
Fixes: #10971
Backport: hammer
Signed-off-by: Radoslaw Zarzynski <rzarzynski@mirantis.com>
2015-04-07 17:15:14 +02:00
Radoslaw Zarzynski
50cf7432db rgw: add support for end_marker for GET on Swift container.
Fixes: #10682
Backport: hammer
Signed-off-by: Radoslaw Zarzynski <rzarzynski@mirantis.com>
2015-04-07 16:55:29 +02:00