Commit Graph

29503 Commits

Author SHA1 Message Date
Joao Eduardo Luis
50868a528d qa: workunits: mon: ping.py: test 'ceph ping'
Basic testing by forcing each monitor out of quorum at a time and making
sure they still reply to ping requests.

Fixes: #6705

Signed-off-by: Joao Eduardo Luis <joao.luis@inktank.com>
2013-11-22 01:43:06 +00:00
Joao Eduardo Luis
762acec422 mon: Monitor: make 'quorum enter/exit' available through the admin socket
If we don't have at least 'quorum enter' available through the admin
socket, then we can never tell a monitor to go back into quorum after
exiting, since it will not handle the command that forces it back in due
to not being in the quorum.

Signed-off-by: Joao Eduardo Luis <joao.luis@inktank.com>
2013-11-08 00:26:42 +00:00
Yehuda Sadeh
84fb1bf3ee rgw: deny writes to a secondary zone by non-system users
Fixes: #6678
We don't want to allow regular users to write to secondary zones,
otherwise we'd end up with data inconsistencies.

Reviewed-by: Josh Durgin <josh.durgin@inktank.com>
Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
2013-11-07 09:17:22 -08:00
Sage Weil
d8f05024e7 doc/release-notes: note crush update timeout on startup change
Signed-off-by: Sage Weil <sage@inktank.com>
2013-11-06 20:02:09 -08:00
Sage Weil
1ee112fa2e osdmaptool: fix cli tests
From c22c84a88c.

Signed-off-by: Sage Weil <sage@inktank.com>
2013-11-06 19:59:56 -08:00
Li Wang
082e7c9eed Ceph: Fix memory leak in chain_flistxattr()
Free allocated memory before return.

Signed-off-by: Li Wang <liwang@ubuntukylin.com>
Reviewed-by: Sage Weil <sage@inktank.com>
2013-11-06 19:00:52 -08:00
Samuel Just
c7a30b8811 ReplicatedPG: don't skip missing if sentries is empty on pgls
Formerly, if sentries is empty, we skip missing.  In general,
we need to continue adding items from missing until we get
to next (returned from collection_list_partial) to avoid
missing any objects.

Fixes: #6633
Signed-off-by: Samuel Just <sam.just@inktank.com>
Reviewed-by: David Zafman <david.zafman@inktank.com>
2013-11-06 17:55:12 -08:00
Samuel Just
c6826c1e8a PG: fix operator<<,log_wierdness log bound warning
Split may cause holes such that head != tail and yet
log.empty().

Fixes: #6722
Signed-off-by: Samuel Just <sam.just@inktank.com>
Reviewed-by: David Zafman <david.zafman@inktank.com>
2013-11-06 11:02:32 -08:00
Samuel Just
f4648bc6fe PGLog::rewind_divergent_log: log may not contain newhead
Due to split, there may be a hole at newhead.

Fixes: #6722
Signed-off-by: Samuel Just <sam.just@inktank.com>
Reviewed-by: David Zafman <david.zafman@inktank.com>
2013-11-06 11:02:19 -08:00
Sage Weil
14dfb810c4 Merge pull request #824 from dmick/next
osdmaptool: don't put progress on stdout

Reviewed-by: Sage Weil <sage@inktank.com>
2013-11-06 07:46:02 -08:00
Samuel Just
a3ccd29716 RadosModel: use sharedptr_registry for snaps_in_use
There might be two concurrent rollback ops each of which
adds snap x to snaps_in_use.  Between when the first
completes and the second completes, snap x may be removed
since the first would have removed snap x from snaps_in_use.
Using sharedptr_registry here avoids this by ensuring that
the snap won't be removed from snaps_in_use until all refs
are gone.

This patch also adds size() to sharedptr_registry.

Fixes: #6719
Signed-off-by: Samuel Just <sam.just@inktank.com>
Reviewed-by: David Zafman <david.zafman@inktank.com>
2013-11-05 18:00:04 -08:00
Dan Mick
c22c84a88c osdmaptool: don't put progress on stdout
If one requests JSON output, the progress message pollutes the output;
don't do that, send it to stderr instead

Signed-off-by: Dan Mick <dan.mick@inktank.com>
2013-11-05 16:20:50 -08:00
Samuel Just
154ee0b034 FileStore::_collection_move_rename: handle missing dst dir on replay
In case of a replay, a missing destination directory indicates that
the destination object and directory have been removed by a later
transaction.  Thus, we need to remove the src object and return
0.

Fixes: #6714
Signed-off-by: Samuel Just <sam.just@inktank.com>
Reviewed-by: Greg Farnum <greg@inktank.com>
2013-11-04 20:33:56 -08:00
Loic Dachary
1cd2e6534c Merge pull request #814 from ceph/wip-da-fix-galois-warning
galois.c: fix compiler warning

Reviewed-by: Loic Dachary <loic@dachary.org>
2013-11-04 16:36:32 -08:00
Danny Al-Gaaf
d03924ca60 galois.c: fix compiler warning
galois_create_split_w8_tables() takes no parameter, remove '8' passed
to the function in one case.

osd/ErasureCodePluginJerasure/galois.c: In function 'galois_w32_region_multiply':
osd/ErasureCodePluginJerasure/galois.c:696:5: warning: call to function 'galois_create_split_w8_tables' without a real prototype [-Wunprototyped-calls]
In file included from osd/ErasureCodePluginJerasure/galois.c:53:0:
osd/ErasureCodePluginJerasure/galois.h:71:12: note: 'galois_create_split_w8_tables' was declared here

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
2013-11-04 23:35:09 +01:00
Samuel Just
cd0d612e1a OSD: allow project_pg_history to handle a missing map
If we get a peering message for an old map we don't have, we
can throwit out: the sending OSD will learn about the newer
maps and update itself accordingly, and we don't have the
information to know if the message is valid. This situation
can only happen if the sender was down for a long enough time
to create a map gap and its PGs have not yet advanced from
their boot-up maps to the current ones, so we can rely on it

Fixes: #6712
Signed-off-by: Samuel Just <sam.just@inktank.com>
Reviewed-by: Greg Farnum <greg@inktank.com>
2013-11-04 11:08:31 -08:00
Samuel Just
9ab513334c OSD: don't clear peering_wait_for_split in advance_map()
I really don't know why I added this...  Ops can be discarded from the
waiting_for_pg queue if we aren't primary simply because there must have
been an exchange of peering events before subops will be sent within a
particular epoch.  Thus, any events in the waiting_for_pg queue must be
client ops which should only be seen by the primary.  Peering events, on
the other hand, should only be discarded if we are in a new interval,
and that check might as well be performed in the peering wq.

Fixes: #6681
Signed-off-by: Samuel Just <sam.just@inktank.com>
Reviewed-by: Greg Farnum <greg@inktank.com>
2013-11-04 11:08:25 -08:00
Samuel Just
545135f3e1 ReplicatedPG::recover_backfill: adjust last_backfill to HEAD if snapdir
Otherwise, if last_backfill_started is a snapdir, we will fail to send a
transaction for a client IO creating the head object and removing the
snapdir object.  The result will be that head will eventually be
backfilled, but the snapdir object will erroneously not be removed.

Fixes: #6685
Signed-off-by: Samuel Just <sam.just@inktank.com>
Reviewed-by: Greg Farnum <greg@inktank.com>
2013-11-04 11:08:19 -08:00
Gregory Farnum
5687a18d91 Merge pull request #809 from ceph/wip-pgmap
Reviewed-by: Greg Farnum <greg@inktank.com>
2013-11-03 09:25:28 -08:00
Xing Lin
c0bcdc3702 osd/erasurecode: correct one variable name in jerasure_matrix_to_bitmatrix()
When bitmatrix is NULL, this function returns NULL.

Signed-off-by: Xing Lin <xinglin@cs.utah.edu>
Reviewed-by: Sage Weil <sage@inktank.com>
2013-11-02 22:18:36 -07:00
Sage Weil
09e159719b mon/PGMap: use const ref, not pass-by-value
Signed-off-by: Sage Weil <sage@inktank.com>
2013-11-01 23:56:56 -07:00
Sage Weil
a5f2ca0337 Merge pull request #806 from jdurgin/wip-xfstests
Don't run racy xfstest 008
2013-11-01 23:32:26 -07:00
Sage Weil
9258a1c971 Merge pull request #807 from jdurgin/wip-rbd-map-rw
rbd: omit 'rw' option during map

Reviewed-by: Sage Weil <sage@inktank.com>
2013-11-01 23:31:44 -07:00
Yehuda Sadeh
52a1d6d356 Merge pull request #804 from jdurgin/wip-rgw-replica-log-next
rgw: don't turn 404 into 400 for the replicalog api

Reviewed-by: Yehuda Sadeh <yehuda@inktank.com>
2013-11-01 21:00:24 -07:00
Josh Durgin
fb0f198644 rbd: omit 'rw' option during map
The ro and rw options were added in linux 3.7. To be compatible with
older kernels, don't specify rw. The default will probably always be
rw, so this should not present any problems in the future.

Reported-by: nicolasc <nicolas.canceill@surfsara.nl>
Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
2013-11-01 19:08:35 -07:00
Josh Durgin
2db20d9721 qa: don't run racy xfstest 008
This test attempts to generate a random number of holes within a
particular range, but may fail because hole placement is random.

Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
2013-11-01 18:43:36 -07:00
David Zafman
e043b6d078 Merge pull request #802 from ceph/wip-6673b
(manually merged after next branch rebuilt)

OSDMonitor: be a little nicer about letting users do pg splitting

Reviewed-by: David Zafman <david.zafman@inktank.com>
2013-11-01 16:37:13 -07:00
Greg Farnum
9834ab9ab8 OSDMonitor: be a little nicer about letting users do pg splitting
We were previously blocking pg splits whenever pg creations were in-
progress, but we only really need to avoid splitting any pgs which are
currently being created. Let the user set a different pg_num if there
are no creating PGs on the pool in question.

Fixes: #6673, take two

Signed-off-by: Greg Farnum <greg@inktank.com>
2013-11-01 16:33:37 -07:00
Josh Durgin
306ec7142d rgw: don't turn 404 into 400 for the replicalog api
404 is not actually a problem to clients like radosgw-agent, but 400
implies something about the request was incorrect.

Backport: dumpling
Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
2013-11-01 16:13:52 -07:00
Ray Lv
588ed60a8e Wrap hex_to_num table into class HexTable
Reviewed-by: Yehuda Sadeh <yehuda@inktank.com>
2013-11-01 16:03:55 -07:00
Ray Lv
148023d3c6 [rgw] Set initialized to true after populating table in hex_to_num()
Reviewed-by: Yehuda Sadeh <yehuda@inktank.com>
2013-11-01 16:03:38 -07:00
Samuel Just
28e4271267 sharedptr_registry.hpp: removed ptrs need to not blast contents
See the included unit test update.  Consider:
1) x = lookup_or_create(1, 1)
2) remove(1)
3) y = lookup_or_create(1, 2)
4) x.reset()
5) z = lookup(1)

The bug is that z will be null since x.reset() caused the
cleanup callback to remove y's key value from contents.

To fix this, contents also records the pointer value for
the weak_ptr.  The removal callback only removes the
key from contents if it matches the ptr in contents.

This should work since the pointer passed to the removal
callback must be unique up to that point since it has
not yet been deleted.

This allowed a pg removal -> pg recreation -> pg removal
sequence to cause the second pg removal entry to be
erroneously cleared by the first pg removal's destructor
as it finally made its way through the removal queue.

Fixes: #5951
Signed-off-by: Samuel Just <sam.just@inktank.com>
Reviewed-by: Greg Farnum <greg@inktank.com>
2013-11-01 16:02:21 -07:00
Noah Watkins
4402898390 prio-q: initialize cur iterator
For new SubQueues `cur` is not intialized, so front/pop_front will freak
out. I honestly I have no idea how this hasn't been seen, but it was
being triggered frequently on OSX.

Fixes: #6686

Signed-off-by: Noah Watkins <noahwatkins@gmail.com>
Reviewed-by: Samuel Just <sam.just@inktank.com>
2013-11-01 16:02:15 -07:00
Samuel Just
353813b2e1 PGLog: remove obsolete assert in merge_log
This assert assumes that if olog.head != log.head, olog contains
a log entry at log.head, which may not be true since pg splitting
might have left the log with arbitrary holes.

Related: 0c2769d332
Signed-off-by: Samuel Just <sam.just@inktank.com>
Reviewed-by: Sage Weil <sage@inktank.com>
2013-11-01 16:00:15 -07:00
Samuel Just
ca4c166b7e test/osd/RadosModel.h: select and reserve roll_back_to atomically
Signed-off-by: Samuel Just <sam.just@inktank.com>
Reviewed-by: Sage Weil <sage@inktank.com>
2013-11-01 16:00:12 -07:00
Samuel Just
99c5319c2c test/rados/list.cc: we might get some objects more than once
Signed-off-by: Samuel Just <sam.just@inktank.com>
Reviewed-by: Sage Weil <sage@inktank.com>
2013-11-01 16:00:08 -07:00
Sage Weil
4a41d3d24b os/chain_listxattr: fix leak fix
e22347df38 added a bad goto; just free
explicitly instead.

Signed-off-by: Sage Weil <sage@inktank.com>
Reviewed-by: Noah Watkins <noahwatkins@gmail.com>
2013-11-01 15:58:07 -07:00
Gary Lowell
dc9a7721d4 Merge branch 'next' of jenkins:ceph/ceph into next 2013-10-30 18:34:42 +00:00
Li Wang
6efd82cc63 ceph: Release resource before return in BackedObject::download()
Close file before return

Signed-off-by: Li Wang <liwang@ubuntukylin.com>
Reviewed-by: Sage Weil <sage@inktank.com>
2013-10-30 09:05:12 -07:00
Li Wang
e22347df38 ceph: Fix memory leak in chain_listxattr
Free allocated memory before return

Signed-off-by: Li Wang <liwang@ubuntukylin.com>
Reviewed-by: Sage Weil <sage@inktank.com>
2013-10-30 09:02:58 -07:00
Li Wang
905243b245 Fix memory leak in Backtrace::print()
Free already allocated memory if short of memory

Signed-off-by: Li Wang <liwang@ubuntukylin.com>
Reviewed-by: Sage Weil <sage@inktank.com>
2013-10-30 09:02:43 -07:00
Gary Lowell
e11c9756af v0.72-rc1 2013-10-30 00:45:10 +00:00
Sage Weil
1e2e4297f8 Revert "ceph-crush-location: new crush location hook"
This reverts commit fc49065d85.

Merged to wrong branch; my bad!
2013-10-29 13:58:32 -07:00
Sage Weil
22ff717688 Revert "upstart, sysvinit: use ceph-crush-location hook"
This reverts commit 111a37efb1.
2013-10-29 13:58:32 -07:00
Loic Dachary
7dd387b0af Merge pull request #779 from ceph/wip-crush-hook
upstart,sysvinit: allow 'osd crush location hook' script to determine osd crush position

Reviewed-by: Loic Dachary <loic@dachary.org>
2013-10-29 12:24:05 -07:00
Sage Weil
111a37efb1 upstart, sysvinit: use ceph-crush-location hook
Instead of hard-coding a check in ceph.conf and some reasonable
defaults, defer this work to ceph-crush-location, and allow users to
specify their own hook with alternative logic.

This can be helpful in a nubmer of cases, like:

 - rack (or other) information included in hostname and easily parsed
   out by a hook
 - multiple types of devices in each host, resulting in 'parallel'
   crush trees (e.g., one for hdd, one for ssd)

Signed-off-by: Sage Weil <sage@inktank.com>
2013-10-29 11:10:32 -07:00
Sage Weil
fc49065d85 ceph-crush-location: new crush location hook
This generalizes the bit of code that builds a key=value pair list to
update an entity's CRUSH location.

Signed-off-by: Sage Weil <sage@inktank.com>
2013-10-29 11:09:52 -07:00
Sage Weil
13d1b9c99b Merge pull request #786 from ceph/wip-6673
mon/PGMonitor: always send pg creations after mapping

Reviewed-by: Joao Eduardo Luis <joao.luis@inktank.com>
2013-10-29 10:16:52 -07:00
Sage Weil
df229e5eff mon/PGMonitor: always send pg creations after mapping
At some point in the dumpling cycle I separated the map stage from the
send stage.  We can send the creates any time we have a non-zero osdmap
epoch, and are in good shape as long as we do the map step after the
osdmap is loaded (hence the post_paxos_update).

Some background:

We originally introduced the map-but-don't send in a2fe0137, at which
point all was well because we only called it on ceph-mon startup.

Later, this turned into post_paxos_update in e635c478, at which point
it was now called by a running monitor.. but we didn't add in the
send_pg_creates().  This is where this bug stems from.

This particular path is responsible for the stalled test referenced in
bug #6673.

Backport: dumpling
Signed-off-by: Sage Weil <sage@inktank.com>
2013-10-29 10:10:21 -07:00
Sage Weil
2181b4c946 mon/OSDMonitor: fix signedness warning on poolid
Signed-off-by: Sage Weil <sage@inktank.com>
2013-10-29 08:59:06 -07:00