]> git.apps.os.sepia.ceph.com Git - ceph.git/log
ceph.git
10 years agoobjectstore_tool: refactor list-lost and fix-lost
Loic Dachary [Wed, 26 Nov 2014 16:30:30 +0000 (17:30 +0100)]
objectstore_tool: refactor list-lost and fix-lost

Abstract out the PG exploration loops and encapsulate the list-lost and
fix-lost semantic in a callable object.

Signed-off-by: Loic Dachary <ldachary@redhat.com>
(cherry picked from commit d9e747b1bdb53d1fe543ef311e3db35fb78d8051)

10 years agoobjectstore_tool: update usage strings
Loic Dachary [Wed, 26 Nov 2014 16:26:54 +0000 (17:26 +0100)]
objectstore_tool: update usage strings

Signed-off-by: Loic Dachary <ldachary@redhat.com>
(cherry picked from commit a90233c8b79ae6c035b5169c7f8809f853631689)

Conflicts:
src/tools/ceph_objectstore_tool.cc

10 years agoceph_objectstore_tool: Add feature called set-allow-sharded-objects
David Zafman [Tue, 18 Nov 2014 21:00:15 +0000 (13:00 -0800)]
ceph_objectstore_tool: Add feature called set-allow-sharded-objects

Uses --op set-allow-sharded-objects option
This operation will be rejected if on the target OSD's osdmap there is
    at least one OSD which does not support ERASURE CODES.
Prompt the user that they could import if sharded state allowed
Prompt the user to use new feature if sharded state found inconsistent

Fixes: #10077
Signed-off-by: David Zafman <dzafman@redhat.com>
(cherry picked from commit f3dab446fc8e58b3b3d9334b8c38722e73881b9e)

Conflicts:
src/tools/ceph_objectstore_tool.cc

10 years agoceph_objectstore_tool: Add utility routine get_osdmap()
David Zafman [Tue, 18 Nov 2014 19:59:18 +0000 (11:59 -0800)]
ceph_objectstore_tool: Add utility routine get_osdmap()

Signed-off-by: David Zafman <dzafman@redhat.com>
(cherry picked from commit b3021b0d3362000b5938d406ed2e032a8eb38405)

Conflicts:
src/tools/ceph_objectstore_tool.cc

10 years agoceph_objectstore_tool: Clear ...INCOMPAT_SHARDS from feature if exporting replicated pg
David Zafman [Thu, 13 Nov 2014 05:14:11 +0000 (21:14 -0800)]
ceph_objectstore_tool: Clear ...INCOMPAT_SHARDS from feature if exporting replicated pg

Don't require importing OSD to have shards feature for replicated pg

http://tracker.ceph.com/issues/10077 Fixes: #10077

Signed-off-by: David Zafman <dzafman@redhat.com>
(cherry picked from commit 86baf2d38170ef19de2dd5e9ce3f280237d8474d)

10 years agotests: ceph_objectstore_tool.py test all variants of export/import
David Zafman [Tue, 18 Nov 2014 08:10:41 +0000 (00:10 -0800)]
tests: ceph_objectstore_tool.py test all variants of export/import

Handle change of error message text

Signed-off-by: David Zafman <dzafman@redhat.com>
(cherry picked from commit 9e53c3554c71121f2e2dd0234b5232da37ad5a1b)

10 years agoceph_objectstore_tool: Make --file option consistent by treating "-" as stdout/stdin
David Zafman [Tue, 18 Nov 2014 07:23:40 +0000 (23:23 -0800)]
ceph_objectstore_tool: Make --file option consistent by treating "-" as stdout/stdin

Signed-off-by: David Zafman <dzafman@redhat.com>
(cherry picked from commit 8c87f3284f87d1121218cb7f41edc81b74c9df29)

10 years agotests: ceph_objectstore_tool.py fix list-attr for erasure code
David Zafman [Sat, 15 Nov 2014 19:43:10 +0000 (11:43 -0800)]
tests: ceph_objectstore_tool.py fix list-attr for erasure code

Adding testing of xattr for erasure coded shards
Fix error message when finding an unexpected xattr key

Signed-off-by: David Zafman <dzafman@redhat.com>
(cherry picked from commit cbecab477a70782f2f69258f035e78fb5c829810)

Conflicts:
src/test/ceph_objectstore_tool.py

10 years agotests: ceph_objectstore_tool.py check for malformed JSON for erasure code objs
David Zafman [Sat, 15 Nov 2014 19:46:15 +0000 (11:46 -0800)]
tests: ceph_objectstore_tool.py check for malformed JSON for erasure code objs

Signed-off-by: David Zafman <dzafman@redhat.com>
(cherry picked from commit 40717aa4c399e87d2c3e32038f78788eb213f87d)

10 years agotests: ceph_objectstore_tool.py fix off by 1 ATTR_OBJS handling
David Zafman [Sat, 15 Nov 2014 19:44:54 +0000 (11:44 -0800)]
tests: ceph_objectstore_tool.py fix off by 1 ATTR_OBJS handling

Signed-off-by: David Zafman <dzafman@redhat.com>
(cherry picked from commit eaf1d1e35243566c46b478788e79e0ebf7583015)

10 years agotests: ceph_objectstore_tool.py skip if /dev/tty fails
Loic Dachary [Fri, 14 Nov 2014 10:00:17 +0000 (11:00 +0100)]
tests: ceph_objectstore_tool.py skip if /dev/tty fails

Some environments do not have a /dev/tty. When opening /dev/tty fails,
skip the test instead of returning an error.

Signed-off-by: Loic Dachary <ldachary@redhat.com>
(cherry picked from commit 4c94f1778fdf483e9e0b62f89f7e46e78aeeebf3)

10 years agotests: ceph_objectstore_tool.py encapsulate init-ceph stop
Loic Dachary [Thu, 13 Nov 2014 18:15:50 +0000 (19:15 +0100)]
tests: ceph_objectstore_tool.py encapsulate init-ceph stop

Call init-ceph in kill_daemons and add a call to kill_daemon when main
returns on error so that it never leaves daemons hanging.

Signed-off-by: Loic Dachary <ldachary@redhat.com>
(cherry picked from commit fc435ff3623d196dd7cc375302acd8dfc9eb59fd)

10 years agotests: ceph_objectstore_tool.py main returns
Loic Dachary [Thu, 13 Nov 2014 18:14:49 +0000 (19:14 +0100)]
tests: ceph_objectstore_tool.py main returns

Instead of calling sys.exit() the main function returns the desired exit
code.

Signed-off-by: Loic Dachary <ldachary@redhat.com>
(cherry picked from commit 0f3d7b1315f2b5595047d8bd13949ed0d9194bfa)

10 years agotests: ceph_objectstore_tool.py replace stop.sh with init-ceph
Loic Dachary [Thu, 13 Nov 2014 16:32:14 +0000 (17:32 +0100)]
tests: ceph_objectstore_tool.py replace stop.sh with init-ceph

The stop.sh will stop all ceph-* processes. Use the init-ceph script
instead to selectively kill the daemons run by the vstart.sh cluster
used for ceph_objectstore_tool.

Signed-off-by: Loic Dachary <ldachary@redhat.com>
(cherry picked from commit e8f34bd62bf282144b8851fb9764cf4429a49c25)

10 years agotests: ceph_objectstore_tool.py use a dedicated directory
Loic Dachary [Thu, 13 Nov 2014 16:30:29 +0000 (17:30 +0100)]
tests: ceph_objectstore_tool.py use a dedicated directory

Set CEPH_DIR to a directory that is specific to ceph_objectstore_tool so
that it can run in parallel with other vstart.sh clusters.

Signed-off-by: Loic Dachary <ldachary@redhat.com>
(cherry picked from commit e303d1afde58e68c1f587962010da9e1f1278bc3)

Conflicts:
src/test/ceph_objectstore_tool.py

10 years agotests: ceph_objectstore_tool.py run faster by default
Loic Dachary [Thu, 13 Nov 2014 16:27:01 +0000 (17:27 +0100)]
tests: ceph_objectstore_tool.py run faster by default

By default use only a small number of objects to speed up the tests. If
the argument "big" is given, use a large number of objects as it may
help find some problems.

Signed-off-by: Loic Dachary <ldachary@redhat.com>
(cherry picked from commit 235257c257aea98b770d9637957818c8aeb6c745)

10 years agotests: ceph_objectstore_tool.py run mon and osd on specific port
Loic Dachary [Thu, 13 Nov 2014 16:21:48 +0000 (17:21 +0100)]
tests: ceph_objectstore_tool.py run mon and osd on specific port

By default vstart.sh runs MDS but they are not needed for the tests,
only run mon and osd instead. Instead of using the default vstart.sh
port which may conflict with a already running vstart.sh, set the
CEPH_PORT=7400 which is not used by any other test run with make check.

Signed-off-by: Loic Dachary <ldachary@redhat.com>
(cherry picked from commit f04d4e7539bc8c1b6cf94db815f9dcdecc52faa2)

10 years agotests: ceph_objectstore_tool.py can use a WARN cluster
Loic Dachary [Thu, 13 Nov 2014 16:16:41 +0000 (17:16 +0100)]
tests: ceph_objectstore_tool.py can use a WARN cluster

The tests do not need HEALTH_OK exclusively, a HEALTH_WARN cluster can
also run them successfully.

Signed-off-by: Loic Dachary <ldachary@redhat.com>
(cherry picked from commit 783378c019aaac36d542e1b12c0d64196ea21012)

10 years agotests: ceph_objectstore_tool.py use env python
Loic Dachary [Thu, 13 Nov 2014 16:12:35 +0000 (17:12 +0100)]
tests: ceph_objectstore_tool.py use env python

Using #/usr/bin/env python instead of a hard coded path is more flexible
and can also be used to run from virtualenv.

Signed-off-by: Loic Dachary <ldachary@redhat.com>
(cherry picked from commit 74506d2506d03d05935cbe342fef9dc1d9022a13)

10 years agoceph_objectstore_tool: Fixes to make import work again
David Zafman [Wed, 12 Nov 2014 23:22:04 +0000 (15:22 -0800)]
ceph_objectstore_tool: Fixes to make import work again

The is_pg() call is now true even for pgs pending removal, fix broken
    finish_remove_pgs() by removing is_pg() check.
Need to add create_collection() to the initial transaction on import

Fixes: #10090
Signed-off-by: David Zafman <dzafman@redhat.com>
Reviewed-by: Sage Weil <sage@redhat.com>
(cherry picked from commit 5ce09198bf475e5c3a2df26232fa04ba9912b103)

Conflicts:
src/tools/ceph_objectstore_tool.cc

10 years agoceph_objectstore_tool: Accept CEPH_ARGS environment arguments
David Zafman [Tue, 7 Oct 2014 01:26:44 +0000 (18:26 -0700)]
ceph_objectstore_tool: Accept CEPH_ARGS environment arguments

Signed-off-by: David Zafman <dzafman@redhat.com>
(cherry picked from commit 10fe7cfe561f91717f2ac2e13aeecc06a903704e)

10 years agoceph_objectstore_tool: MemStore needs a CephContext
David Zafman [Fri, 3 Oct 2014 22:12:28 +0000 (15:12 -0700)]
ceph_objectstore_tool: MemStore needs a CephContext

Pass g_ceph_context to ObjectStore::create() needed by MemStore

Fixes: #9661
Signed-off-by: David Zafman <dzafman@redhat.com>
(cherry picked from commit 0b155d00c542f0d8b8b5b0324dac4b3cf7ff37b5)

10 years agoceph_objectstore_tool: Rename generated binary to ceph-objectstore-tool
David Zafman [Tue, 3 Mar 2015 18:41:28 +0000 (10:41 -0800)]
ceph_objectstore_tool: Rename generated binary to ceph-objectstore-tool

Signed-off-by: David Zafman <dzafman@redhat.com>
(cherry picked from commit 4f72ba545e204a24a55adead43c61cb1d4394381)

Conflicts:
debian/ceph-test.install
src/.gitignore
src/test/ceph-helpers.sh (doesn't exist in firefly)
src/test/ceph_objectstore_tool.py
src/tools/ceph_objectstore_tool.cc

10 years agovstart.sh: warn less
Sage Weil [Wed, 12 Nov 2014 21:35:43 +0000 (13:35 -0800)]
vstart.sh: warn less

Signed-off-by: Sage Weil <sage@redhat.com>
(cherry picked from commit a69b8450f642af91a352d0de4378d93828291933)

10 years agoceph_objectstore_tool: When exporting to stdout, don't cout messages
David Zafman [Tue, 18 Nov 2014 07:02:50 +0000 (23:02 -0800)]
ceph_objectstore_tool: When exporting to stdout, don't cout messages

Fixes: #10128
Caused by a2bd2aa7

Signed-off-by: David Zafman <dzafman@redhat.com>
(cherry picked from commit 0d5262ac2f69ed3996af76a72894b1722a27b37d)
(cherry picked from commit 6cb9a2499cac2645e2cc6903ab29dfd95aac26c7)

10 years agoceph_objectstore_tool.cc: prefer ++operator for non-primitive iterators
Danny Al-Gaaf [Tue, 2 Sep 2014 12:56:10 +0000 (14:56 +0200)]
ceph_objectstore_tool.cc: prefer ++operator for non-primitive iterators

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
(cherry picked from commit a5468abe4459159e8a9f7a4f21d082bb414e1cdd)

10 years agoTest: fixing a compile warning in ceph_objectstore_tool.cc
Zhiqiang Wang [Fri, 29 Aug 2014 08:39:40 +0000 (16:39 +0800)]
Test: fixing a compile warning in ceph_objectstore_tool.cc

For the compiler's sake:
tools/ceph_objectstore_tool.cc:2547:15: warning: â€˜r’ may be used
uninitialized in this function [-Wmaybe-uninitialized]

Signed-off-by: Zhiqiang Wang <wonzhq@hotmail.com>
(cherry picked from commit c3e1466b46076f133b62f98e2c0b712bdde0e119)

10 years agoceph_objectstore_tool: Bug fixes and test improvements
David Zafman [Wed, 20 Aug 2014 08:33:45 +0000 (01:33 -0700)]
ceph_objectstore_tool: Bug fixes and test improvements

ceph_objectgstore_tool:
Fix bugs in the way collection_list_partial() was being called
which caused objects to be seen over and over again.

Unit test:
Fix get_objs() to walk pg tree for pg with sub-directories
Create more objects to test object listing code
Limit number of larger objects
Limit number of objects which get attributes and omaps

Signed-off-by: David Zafman <dzafman@redhat.com>
(cherry picked from commit a03f719eb3a46f410550afce313e6720e0c27946)

10 years agoceph_objectstore_tool, test: Implement import-rados feature and unit test code
David Zafman [Wed, 6 Aug 2014 01:26:11 +0000 (18:26 -0700)]
ceph_objectstore_tool, test: Implement import-rados feature and unit test code

Fixes: #8276
Signed-off-by: David Zafman <david.zafman@inktank.com>
(cherry picked from commit 23ec93a86140c4b271b45d87c62682288079cbba)

10 years agotest: ceph_objectstore_tool unit test improvements
David Zafman [Thu, 7 Aug 2014 02:53:43 +0000 (19:53 -0700)]
test: ceph_objectstore_tool unit test improvements

Add namespaces to testing
Increase filesize so export will have multiple chunks
Put json for each object into the db dict

Signed-off-by: David Zafman <david.zafman@inktank.com>
10 years agoceph_objectstore_tool: Add operation "rm-past-intervals" for testing purposes
David Zafman [Thu, 7 Aug 2014 20:31:48 +0000 (13:31 -0700)]
ceph_objectstore_tool: Add operation "rm-past-intervals" for testing purposes

Signed-off-by: David Zafman <david.zafman@inktank.com>
(cherry picked from commit 3694068b67fd625495c4511390bc5bcbfbbd28f5)

10 years agoceph_objectstore_tool: Add past_intervals to export/import code
David Zafman [Thu, 7 Aug 2014 18:46:08 +0000 (11:46 -0700)]
ceph_objectstore_tool: Add past_intervals to export/import code

Signed-off-by: David Zafman <david.zafman@inktank.com>
(cherry picked from commit 9325ec15d4b89c5537cbcbda4c7594e25dc6e7df)

10 years agoceph_objectstore_tool: Minor improvements
David Zafman [Thu, 7 Aug 2014 21:11:21 +0000 (14:11 -0700)]
ceph_objectstore_tool: Minor improvements

Make all non-error non-debug output to stdout
Fix a message

Signed-off-by: David Zafman <david.zafman@inktank.com>
(cherry picked from commit a2bd2aa7babb4ad45ba21c70f9d179fda27742aa)

10 years agoceph_objectstore_tool, test: Add list-pgs operations and unit test case
David Zafman [Tue, 5 Aug 2014 19:26:42 +0000 (12:26 -0700)]
ceph_objectstore_tool, test: Add list-pgs operations and unit test case

Signed-off-by: David Zafman <david.zafman@inktank.com>
(cherry picked from commit f01e334c697057158354f0ce5ecff6d6ba8e2704)

10 years agoComplete replacement of ceph_filestore_tool and ceph_filestore_dump
David Zafman [Wed, 30 Jul 2014 19:39:49 +0000 (12:39 -0700)]
Complete replacement of ceph_filestore_tool and ceph_filestore_dump
with unified ceph_objectstore_tool

Move list-lost-objects and fix-lost-objects features from
  ceph_filestore_tool to ceph_objectstore_tool as list-lost, fix-lost
Change --type to --op for info, log, export...operations
Add --type for the ObjectStore type (defaults to filestore)
Change --filestore-path to --data-path
Update installation, Makefile.am, and .gitignore
Fix and rename test case to match
  Add some additional invalid option checks

Signed-off-by: David Zafman <david.zafman@inktank.com>
(cherry picked from commit 83fbc91e5c4e52cc1513f34908f99d2ac3b930df)

10 years agoRenames and removal towards a unified ceph_objectstore_tool
David Zafman [Wed, 30 Jul 2014 18:22:29 +0000 (11:22 -0700)]
Renames and removal towards a unified ceph_objectstore_tool

Rename ceph_filestore_dump.cc and ceph_filestore_dump.py
Remove ceph_filestore_tool.cc

Signed-off-by: David Zafman <david.zafman@inktank.com>
(cherry picked from commit 77864193a1162393ade783480aee39a232934377)

10 years agoceph_filestore_dump: Add set-omaphdr object command
David Zafman [Tue, 20 May 2014 18:19:19 +0000 (11:19 -0700)]
ceph_filestore_dump: Add set-omaphdr object command

Signed-off-by: David Zafman <david.zafman@inktank.com>
(cherry picked from commit b4d95cc85af9af64d33d541cd69c5f28fd45423b)

10 years agoceph_filestore_dump: Add get-omaphdr object command
David Zafman [Tue, 20 May 2014 17:44:37 +0000 (10:44 -0700)]
ceph_filestore_dump: Add get-omaphdr object command

Signed-off-by: David Zafman <david.zafman@inktank.com>
(cherry picked from commit 30c0f3114e665acdd99e64bf0d2a7399b33e8d61)

10 years agoceph_filestore_dump: Add rm-omap object command
David Zafman [Tue, 20 May 2014 03:55:47 +0000 (20:55 -0700)]
ceph_filestore_dump: Add rm-omap object command

Signed-off-by: David Zafman <david.zafman@inktank.com>
(cherry picked from commit 0fc6bd2777edf24a044f454beacf1647cc52f9fe)

10 years agoceph_filestore_dump: Add set-omap object command
David Zafman [Tue, 20 May 2014 03:47:14 +0000 (20:47 -0700)]
ceph_filestore_dump: Add set-omap object command

Signed-off-by: David Zafman <david.zafman@inktank.com>
(cherry picked from commit 50cd57e902fe508f98f63fea30626780b07561d9)

10 years agoceph_filestore_dump: Add get-omap object command
David Zafman [Tue, 20 May 2014 03:37:01 +0000 (20:37 -0700)]
ceph_filestore_dump: Add get-omap object command

Signed-off-by: David Zafman <david.zafman@inktank.com>
(cherry picked from commit b50c43ce5e52f5bbcb3684f6793d50f34ed741d1)

10 years agoceph_filestore_dump: Add rm-attr object command
David Zafman [Tue, 20 May 2014 01:33:24 +0000 (18:33 -0700)]
ceph_filestore_dump: Add rm-attr object command

Signed-off-by: David Zafman <david.zafman@inktank.com>
(cherry picked from commit 465d77733c7499fbd65bebe7141895714c625e0d)

10 years agoceph_filestore_dump: Add set-attr object command
David Zafman [Tue, 20 May 2014 01:17:27 +0000 (18:17 -0700)]
ceph_filestore_dump: Add set-attr object command

Signed-off-by: David Zafman <david.zafman@inktank.com>
(cherry picked from commit 95554e03dcb74b6d74b2f1b2891b3570abb187b8)

10 years agoceph_filestore_dump: Add get-attr object command
David Zafman [Thu, 15 May 2014 22:50:48 +0000 (15:50 -0700)]
ceph_filestore_dump: Add get-attr object command

Signed-off-by: David Zafman <david.zafman@inktank.com>
(cherry picked from commit 55d43c0e20fc853daec134449b9954248fd7ef31)

10 years agoceph_filestore_dump: Add set-bytes object command
David Zafman [Thu, 15 May 2014 00:52:09 +0000 (17:52 -0700)]
ceph_filestore_dump: Add set-bytes object command

Signed-off-by: David Zafman <david.zafman@inktank.com>
(cherry picked from commit 3c24d1f46a624d0a053ad234997a1f8c8b036db5)

10 years agoceph_filestore_dump: Add get-bytes object command
David Zafman [Thu, 15 May 2014 00:51:29 +0000 (17:51 -0700)]
ceph_filestore_dump: Add get-bytes object command

Signed-off-by: David Zafman <david.zafman@inktank.com>
(cherry picked from commit 869dd92cc8ec29a3a684f88c335d359f225bba24)

10 years agoceph_filestore_dump: Add list-omap object command
David Zafman [Thu, 15 May 2014 00:50:16 +0000 (17:50 -0700)]
ceph_filestore_dump: Add list-omap object command

Signed-off-by: David Zafman <david.zafman@inktank.com>
(cherry picked from commit 48890c7741d76cf92b5f589f49378ca57292e88b)

10 years agoceph_filestore_dump: Add list-attrs object command
David Zafman [Thu, 15 May 2014 01:32:42 +0000 (18:32 -0700)]
ceph_filestore_dump: Add list-attrs object command

Signed-off-by: David Zafman <david.zafman@inktank.com>
(cherry picked from commit 00c6b0673288ca76fe144575b7af76eaa36f5857)

10 years agoceph_filestore_dump: Add --type list to output objects in a pg in json
David Zafman [Thu, 15 May 2014 00:39:17 +0000 (17:39 -0700)]
ceph_filestore_dump: Add --type list to output objects in a pg in json

Signed-off-by: David Zafman <david.zafman@inktank.com>
(cherry picked from commit 844dabb7f311e68eba0293ae9ca4c68521745877)

10 years agoceph_filestore_dump: Add remove object command and usage for new commands
David Zafman [Thu, 15 May 2014 00:44:31 +0000 (17:44 -0700)]
ceph_filestore_dump: Add remove object command and usage for new commands

Signed-off-by: David Zafman <david.zafman@inktank.com>
(cherry picked from commit 605caec64b036f8ab5ae451d7e9e7515d414f28e)

10 years agoceph_filestore_dump: Add utility function get_fd_data()
David Zafman [Sat, 7 Jun 2014 00:05:53 +0000 (17:05 -0700)]
ceph_filestore_dump: Add utility function get_fd_data()

Signed-off-by: David Zafman <david.zafman@inktank.com>
(cherry picked from commit d4a9dafe442f139562497d746f80ba49faa954e8)

10 years agoceph_filestore_dump: Fail import/export with a tty for stdin/stdout
David Zafman [Tue, 20 May 2014 01:16:52 +0000 (18:16 -0700)]
ceph_filestore_dump: Fail import/export with a tty for stdin/stdout

Signed-off-by: David Zafman <david.zafman@inktank.com>
(cherry picked from commit 7520e504cf2cdd3de2f236acb2cbf8a5016e6698)

10 years agoceph_filstore_dump: Save if stdout is a tty and add routine to clean binary strings
David Zafman [Tue, 20 May 2014 18:56:20 +0000 (11:56 -0700)]
ceph_filstore_dump: Save if stdout is a tty and add routine to clean binary strings

Signed-off-by: David Zafman <david.zafman@inktank.com>
(cherry picked from commit 3a574cc78b0e3ec6d8dd0c39ee20e7a54ad64056)

10 years agocommon: Add missing ghobject_t::decode() for json
David Zafman [Wed, 14 May 2014 22:30:11 +0000 (15:30 -0700)]
common: Add missing ghobject_t::decode() for json

Signed-off-by: David Zafman <david.zafman@inktank.com>
(cherry picked from commit c05f895d15a1d0e78ff5e9ae1a83f0a5424103d0)

Changes:
Adjusted for older shard_t

10 years agoceph_filestore_dump: Add --skip-journal-replay and --skip-mount-omap
David Zafman [Wed, 14 May 2014 22:37:17 +0000 (15:37 -0700)]
ceph_filestore_dump: Add --skip-journal-replay and --skip-mount-omap

Signed-off-by: David Zafman <david.zafman@inktank.com>
(cherry picked from commit 2e9dcb256509e7c921556202052f0cc1dcd91398)

10 years agoos: Add optional flags to generic ObjectStore creation (SKIP_JOURNAL_REPLAY
David Zafman [Wed, 14 May 2014 22:41:15 +0000 (15:41 -0700)]
os: Add optional flags to generic ObjectStore creation (SKIP_JOURNAL_REPLAY
and SKIP_MOUNT_OMAP)

Only FileStore cares about these flags, so passed on during create()

Signed-off-by: David Zafman <david.zafman@inktank.com>
(cherry picked from commit 3d9fde9d92322cd8ac3e3d8bcbf5b0a01ef0528b)

Conflicts:
src/os/FileStore.cc

10 years agoceph_filestore_dump: Improve debug output by showing actual offset
David Zafman [Sat, 17 May 2014 01:20:11 +0000 (18:20 -0700)]
ceph_filestore_dump: Improve debug output by showing actual offset

Signed-off-by: David Zafman <david.zafman@inktank.com>
(cherry picked from commit 44b261d5d1b36528bfbcb37dbd866b615e14be99)

10 years agoceph_filestore_dump: Use cerr now that we aren't closing stderr
David Zafman [Wed, 14 May 2014 19:36:37 +0000 (12:36 -0700)]
ceph_filestore_dump: Use cerr now that we aren't closing stderr

Signed-off-by: David Zafman <david.zafman@inktank.com>
(cherry picked from commit 087c0f9d31e0f3d5bae7eac6231978105a71677e)

10 years agocommon,ceph_filestore_dump: Add ability for utilities to suppress library dout output
David Zafman [Wed, 14 May 2014 19:42:21 +0000 (12:42 -0700)]
common,ceph_filestore_dump: Add ability for utilities to suppress library dout output

Suppress dout output with CODE_ENVIRONMENT_UTILITY_NODOUT
ceph_filestore_dump turns on dout output if --debug specified
When used it can still be enable with --log-to-stderr --err-to-stderr

Signed-off-by: David Zafman <david.zafman@inktank.com>
(cherry picked from commit f7f9b251fc377651d8da4cbfd1942c3b86f3247e)

10 years agoceph_filestore_dump: Export omap in batches for large omap case
David Zafman [Wed, 14 May 2014 01:27:30 +0000 (18:27 -0700)]
ceph_filestore_dump: Export omap in batches for large omap case

New function get_omap_batch()
Create a TYPE_OMAP section for each batch

Signed-off-by: David Zafman <david.zafman@inktank.com>
(cherry picked from commit 501dd3c05b8983159a289b021943cb828b908f53)

10 years agoceph_filestore_dump: Remove unused bufferlist databl
David Zafman [Mon, 12 May 2014 22:50:34 +0000 (15:50 -0700)]
ceph_filestore_dump: Remove unused bufferlist databl

Signed-off-by: David Zafman <david.zafman@inktank.com>
(cherry picked from commit 398b418e2b9f8260bcfacac8bcebea5beffcceca)

10 years agoceph_filestore_dump.cc: cleanup includes
Danny Al-Gaaf [Wed, 7 May 2014 12:12:15 +0000 (14:12 +0200)]
ceph_filestore_dump.cc: cleanup includes

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
(cherry picked from commit 8620609884243596d35b69c571d2da751e63cf2b)

10 years agoMerge pull request #3852 from dachary/wip-10965-rgw-firefly
Loic Dachary [Tue, 3 Mar 2015 14:58:53 +0000 (15:58 +0100)]
Merge pull request #3852 from dachary/wip-10965-rgw-firefly

rgw: enable ipv6 in civetweb

Reviewed-by: Loic Dachary <ldachary@redhat.com>
10 years agoMerge pull request #3853 from dachary/wip-10907-rgw-firefly
Loic Dachary [Tue, 3 Mar 2015 14:58:39 +0000 (15:58 +0100)]
Merge pull request #3853 from dachary/wip-10907-rgw-firefly

rgw: pass civetweb configurables to civetweb

Reviewed-by: Loic Dachary <ldachary@redhat.com>
10 years agoMerge pull request #3851 from dachary/wip-10978-rgw-firefly
Loic Dachary [Tue, 3 Mar 2015 14:58:25 +0000 (15:58 +0100)]
Merge pull request #3851 from dachary/wip-10978-rgw-firefly

rgw: don't overwrite bucket / object owner when setting acls

Reviewed-by: Loic Dachary <ldachary@redhat.com>
10 years agorgw: don't overwrite bucket / object owner when setting acls 3851/head
Yehuda Sadeh [Fri, 27 Feb 2015 23:32:50 +0000 (15:32 -0800)]
rgw: don't overwrite bucket / object owner when setting acls

Fixes: #10978
Backport: hammer, firefly

Signed-off-by: Yehuda Sadeh <yehuda@redhat.com>
(cherry picked from commit eb13f2d4b60c031f16139f7cc4237c012644dd78)

Conflicts:
src/rgw/rgw_op.cc : trivial s/.empty()/== NULL/

10 years agorgw: pass civetweb configurables to civetweb 3853/head
Yehuda Sadeh [Tue, 17 Feb 2015 23:05:40 +0000 (15:05 -0800)]
rgw: pass civetweb configurables to civetweb

Fixes: #10907
Backport: firefly

Pass any configurables in the rgw frontends config line to civetweb.

Signed-off-by: Yehuda Sadeh <yehuda@redhat.com>
(cherry picked from commit 986d7554426764a149621ba733c5c075b94e0431)

10 years agocivetweb: update submodule 3852/head
Yehuda Sadeh [Fri, 27 Feb 2015 16:14:27 +0000 (08:14 -0800)]
civetweb: update submodule

Signed-off-by: Yehuda Sadeh <yehuda@redhat.com>
(cherry picked from commit f28fe744285117a1715eac0d08911cdb37285103)

10 years agorgw: update makefile to enable civetweb config
Yehuda Sadeh [Fri, 27 Feb 2015 16:14:41 +0000 (08:14 -0800)]
rgw: update makefile to enable civetweb config

Fixes: #10965
Backport: hammer, firefly

Civetweb compilation now includes conf header to enable ipv6.

Signed-off-by: Yehuda Sadeh <yehuda@redhat.com>
(cherry picked from commit caa90225bad9fe5e9c275e6189b3396b4d396e3f)

Conflicts:
src/rgw/Makefile.am
           radosgw_CFLAGS = -Icivetweb/include
        was not yet changed into
           radosgw_CFLAGS = -I$(srcdir)/civetweb/include
        in firefly

10 years agoMerge pull request #3820 from tchaikov/firefly-pg-leak-10421
Loic Dachary [Sat, 28 Feb 2015 15:47:55 +0000 (16:47 +0100)]
Merge pull request #3820 from tchaikov/firefly-pg-leak-10421

osd: fix PG leak in SnapTrimWQ._clear()

Reviewed-by: Loic Dachary <ldachary@redhat.com>
10 years agoMerge pull request #3772 from ceph/wip-10883-firefly
Loic Dachary [Sat, 28 Feb 2015 15:46:42 +0000 (16:46 +0100)]
Merge pull request #3772 from ceph/wip-10883-firefly

osd: Fix FileJournal wrap to get header out first

Reviewed-by: Loic Dachary <ldachary@redhat.com>
10 years agoMerge pull request #3521 from dzafman/wip-10676
Loic Dachary [Sat, 28 Feb 2015 15:45:48 +0000 (16:45 +0100)]
Merge pull request #3521 from dzafman/wip-10676

Backport doc fixes that appear to apply to firefly

Reviewed-by: Loic Dachary <ldachary@redhat.com>
10 years agoosd: fix PG leak in SnapTrimWQ._clear() 3820/head
Kefu Chai [Tue, 10 Feb 2015 08:29:45 +0000 (16:29 +0800)]
osd: fix PG leak in SnapTrimWQ._clear()

Fixes: #10421
Signed-off-by: Kefu Chai <kchai@redhat.com>
(cherry picked from commit 01e154d592d6cdbf3f859cf1b4357e803536a6b4)

10 years agoMerge pull request #3730 from ceph/wip-firefly-flock
Gregory Farnum [Thu, 26 Feb 2015 23:59:24 +0000 (15:59 -0800)]
Merge pull request #3730 from ceph/wip-firefly-flock

backport ceph-fuse file locking patches to Firefly

Reviewed-by: Yan, Zheng <zyan@redhat.com>
10 years agoMerge pull request #3406 from ceph/wip-10299-firefly
Josh Durgin [Thu, 26 Feb 2015 22:18:10 +0000 (14:18 -0800)]
Merge pull request #3406 from ceph/wip-10299-firefly

librbd: complete all pending aio ops prior to closing image

Reviewed-by: Josh Durgin <jdurgin@redhat.com>
10 years agolibrbd: complete all pending aio ops prior to closing image 3406/head
Jason Dillaman [Mon, 15 Dec 2014 15:53:53 +0000 (10:53 -0500)]
librbd: complete all pending aio ops prior to closing image

It was possible for an image to be closed while aio operations
were still outstanding.  Now all aio operations are tracked and
completed before the image is closed.

Fixes: #10299
Backport: giant, firefly, dumpling
Signed-off-by: Jason Dillaman <dillaman@redhat.com>
10 years agoMerge pull request #3404 from ceph/wip-10270-firefly
Josh Durgin [Thu, 26 Feb 2015 22:12:29 +0000 (14:12 -0800)]
Merge pull request #3404 from ceph/wip-10270-firefly

librbd: gracefully handle deleted/renamed pools

Reviewed-by: Josh Durgin <jdurgin@redhat.com>
10 years agoMerge pull request #3410 from ceph/wip-9854-firefly
Josh Durgin [Thu, 26 Feb 2015 21:31:37 +0000 (13:31 -0800)]
Merge pull request #3410 from ceph/wip-9854-firefly

osdc: Constrain max number of in-flight read requests

Reviewed-by: Josh Durgin <jdurgin@redhat.com>
10 years agoosd: Fix FileJournal wrap to get header out first 3772/head
David Zafman [Thu, 19 Feb 2015 00:21:12 +0000 (16:21 -0800)]
osd: Fix FileJournal wrap to get header out first

Correct and restore assert that was removed

Cause by f46b1b473fce0322a672b16c7739e569a45054b6
Fixes: #10883
Backport: dumpling, firefly, giant

Signed-off-by: David Zafman <dzafman@redhat.com>
(cherry picked from commit 970bb4901f93575709421b5b25c3eff213de61b8)

10 years agoqa/workunits/fs/misc: Add a workunit for file lock interruption 3730/head
Yan, Zheng [Wed, 15 Oct 2014 04:00:58 +0000 (12:00 +0800)]
qa/workunits/fs/misc: Add a workunit for file lock interruption

Signed-off-by: Yan, Zheng <zyan@redhat.com>
(cherry picked from commit ac92c455a9aa19e4288acdf0c9a746e03a640efb)

10 years agomds: fix neighbor lock check
Yan, Zheng [Wed, 15 Oct 2014 04:03:46 +0000 (12:03 +0800)]
mds: fix neighbor lock check

Signed-off-by: Yan, Zheng <zyan@redhat.com>
(cherry picked from commit b0e6e85aa08ea74cd209aad04f3f0bf991761e12)

10 years agoclient: use finisher to abort MDS request
Yan, Zheng [Mon, 13 Oct 2014 03:34:18 +0000 (11:34 +0800)]
client: use finisher to abort MDS request

When a request is interrupted, libfuse first locks an internal mutex,
then calls the interrupt callback. libfuse need to lock the same mutex
when unregistering interrupt callback. We unregister interrupt callback
while client_lock is locked, so we can't acquiring the client_lock in
the interrupt callback.

Signed-off-by: Yan, Zheng <zyan@redhat.com>
(cherry picked from commit 09699454e729592d426aeff5b578697e850af12e)

Conflicts:
src/client/Client.cc
src/client/Client.h

Signed-off-by: Greg Farnum <gfarnum@redhat.com>
10 years agoclient: use atomic variable to track reference of MetaRequeset
Yan, Zheng [Thu, 9 Oct 2014 05:16:18 +0000 (13:16 +0800)]
client: use atomic variable to track reference of MetaRequeset

this allow us to increase reference count of MetaRequest while not holding
the client_lock

Signed-off-by: Yan, Zheng <zyan@redhat.com>
(cherry picked from commit e464a7765230c504b3e3b88bcb1106f67b7c3eb9)

10 years agoclient: allow interrupting blocked file lock operation
Yan, Zheng [Mon, 13 Oct 2014 02:44:46 +0000 (10:44 +0800)]
client: allow interrupting blocked file lock operation

This commit introduce two new types of setfilelock request. Unlike
setfilelock (UNLOCK) request, these two new types of setfilelock request
do not drop locks that have alread been acquired, they only interrupt
blocked setfilelock request.

Signed-off-by: Yan, Zheng <zyan@redhat.com>
(cherry picked from commit 4134c149d3759dd6a3aaa1a353b77bbfe8e9491b)

10 years agoclient: register callback for fuse interrupt
Yan, Zheng [Thu, 9 Oct 2014 01:42:08 +0000 (09:42 +0800)]
client: register callback for fuse interrupt

libfuse allows program to reigster a callback for interrupt. When a file
system operation is interrupted, the fuse kernel driver sends interupt
request to libfuse. libfuse calls the interrupt callback when receiving
interrupt request.

Signed-off-by: Yan, Zheng <zyan@redhat.com>
(cherry picked from commit 289e8b4a7efa1ae6427115af9bbe541c9e1f0e90)

10 years agoclient: add helper function that updates lock state
Yan, Zheng [Sat, 4 Oct 2014 01:14:44 +0000 (09:14 +0800)]
client: add helper function that updates lock state

Signed-off-by: Yan, Zheng <zyan@redhat.com>
(cherry picked from commit 6a2303a6b6d97f2a6d1422e42d3d88991857618f)

Conflicts:
src/client/Client.h

Signed-off-by: Greg Farnum <gfarnum@redhat.com>
10 years agofuse: enable fuse_multithreaded by default
Yan, Zheng [Thu, 2 Oct 2014 12:21:36 +0000 (20:21 +0800)]
fuse: enable fuse_multithreaded by default

GETFILELOCK MDS request may block for a long time, so we need to
use multithread event loop,

Signed-off-by: Yan, Zheng <zyan@redhat.com>
(cherry picked from commit b17b43a8660ed0db29fbecf44798265e47712f85)

10 years agoclient: posix file lock support
Yan, Zheng [Thu, 2 Oct 2014 11:07:41 +0000 (19:07 +0800)]
client: posix file lock support

Signed-off-by: Yan, Zheng <zyan@redhat.com>
(cherry picked from commit a1b2c8ff955b30807ac53ce6bdc97cf61a7262ca)

Conflicts:
src/client/Client.cc
src/client/Client.h
src/client/Inode.h

Signed-off-by: Greg Farnum <gfarnum@redhat.com>
10 years agocommon: link mds/flock.o to libcommon
Yan, Zheng [Thu, 2 Oct 2014 10:02:50 +0000 (18:02 +0800)]
common: link mds/flock.o to libcommon

later commit will use this code to track file locks held by cephfs
client.

Signed-off-by: Yan, Zheng <zyan@redhat.com>
(cherry picked from commit e075c27c3554380c59dce0cc17ef0944eb415025)

Conflicts:
src/mds/Makefile.am

Signed-off-by: Greg Farnum <gfarnum@redhat.com>
10 years agoMerge pull request #3684 from ceph/wip-crush-straw-firefly
Loic Dachary [Fri, 13 Feb 2015 17:34:11 +0000 (18:34 +0100)]
Merge pull request #3684 from ceph/wip-crush-straw-firefly

osd: backport straw bucket fixes and all other recent crush goodness to firefly

Reviewed-by: Loic Dachary <ldachary@redhat.com>
10 years agocrush/builder: fix warnings 3684/head
Sage Weil [Fri, 16 Jan 2015 17:02:28 +0000 (09:02 -0800)]
crush/builder: fix warnings

crush/builder.c: In function 'crush_remove_list_bucket_item':
crush/builder.c:977:13: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
  if (weight < bucket->h.weight)
             ^
crush/builder.c: In function 'crush_remove_tree_bucket_item':
crush/builder.c:1031:14: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
   if (weight < bucket->h.weight)
              ^

Signed-off-by: Sage Weil <sage@redhat.com>
(cherry picked from commit 14eb1a73c71d81b7f193fce27c59cb3babf3e74a)

10 years agocrush: improve constness of CrushWrapper methods
Loic Dachary [Thu, 16 Oct 2014 00:02:58 +0000 (17:02 -0700)]
crush: improve constness of CrushWrapper methods

A number of CrushWrapper get methods or predicates were not const
because they need to maintain transparently the rmaps. Make the rmaps
mutable and update the constness of the methods to match what the caller
would expect.

Signed-off-by: Loic Dachary <loic-201408@dachary.org>
(cherry picked from commit 236895eea65f8706baa5fdef96fb00ad5b82218c)

10 years agoChange CrushWrapper::crush to private
Xiaoxi Chen [Fri, 5 Sep 2014 02:56:36 +0000 (10:56 +0800)]
Change CrushWrapper::crush to private

Currently in CrushWrapper, the member "struct crush_map *crush"  is a public member,
so people can break the encapsulation and manipulate directly to the crush structure.

This is not a good practice for encapsulation and will lead to inconsistent if code
mix use the CrushWrapper API and crush C API.A simple example could be:
1.some code use crush_add_rule(C-API) to add a rule, which will not set the have_rmap flag to false in CrushWrapper
2.another code using CrushWrapper trying to look up the newly added rule by name will get a -ENOENT.

This patch move CrushWrapper::crush to private, together with three reverse map(type_rmap, name_rmap, rule_name_rmap)
and also change codes accessing the CrushWrapper::crush to make it compile.

Signed-off-by: Xiaoxi Chen <xiaoxi.chen@intel.com>
(cherry picked from commit d734600f9251b52f525faa35441e2b5dd660161b)

10 years agocrush: include CRUSH_V3, v2/v3 rules checks in dump_tunables()
Sage Weil [Fri, 11 Jul 2014 13:58:57 +0000 (06:58 -0700)]
crush: include CRUSH_V3, v2/v3 rules checks in dump_tunables()

Backport: firefly
Signed-off-by: Sage Weil <sage@inktank.com>
(cherry picked from commit cf94cf3531a349bbd1fc6ee56c3fc260110a252a)

10 years agomon: 'osd crush reweight-all'
Sage Weil [Fri, 5 Dec 2014 23:58:03 +0000 (15:58 -0800)]
mon: 'osd crush reweight-all'

This corresponds to the crushtool --reweight command.

Signed-off-by: Sage Weil <sage@redhat.com>
(cherry picked from commit 89b2feea8d53b9dc15ab5ae7f5920ad19c8bba18)

10 years agocrush: set straw_calc_version=1 for default+optimal; do not touch for presets
Sage Weil [Fri, 5 Dec 2014 23:55:24 +0000 (15:55 -0800)]
crush: set straw_calc_version=1 for default+optimal; do not touch for presets

When using the presets for compatibility (i.e., based on version), do not
touch the straw behavior, as it does not affect mapping or compatibility.
However, make a point of setting it by default and for optimal.

For most users, this means that they will not see any change unless they
explicitly enable the new behavior, or switch to default or optimal
tunables.  The idea is that if they touched it, they shouldn't be
too surprised by the subsequent data movement.

Signed-off-by: Sage Weil <sage@redhat.com>
(cherry picked from commit dd7b58f3b1aa1febfc6dc227937df93ee6e284eb)

(Note: differs from original in that the hammer tunable profile is not
present)

10 years agocrush/builder: a note about the original crush_calc_straw()
Sage Weil [Thu, 4 Dec 2014 06:30:00 +0000 (22:30 -0800)]
crush/builder: a note about the original crush_calc_straw()

Signed-off-by: Sage Weil <sage@redhat.com>
(cherry picked from commit adf5c6de0aca24a53d3c7b4e7eeb0a5dce9db0f1)

10 years agomon: add 'osd crush {get,set}-tunable <name> [value]' commands
Sage Weil [Wed, 3 Dec 2014 00:43:16 +0000 (16:43 -0800)]
mon: add 'osd crush {get,set}-tunable <name> [value]' commands

For now, just add the straw_calc_version tunable.

Signed-off-by: Sage Weil <sage@redhat.com>
(cherry picked from commit 9000068ae45a8b89315c152b7d5509ac873f2957)

Conflicts:
src/mon/OSDMonitor.cc

10 years agocrush: fix crush_calc_straw() scalers when there are duplicate weights
Sage Weil [Wed, 3 Dec 2014 00:33:11 +0000 (16:33 -0800)]
crush: fix crush_calc_straw() scalers when there are duplicate weights

The straw bucket was originally tested with uniform weights and with a
few more complicated patterns, like a stair step (1,2,3,4,5,6,7,8,9).  And
it worked!

However, it does not behave with a pattern like
 1, 2, 2, 3, 3, 4, 4

Strangely, it does behave with
 1, 1, 2, 2, 3, 3, 4, 4

and more usefully it does behave with
 1, 2, 2.001, 3, 3.001, 4, 4.001

That is, the logic that explicitly copes with weights that are duplicates
is broken.

The fix is to simply remove the special handling for duplicate weights --
it isn't necessary and doesn't work correctly anyway.

Add a test that compares the mapping result of  [1, 2, 2, 3, 3, ...] with
[1, 2, 2.001, 3, 3.001, ...] and verifies that the difference is small.
With the fix, we get .00012, whereas the original implementation gets
.015.

Note that this changes the straw bucket scalar *precalculated* values that
are encoded with the map, and only when the admin opts into the new behavior.

Backport: giant, firefly
Signed-off-by: Sage Weil <sage@redhat.com>
(cherry picked from commit 43d5c7caa7ce478477bde1bbd4f0649b5159cdcf)

10 years agocrush: fix distortion of straw scalers by 0-weight items
Sage Weil [Tue, 2 Dec 2014 22:50:21 +0000 (14:50 -0800)]
crush: fix distortion of straw scalers by 0-weight items

The presence of a 0-weight item in a straw bucket should have no effect
on the placement of other items.  Add a test validating that and fix
crush_calc_straw() to fix the distortion.

Note that this effects the *precalculation* of the straw bucket inputs and
does not effect the actually mapping process given a compiled or encoded
CRUSH map, and only when straw_calc_version == 1 (i.e., the admin opted in
to the new behavior).

Backport: giant, firefly
Signed-off-by: Sage Weil <sage@redhat.com>
(cherry picked from commit 85498bc8f62ca56506b33f3c5ec4fc4b111ed73d)