]> git.apps.os.sepia.ceph.com Git - ceph.git/log
ceph.git
12 years agorbd.py: add some missing functions
Josh Durgin [Sun, 31 Mar 2013 14:49:59 +0000 (07:49 -0700)]
rbd.py: add some missing functions

discard, flush, and striping info slipped through the cracks before,
but are useful and trivial to add.

Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
12 years agolibrbd: add C and python bindings for diff_iterate
Josh Durgin [Sun, 31 Mar 2013 14:48:49 +0000 (07:48 -0700)]
librbd: add C and python bindings for diff_iterate

The python interface is a bit awkward since it maps directly
to the C interface, but it'll work well enough and not use
tons of memory.

Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
12 years agolibrados: don't insert zero length extents in a diff
Josh Durgin [Mon, 1 Apr 2013 06:07:39 +0000 (23:07 -0700)]
librados: don't insert zero length extents in a diff

They're useless, and trigger an assert in interval_set::inesrt.

Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
12 years agorbd: add formatted output to diff command
Josh Durgin [Sun, 31 Mar 2013 00:32:08 +0000 (17:32 -0700)]
rbd: add formatted output to diff command

All the other commands that display information have this.
For consistency, add it to this command too.

Also switch the plain output to use a TextTable for better readability.

Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
12 years agolibrbd: return -ENOENT from diff_iterate when the snap doesn't exist
Josh Durgin [Sun, 31 Mar 2013 00:28:35 +0000 (17:28 -0700)]
librbd: return -ENOENT from diff_iterate when the snap doesn't exist

This is a bit more helpful than -EINVAL.

Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
12 years agorbd: initialize random number generator for bench-write
Josh Durgin [Sun, 31 Mar 2013 00:27:25 +0000 (17:27 -0700)]
rbd: initialize random number generator for bench-write

Without this, the same seed is used each time, so multiple runs
of bench-write with the same parameters have the same I/O pattern.

Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
12 years agolibrbd: change diff_iterate interface to be more C-friendly
Josh Durgin [Sun, 31 Mar 2013 00:25:18 +0000 (17:25 -0700)]
librbd: change diff_iterate interface to be more C-friendly

Use int instead of bool for the callback, and make it represent
whether the data exists, rather than the opposite, since callers
are likely to test for whether it's data instead of whether its zeroes.

Change the return value to 0, since an int64_t will wrap around
for large reads, and there's no value in reporting the length
read when it will always be the length requested clipped to the
size of the image.

Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
12 years agorbd: remove alway-true else condition in import-diff
Josh Durgin [Sat, 30 Mar 2013 00:06:08 +0000 (17:06 -0700)]
rbd: remove alway-true else condition in import-diff

Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
12 years agorbd: make diff banner length depend on the banner
Josh Durgin [Sat, 30 Mar 2013 00:03:59 +0000 (17:03 -0700)]
rbd: make diff banner length depend on the banner

Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
12 years agorbd: fail import-diff if we reach the end of the stream sooner than expected
Josh Durgin [Fri, 29 Mar 2013 23:48:02 +0000 (16:48 -0700)]
rbd: fail import-diff if we reach the end of the stream sooner than expected

safe_read() just protects against EINTR, and may return less data than
requested if it reaches the end of the file. Use safe_read_exact() to
make sure we get the right amount of data.

Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
12 years agorbd: complete progress for import-diff from stdin
Josh Durgin [Fri, 29 Mar 2013 23:44:50 +0000 (16:44 -0700)]
rbd: complete progress for import-diff from stdin

The diff format gives us a size, so unlike a normal import, we do update progress.

Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
12 years agorbd: fix else style in import-diff
Josh Durgin [Fri, 29 Mar 2013 23:41:42 +0000 (16:41 -0700)]
rbd: fix else style in import-diff

Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
12 years agorbd: update progress as a diff is exported
Josh Durgin [Fri, 29 Mar 2013 23:35:20 +0000 (16:35 -0700)]
rbd: update progress as a diff is exported

This will be jumpy since changed extents probably aren't evenly
distributed, but it's better than nothing.

Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
12 years agorbd: remove unused argument from do_diff()
Josh Durgin [Fri, 29 Mar 2013 23:27:32 +0000 (16:27 -0700)]
rbd: remove unused argument from do_diff()

Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
12 years agorbd: fix size change output
Sage Weil [Fri, 29 Mar 2013 15:20:22 +0000 (08:20 -0700)]
rbd: fix size change output

Signed-off-by: Sage Weil <sage@inktank.com>
12 years agorbd: send progress info to stderr, not stdout
Sage Weil [Fri, 29 Mar 2013 15:17:49 +0000 (08:17 -0700)]
rbd: send progress info to stderr, not stdout

This avoids interfering when export is sent to stdout.

Signed-off-by: Sage Weil <sage@inktank.com>
12 years agorbd: include 'diff' command in man page
Sage Weil [Fri, 29 Mar 2013 04:48:51 +0000 (21:48 -0700)]
rbd: include 'diff' command in man page

Signed-off-by: Sage Weil <sage@inktank.com>
12 years agorbd: update man page for import-diff and export-diff
Sage Weil [Fri, 29 Mar 2013 04:47:12 +0000 (21:47 -0700)]
rbd: update man page for import-diff and export-diff

Signed-off-by: Sage Weil <sage@inktank.com>
12 years agorbd: prevent import-diff if start snapshot is not already present
Sage Weil [Fri, 29 Mar 2013 04:53:30 +0000 (21:53 -0700)]
rbd: prevent import-diff if start snapshot is not already present

Signed-off-by: Sage Weil <sage@inktank.com>
12 years agorbd: fail import-diff if end snap already exists
Sage Weil [Fri, 29 Mar 2013 04:29:55 +0000 (21:29 -0700)]
rbd: fail import-diff if end snap already exists

This will prevent a user from inadvertantly reapplying a diff twice.

Signed-off-by: Sage Weil <sage@inktank.com>
12 years agodoc/dev/rbd-diff: specify that metadata records come before data
Sage Weil [Fri, 29 Mar 2013 04:19:32 +0000 (21:19 -0700)]
doc/dev/rbd-diff: specify that metadata records come before data

Signed-off-by: Sage Weil <sage@inktank.com>
12 years agolibrbd: implement image.snap_exists()
Sage Weil [Fri, 29 Mar 2013 04:17:21 +0000 (21:17 -0700)]
librbd: implement image.snap_exists()

This is a much more convenient way to tell if a snapshot already exists.

Signed-off-by: Sage Weil <sage@inktank.com>
12 years agolibrados: move snap_set_diff to librados/
Sage Weil [Thu, 28 Mar 2013 23:44:23 +0000 (16:44 -0700)]
librados: move snap_set_diff to librados/

This is most closely related to the librados list_snaps API; move it there.

Signed-off-by: Sage Weil <sage@inktank.com>
12 years agolibrados: cleanly define SNAP_HEAD, SNAP_DIR constants
Sage Weil [Thu, 28 Mar 2013 23:13:35 +0000 (16:13 -0700)]
librados: cleanly define SNAP_HEAD, SNAP_DIR constants

We were using the internal CEPH_NOSNAP and CEPH_SNAPDIR constants, and
defining a clone_info_t::HEAD (with a different value).  The docs were
referrring to the internal constant names.

Instead, define librados constants (C and C++) with the same values as the
internal types.

Note that this changes the clone_info_t::HEAD value from -1 to -2 so that
it now matches the internal type.

Signed-off-by: Sage Weil <sage@inktank.com>
12 years agolibrados: document list_snaps
Sage Weil [Thu, 28 Mar 2013 23:01:55 +0000 (16:01 -0700)]
librados: document list_snaps

Signed-off-by: Sage Weil <sage@inktank.com>
12 years agolibrbd: drop unused elapsed calc for diff_iterate
Sage Weil [Thu, 28 Mar 2013 22:40:26 +0000 (15:40 -0700)]
librbd: drop unused elapsed calc for diff_iterate

Signed-off-by: Sage Weil <sage@inktank.com>
12 years agolibrbd: diff_iterate fromsnapname after the end snap is also invalid
Sage Weil [Thu, 28 Mar 2013 22:17:19 +0000 (15:17 -0700)]
librbd: diff_iterate fromsnapname after the end snap is also invalid

Signed-off-by: Sage Weil <sage@inktank.com>
12 years agolibrbd: document diff_iterate in header
Sage Weil [Thu, 28 Mar 2013 22:16:35 +0000 (15:16 -0700)]
librbd: document diff_iterate in header

Signed-off-by: Sage Weil <sage@inktank.com>
12 years agolibrbd: uint64_t len for diff_iterate
Sage Weil [Thu, 28 Mar 2013 22:12:11 +0000 (15:12 -0700)]
librbd: uint64_t len for diff_iterate

Signed-off-by: Sage Weil <sage@inktank.com>
12 years agodoc/dev/rbd-diff: update incremental file format
Sage Weil [Thu, 28 Mar 2013 21:19:59 +0000 (14:19 -0700)]
doc/dev/rbd-diff: update incremental file format

Signed-off-by: Sage Weil <sage@inktank.com>
12 years agoqa: rbd/diff_continuous.sh: use non-standard striping
Sage Weil [Thu, 28 Mar 2013 21:13:46 +0000 (14:13 -0700)]
qa: rbd/diff_continuous.sh: use non-standard striping

Exercise the striping arithmetic by using non-standard striping that
varies between the parent and child.

Signed-off-by: Sage Weil <sage@inktank.com>
12 years agolibrbd: fix diff_iterate arithmetic for non-standard striping
Sage Weil [Thu, 28 Mar 2013 21:13:03 +0000 (14:13 -0700)]
librbd: fix diff_iterate arithmetic for non-standard striping

This code is confusing because we are moving back and forth between
image offsets, "buffer" offsets (image offsets relative to off), and
object offsets.  Fix the math.

Signed-off-by: Sage Weil <sage@inktank.com>
12 years agoqa: rbd/diff_continuous.sh: base test off a clone
Sage Weil [Thu, 28 Mar 2013 04:26:54 +0000 (21:26 -0700)]
qa: rbd/diff_continuous.sh: base test off a clone

Get a bit of coverage on clones by starting with a clone.

Signed-off-by: Sage Weil <sage@inktank.com>
12 years agorbd: implement simple 'diff' command
Sage Weil [Thu, 28 Mar 2013 16:26:43 +0000 (09:26 -0700)]
rbd: implement simple 'diff' command

Report extents allocated/changed, and whether they contain data or zeros.

Signed-off-by: Sage Weil <sage@inktank.com>
12 years agolibrbd: handle diff from clone
Sage Weil [Thu, 28 Mar 2013 16:26:11 +0000 (09:26 -0700)]
librbd: handle diff from clone

If we have a parent image, and the reference is from snap 0 (beginning of
time) we need to look at the diff on the parent from the beginning of time
and report that when we get an ENOENT.

Signed-off-by: Sage Weil <sage@inktank.com>
12 years agorbd: send import debug noise to dout, not stdout
Sage Weil [Wed, 27 Mar 2013 18:07:53 +0000 (11:07 -0700)]
rbd: send import debug noise to dout, not stdout

Signed-off-by: Sage Weil <sage@inktank.com>
12 years agoqa: add rbd/diff_continuous.sh stress test
Sage Weil [Wed, 27 Mar 2013 06:16:54 +0000 (23:16 -0700)]
qa: add rbd/diff_continuous.sh stress test

Stress test that does io on an image while we are mirroring a diff from
earlier snaps to a second copy.  At the end, verify that all snaps have
matching content.

Signed-off-by: Sage Weil <sage@inktank.com>
12 years agorbd: implement 'export-diff' and 'import-diff' commands
Sage Weil [Tue, 26 Mar 2013 20:32:28 +0000 (13:32 -0700)]
rbd: implement 'export-diff' and 'import-diff' commands

Export a diff of an image from a previous snapshot to a file (or stdout).

Import a diff and apply it to an image, and then create the ending
snapshot.

Signed-off-by: Sage Weil <sage@inktank.com>
12 years agorbd: add --io-pattern <seq|rand> option to bench-write
Sage Weil [Tue, 26 Mar 2013 20:33:00 +0000 (13:33 -0700)]
rbd: add --io-pattern <seq|rand> option to bench-write

Write to random offsets instead of sequentially.

Signed-off-by: Sage Weil <sage@inktank.com>
12 years agolibrbd: implement diff_iterate
Sage Weil [Mon, 25 Mar 2013 21:14:50 +0000 (14:14 -0700)]
librbd: implement diff_iterate

Implement a diff_iterate() method that will iterate over an image and
report which extents vary between two snapshots (or a snapshot and the
head).  The callback gets an extent and a flag indicating whether it is
full of data or is known to be zero in the ending snapshot.

Signed-off-by: Sage Weil <sage@inktank.com>
12 years agolibrados: expose snapset seq via list_snaps
Sage Weil [Tue, 26 Mar 2013 04:02:37 +0000 (21:02 -0700)]
librados: expose snapset seq via list_snaps

Signed-off-by: Sage Weil <sage@inktank.com>
12 years agoosdc/Objecter: prval optional for listsnaps
Sage Weil [Mon, 25 Mar 2013 04:18:46 +0000 (21:18 -0700)]
osdc/Objecter: prval optional for listsnaps

Signed-off-by: Sage Weil <sage@inktank.com>
12 years agoosd: fix error codes for list-snaps
Sage Weil [Tue, 26 Mar 2013 15:53:09 +0000 (08:53 -0700)]
osd: fix error codes for list-snaps

Signed-off-by: Sage Weil <sage@inktank.com>
12 years agoosd: fix clone snap list for list-snaps
Sage Weil [Tue, 26 Mar 2013 15:53:00 +0000 (08:53 -0700)]
osd: fix clone snap list for list-snaps

We need to return the list of snaps that each clone is defined for, not
the list of snaps we know may or may not exist globally over a similar
interval.  This requires looking at the clone's obc, unfortunately.

Signed-off-by: Sage Weil <sage@inktank.com>
12 years agoosd: wait for all clones on SNAPDIR requests
Sage Weil [Wed, 27 Mar 2013 01:07:07 +0000 (18:07 -0700)]
osd: wait for all clones on SNAPDIR requests

Wait for all clones to be present.

Signed-off-by: Sage Weil <sage@inktank.com>
12 years agoosd: direct reads on SNAPDIR to either head or snapdir
Sage Weil [Tue, 26 Mar 2013 17:31:19 +0000 (10:31 -0700)]
osd: direct reads on SNAPDIR to either head or snapdir

The list_snaps operation needs to look at the SnapSet, and is logically
querying all revisions of the object.  Make requests to SNAPDIR be
read-only, and grab the head or snapdir obc transparently (whichever one
exists).  This allows us to list snaps when, say, the head does not
exist, but there are in fact snaps.

Signed-off-by: Sage Weil <sage@inktank.com>
12 years agoosd: do not include snaps with head on list_snaps()
Sage Weil [Tue, 26 Mar 2013 04:18:47 +0000 (21:18 -0700)]
osd: do not include snaps with head on list_snaps()

If there is a sequence of snaps 1, 2, 3, 4, 5, and we have a clone
2 with [1,2], and the head reflects content at snap times [3,4,5], then
the snap_list should return

 clone 2 snaps [1,2]
 head snaps
 seq 2

because it never saw a write after snap 2, and therefor has the same
content currently as it did in snaps 3,4,5.  If the SnapSet on the
object lists snaps 3,4,5, and the head exists, it actually means the
object was deleted between 2 and 3, and was recreated after 5:

 clone 2 snaps [1,2]
 head snaps []
 seq 5

The key to telling the two situations apart is the seq number on the
SnapSet (now included in the list_snaps reply) that tells us when the
last update was.

Signed-off-by: Sage Weil <sage@inktank.com>
12 years agoosd: clean up some whitespace
Sage Weil [Tue, 26 Mar 2013 03:59:23 +0000 (20:59 -0700)]
osd: clean up some whitespace

Signed-off-by: Sage Weil <sage@inktank.com>
12 years agoosd: include SnapSet seq in the list snaps response
Sage Weil [Tue, 26 Mar 2013 03:59:11 +0000 (20:59 -0700)]
osd: include SnapSet seq in the list snaps response

It is important to know the latest seq that the object has seen in order
to tell if a response like

 clone 2 snaps=[1,2]
 clone head snaps=[]

was untouched before a hypothetical snap 3, or deleted prior to snap 3,
and then recreated+modified after.

Signed-off-by: Sage Weil <sage@inktank.com>
12 years agoosd: make LIST_WATCHERS and LIST_SNAPS print nicely for OSDOp
Sage Weil [Mon, 25 Mar 2013 04:18:31 +0000 (21:18 -0700)]
osd: make LIST_WATCHERS and LIST_SNAPS print nicely for OSDOp

Signed-off-by: Sage Weil <sage@inktank.com>
12 years agostrings: add 'list-watchers' to MOSDOp strings
Sage Weil [Mon, 25 Mar 2013 04:18:09 +0000 (21:18 -0700)]
strings: add 'list-watchers' to MOSDOp strings

Signed-off-by: Sage Weil <sage@inktank.com>
12 years agoMerge pull request #175 from dachary/wip-4594
Sage Weil [Sun, 31 Mar 2013 01:22:01 +0000 (18:22 -0700)]
Merge pull request #175 from dachary/wip-4594

fix null character in object name triggering segfault

Reviewed-by: Sage Weil <sage@inktank.com>
12 years agofix null character in object name triggering segfault 175/head
Loic Dachary [Sat, 30 Mar 2013 10:26:12 +0000 (11:26 +0100)]
fix null character in object name triggering segfault

Parsing \n in  lfn_parse_object_name is implemented with

  out->append('\0');

which segfaults when using libstdc++ and g++ version 4.6.3 on Debian
GNU/Linux. It is replaced with

  (*out) += '\0';

to avoid the bugous implicit conversion. There is no append(charT)
method in C++98 or C++11, which means it relies on an implicit
conversion that is bugous. It would be better to rely on the
basic_string& operator+=(charT c); method as defined in ISO 14882-1998
(page 385) thru ISO 14882-2012 (page 640)

A set of tests is added to generate and parse object names. They need
access to the private function lfn_parse_object_name because there is
no convenient protected method to exercise it. The tests contain a
LFNIndex derived class, TestWrapLFNIndex which is made a friend of
LFNIndex to gain access to the private methods.

http://tracker.ceph.com/issues/4594 refs #4594

Signed-off-by: Loic Dachary <loic@dachary.org>
12 years agoMerge branch 'wip-4490'
Sage Weil [Sat, 30 Mar 2013 01:02:15 +0000 (18:02 -0700)]
Merge branch 'wip-4490'

12 years agomon: OSDMonitor: add 'osd pool set-quota' command 174/head
Sage Weil [Sat, 30 Mar 2013 00:59:35 +0000 (17:59 -0700)]
mon: OSDMonitor: add 'osd pool set-quota' command

Signed-off-by: Joao Eduardo Luis <joao.luis@inktank.com>
12 years agodoc: Added entries for Pool, PG, & CRUSH. Moved heartbeat link.
John Wilkins [Sat, 30 Mar 2013 00:38:48 +0000 (17:38 -0700)]
doc: Added entries for Pool, PG, & CRUSH. Moved heartbeat link.

Signed-off-by: John Wilkins <john.wilkins@inktank.com>
12 years agodoc: Added heartbeat configuration settings.
John Wilkins [Sat, 30 Mar 2013 00:38:02 +0000 (17:38 -0700)]
doc: Added heartbeat configuration settings.

Signed-off-by: John Wilkins <john.wilkins@inktank.com>
12 years agodoc: Moved PG info to separate page. Moved heartbeat to mon-osd doc.
John Wilkins [Sat, 30 Mar 2013 00:36:23 +0000 (17:36 -0700)]
doc: Moved PG info to separate page. Moved heartbeat to mon-osd doc.

Signed-off-by: John Wilkins <john.wilkins@inktank.com>
12 years agodoc: Rewrote monitor configuration section.
John Wilkins [Sat, 30 Mar 2013 00:34:45 +0000 (17:34 -0700)]
doc: Rewrote monitor configuration section.

Signed-off-by: John Wilkins <john.wilkins@inktank.com>
12 years agodoc: Moved to separate section for parallelism.
John Wilkins [Sat, 30 Mar 2013 00:32:47 +0000 (17:32 -0700)]
doc: Moved to separate section for parallelism.

Signed-off-by: John Wilkins <john.wilkins@inktank.com>
12 years agodoc: Cleanup.
John Wilkins [Sat, 30 Mar 2013 00:32:00 +0000 (17:32 -0700)]
doc: Cleanup.

Signed-off-by: John Wilkins <john.wilkins@inktank.com>
12 years agoceph-disk list: say 'unknown cluster $UUID' when cluster is unknown
Sage Weil [Sat, 30 Mar 2013 00:30:28 +0000 (17:30 -0700)]
ceph-disk list: say 'unknown cluster $UUID' when cluster is unknown

This makes it clearer that an old osd is in fact old.

Signed-off-by: Sage Weil <sage@inktank.com>
12 years agoconfig_opts: fix rgw_port comments to be plaintext
Greg Farnum [Sat, 30 Mar 2013 00:04:58 +0000 (17:04 -0700)]
config_opts: fix rgw_port comments to be plaintext

Signed-off-by: Greg Farnum <greg@inktank.com>
12 years agoReplicatedPG: check for full if delta_stats.num_bytes > 0
Samuel Just [Fri, 29 Mar 2013 21:27:29 +0000 (14:27 -0700)]
ReplicatedPG: check for full if delta_stats.num_bytes > 0

Signed-off-by: Samuel Just <sam.just@inktank.com>
12 years agomon: Monitor: check if 'pss' arg is !NULL on parse_pos_long()
Joao Eduardo Luis [Fri, 29 Mar 2013 15:28:51 +0000 (15:28 +0000)]
mon: Monitor: check if 'pss' arg is !NULL on parse_pos_long()

We already do it all throughout the function, but this one place didn't.

Signed-off-by: Joao Eduardo Luis <joao.luis@inktank.com>
12 years agocommon: util: add 'unit_to_bytesize()' function
Joao Eduardo Luis [Fri, 29 Mar 2013 15:27:35 +0000 (15:27 +0000)]
common: util: add 'unit_to_bytesize()' function

Converts from a numerical value that may or may not contain an unit
modifier ('1024', '1K', '2M', ..., '1E') and returns the parsed size
in bytes.

Signed-off-by: Joao Eduardo Luis <joao.luis@inktank.com>
12 years agoosd: osd_types: add pool quota related fields
Joao Eduardo Luis [Thu, 28 Mar 2013 19:24:51 +0000 (19:24 +0000)]
osd: osd_types: add pool quota related fields

12 years agoceph-disk: handle missing journal_uuid field gracefully
Sage Weil [Fri, 29 Mar 2013 20:59:04 +0000 (13:59 -0700)]
ceph-disk: handle missing journal_uuid field gracefully

Only lower if we know it's not None.

Signed-off-by: Sage Weil <sage@inktank.com>
12 years agoMerge remote branch 'origin/next'
Josh Durgin [Fri, 29 Mar 2013 19:58:01 +0000 (12:58 -0700)]
Merge remote branch 'origin/next'

12 years agoMerge pull request #170 from ceph/wip-rbd-aio-flush
Josh Durgin [Fri, 29 Mar 2013 20:20:32 +0000 (13:20 -0700)]
Merge pull request #170 from ceph/wip-rbd-aio-flush

Reviewed-by: Sage Weil <sage.weil@inktank.com>
12 years agolibrados: move snapc creation to caller for aio_operate 170/head
Josh Durgin [Fri, 29 Mar 2013 19:46:27 +0000 (12:46 -0700)]
librados: move snapc creation to caller for aio_operate

The common case already has a snapshot context, so avoid duplicating
it (copying a potentially large vector) in IoCtxImpl::aio_operate().

Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
12 years agoMerge pull request #166 from ceph/wip-disk-list
Sage Weil [Fri, 29 Mar 2013 19:24:47 +0000 (12:24 -0700)]
Merge pull request #166 from ceph/wip-disk-list

Wip disk list

Reviewed-by: Dan Mick <dan.mick@inktank.com>
12 years agoclient: update cap->implemented when handling revoke
Yan, Zheng [Fri, 29 Mar 2013 18:23:27 +0000 (11:23 -0700)]
client: update cap->implemented when handling revoke

Fixes #4578

Tested-by: Noah Watkins <noahwatkins@gmail.com>
12 years agoMerge pull request #161 from dachary/wip-4560
athanatos [Fri, 29 Mar 2013 17:50:55 +0000 (10:50 -0700)]
Merge pull request #161 from dachary/wip-4560

unit tests for LFNIndex

12 years agomsgr: allow users to mark_down a NULL Connection*
Greg Farnum [Fri, 29 Mar 2013 17:39:56 +0000 (10:39 -0700)]
msgr: allow users to mark_down a NULL Connection*

Signed-off-by: Greg Farnum <greg@inktank.com>
Reviewed-by: Sam Just <sam.just@inktank.com>
12 years agoMerge pull request #150 from ceph/wip-4313
Sage Weil [Fri, 29 Mar 2013 17:24:53 +0000 (10:24 -0700)]
Merge pull request #150 from ceph/wip-4313

mon: ConfigKeyService: stash config keys on the monitor

Reviewed-by: Sage Weil <sage@inktank.com
Reviewed-by: Dan Mick <dan.mick@inktank.com>
12 years agoMerge pull request #171 from Elbandi/master
Sage Weil [Fri, 29 Mar 2013 15:38:22 +0000 (08:38 -0700)]
Merge pull request #171 from Elbandi/master

Run wrap-and-sort and add git to build deps

Reviewed-by: Sage Weil <sage@inkank.com>
12 years agoMerge pull request #172 from ceph/wip-ceph-json
Sage Weil [Fri, 29 Mar 2013 15:37:04 +0000 (08:37 -0700)]
Merge pull request #172 from ceph/wip-ceph-json

Wip ceph json

Reviewed-by: Sage Weil <sage@inktank.com>
12 years agodebian: Add git to Build-Depends (need by check_version script) 171/head
Andras Elso [Fri, 29 Mar 2013 12:34:03 +0000 (13:34 +0100)]
debian: Add git to Build-Depends (need by check_version script)

Signed-off-by: Andras Elso <elso.andras@gmail.com>
12 years agodebian: Run wrap-and-sort from devscripts
Andras Elso [Fri, 29 Mar 2013 12:28:28 +0000 (13:28 +0100)]
debian: Run wrap-and-sort from devscripts

Signed-off-by: Andras Elso <elso.andras@gmail.com>
12 years agounit test LFNIndex::remove_object and LFNIndex::lfn_unlink 161/head
Loic Dachary [Thu, 28 Mar 2013 12:38:09 +0000 (13:38 +0100)]
unit test LFNIndex::remove_object and LFNIndex::lfn_unlink

When the object name is short, check that the corresponding file is
::unlink()ed. When the object name is long, there may be multiple files
with the same name, modulo the anti-collision number showing just before
the FILENAME_COOKIE. The following scenarii are tested:

 * there only is one file

 * there are multiple files and the last one is removed

 * there are multiple files and the last one is moved in place of the
   file that is to be removed

lfn_unlink and remove_object are tested together because
lfn_unlink is a private function and remove_object is a protected function
that does very little beside calling lfn_unlink

http://tracker.ceph.com/issues/4560 refs #4560

Signed-off-by: Loic Dachary <loic@dachary.org>
12 years agoceph_json: add missing include file 172/head
Yehuda Sadeh [Thu, 28 Mar 2013 23:41:56 +0000 (16:41 -0700)]
ceph_json: add missing include file

Needed for LONG_MAX and friends

Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
12 years agoceph_json: add template specializations
Yehuda Sadeh [Thu, 28 Mar 2013 20:11:58 +0000 (13:11 -0700)]
ceph_json: add template specializations

Missing template specializations for data types that
needed for 32 bit compilation

Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
12 years agoceph-disk: implement 'list' 166/head
Sage Weil [Fri, 29 Mar 2013 03:49:24 +0000 (20:49 -0700)]
ceph-disk: implement 'list'

This is based on Sandon's initial patch, but much-modified.

Mounts ceph data volumes temporarily to see what is inside.  Attempts to
associated journals with osds.

Resolves: #3120
Signed-off-by: Sage Weil <sage@inktank.com>
Reviewed-by: Dan Mick <dan.mick@inktank.com>
12 years agoceph.spec.in: Add python-argparse dependency
Gary Lowell [Fri, 29 Mar 2013 00:14:33 +0000 (17:14 -0700)]
ceph.spec.in:  Add python-argparse dependency

The python-argparse package is needed by ceph-create-keys script.

Signed-off-by: Gary Lowell <gary.lowell@inktank.com>
12 years agomon: ConfigKeyService: stash config keys on the monitor 150/head
Joao Eduardo Luis [Fri, 1 Mar 2013 22:34:16 +0000 (22:34 +0000)]
mon: ConfigKeyService: stash config keys on the monitor

Building up on the Single-Paxos and our existing k/v store that backs
the monitor, we now introduce a simple service so that the monitors
act as a generic k/v store available to the cluster, in which a user
can stash (and later obtain) configuration keys at his own discretion.

Users can put, get, delete, list and check for values using the
following commands:

 - ceph config-key put <key> [<value>]
  or
 - ceph config-key put <key> [-i <in-file>]
  with 'value' and 'in-file' being optional; if these are not specified,
  'put' will act as 'touch' if 'key' does not exist, or will overwrite
  the value of 'key' with a zero byte value (i.e., truncates the
  contents of the value to zero)

 - ceph config-key get <key>
  or
 - ceph config-key get <key> -o <out-file>

 - ceph config-key delete <key>

 - ceph config-key list [-o <out-file]

 - ceph config-key exists <key>

Fixes: #4313
Signed-off-by: Joao Eduardo Luis <joao.luis@inktank.com>
12 years agoceph.spec.in: Move four scripts from sbin to usr/bin
Gary Lowell [Thu, 28 Mar 2013 23:12:33 +0000 (16:12 -0700)]
ceph.spec.in:  Move four scripts from sbin to usr/bin

The ceph-create-keys, ceph-disk, ceph-disk-activate, and
ceph-disk-prepare scripts are built in sbin, but debian installs
them into usr/bin, and several utilities look for them there.
This commit changes the RPM to install them in /usr/bin. (Bug #3921)

Signed-off-by: Gary Lowell <gary.lowell@inktank.com>
12 years agoceph: propagate do_command()'s return value to user space
Joao Eduardo Luis [Thu, 28 Mar 2013 02:07:18 +0000 (02:07 +0000)]
ceph: propagate do_command()'s return value to user space

We were returning '1' regardless of what do_command() returned in case
of error.  This would make building tools relying on command error codes
short of useless, and forced them to rely instead on error messages.

Signed-off-by: Joao Eduardo Luis <joao.luis@inktank.com>
Reviewed-by: Dan Mick <dan.mick@inktank.com>
(cherry picked from commit e91405d540ce11b9996e4977212553bd33afb3ed)

12 years agoceph: propagate do_command()'s return value to user space
Joao Eduardo Luis [Thu, 28 Mar 2013 02:07:18 +0000 (02:07 +0000)]
ceph: propagate do_command()'s return value to user space

We were returning '1' regardless of what do_command() returned in case
of error.  This would make building tools relying on command error codes
short of useless, and forced them to rely instead on error messages.

Signed-off-by: Joao Eduardo Luis <joao.luis@inktank.com>
Reviewed-by: Dan Mick <dan.mick@inktank.com>
12 years agoMerge pull request #168 from athanatos/wip_4471
Sage Weil [Thu, 28 Mar 2013 21:15:07 +0000 (14:15 -0700)]
Merge pull request #168 from athanatos/wip_4471

Wip 4471

Reviewed-by: Sage Weil <sage@inktank.com>
12 years agoPG: update PGPool::name in PGPool::update 168/head
Samuel Just [Thu, 28 Mar 2013 21:09:17 +0000 (14:09 -0700)]
PG: update PGPool::name in PGPool::update

Fixes: #4471
Signed-off-by: Samuel Just <sam.just@inktank.com>
12 years agoPG: use int64_t for pool id in PGPool
Samuel Just [Thu, 28 Mar 2013 21:01:45 +0000 (14:01 -0700)]
PG: use int64_t for pool id in PGPool

Signed-off-by: Samuel Just <sam.just@inktank.com>
12 years agoMerge pull request #164 from dalgaaf/wip-da-fix-misc-1
Yehuda Sadeh [Thu, 28 Mar 2013 20:01:51 +0000 (13:01 -0700)]
Merge pull request #164 from dalgaaf/wip-da-fix-misc-1

some SCA related fixes

12 years agoOSD: flush pg osr on shutdown prior to put()
Samuel Just [Wed, 27 Mar 2013 18:32:24 +0000 (11:32 -0700)]
OSD: flush pg osr on shutdown prior to put()

Fixes: #4538
Signed-off-by: Samuel Just <sam.just@inktank.com>
Reviewed-by: Sage Weil <sage@inktank.com>
12 years agolibrbd: increment version for new functions is_complete() and aio_flush()
Josh Durgin [Wed, 27 Mar 2013 22:48:17 +0000 (15:48 -0700)]
librbd: increment version for new functions is_complete() and aio_flush()

This done in a separate commit since the increased version number
should not be backported.

Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
12 years agolibrbd: add an async flush
Josh Durgin [Thu, 21 Mar 2013 23:04:10 +0000 (16:04 -0700)]
librbd: add an async flush

At this point it's a simple wrapper around the ObjectCacher or
librados.

This is needed for QEMU so that its main thread can continue while a
flush is occurring. Since this will be backported, don't update the
librbd version yet, just add a #define that QEMU and others can use to
detect the presence of aio_flush().

Refs: #3737
Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
12 years agolibrbd: use the same IoCtx for each request
Josh Durgin [Wed, 27 Mar 2013 22:42:10 +0000 (15:42 -0700)]
librbd: use the same IoCtx for each request

Before we were duplicating the IoCtx for each new request since they
could have a different snapshot context or read from a different
snapshot id. Since librados now supports setting these explicitly
for a given request, do that instead.

Since librados tracks outstanding requests on a per-IoCtx basis, this
also fixes a bug that causes flush() without caching to ignore
all the outstanding requests, since they were to separate,
duplicate IoCtxs.

Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
12 years agolibrbd: add an is_complete() method to AioCompletions
Josh Durgin [Wed, 27 Mar 2013 22:37:27 +0000 (15:37 -0700)]
librbd: add an is_complete() method to AioCompletions

Mainly this is useful for testing, like flushing and checking that
all pending writes are complete after the flush finishes.

Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
12 years agolibrados: add versions of a couple functions taking explicit snap args
Josh Durgin [Wed, 27 Mar 2013 22:32:29 +0000 (15:32 -0700)]
librados: add versions of a couple functions taking explicit snap args

Usually the snapid to read from or the snapcontext to send with a write
are determined implicitly by the IoCtx the operations are done on.

This makes it difficult to have multiple ops in flight to the same
IoCtx using different snapcontexts or reading from different snapshots,
particularly when more than one operation may be needed past the initial
scheduling.

Add versions of aio_read, aio_sparse_read, and aio_operate
that don't depend on the snap id or snapcontext stored in the IoCtx,
but get them from the caller. Specifying this information for each
operation can be a more useful interface in general, but for now just
add it for the methods used by librbd.

Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
12 years agolibrados: add async flush interface
Josh Durgin [Wed, 27 Mar 2013 21:48:31 +0000 (14:48 -0700)]
librados: add async flush interface

Sometimes you don't want flush to block, and can't modify
already scheduled aio_writes. This will be useful for a
librbd async flush interface.

Signed-off-by: Josh Durgin <josh.durgin@inktank.com>