Commit Graph

36362 Commits

Author SHA1 Message Date
Johnu George
1858f06c80 Crush: Ensuring at most num-rep osds are selected
Crush temporary buffers are allocated as per replica size configured
by the user.When there are more final osds (to be selected as per
rule) than the replicas, buffer overlaps and it causes crash.Now, it
ensures that at most num-rep osds are selected even if more number of
osds are allowed by indep rule. The fix for firstn rules is already
merged as part of bug #9492. Required test files are added.

Fixes: #9492

Signed-off-by: Johnu George johnugeo@cisco.com
(cherry picked from commit 234b066ba0)
2014-10-04 11:27:17 -07:00
Johnu George
01e389aeb6 Crush: Ensuring at most num-rep osds are selected
Crush temporary buffers are allocated as per replica size configured
by the user.When there are more final osds (to be selected as per
rule) than the replicas, buffer overlaps and it causes crash.Now, it
ensures that at most num-rep osds are selected even if more number of
osds are allowed by the rule.

Fixes: #9492

Signed-off-by: Johnu George <johnugeo@cisco.com>
(cherry picked from commit 6b4d1aa997)
2014-10-04 11:27:17 -07:00
Loic Dachary
5b8c705fc3 Merge pull request #2599 from johnugeorge/wip-9492-crush-indep
Crush: Ensuring at most num-rep osds are selected for indep rules

Reviewed-by: Loic Dachary <loic-201408@dachary.org>
2014-10-04 11:45:09 +02:00
Loic Dachary
f1becf9ad7 qa: ceph tell must retry on ENXIO
It is expected for ceph tell to fail with ENXIO if the daemon it is
trying to join is not ready for some reason. This should be handled as a
transient error instead of a fatal error.

Add two shell functions to help with retry. They may prove useful if
other cases requiring a few retries show up.

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

Signed-off-by: Loic Dachary <loic-201408@dachary.org>
2014-10-04 11:34:27 +02:00
Johnu George
234b066ba0 Crush: Ensuring at most num-rep osds are selected
Crush temporary buffers are allocated as per replica size configured
by the user.When there are more final osds (to be selected as per
rule) than the replicas, buffer overlaps and it causes crash.Now, it
ensures that at most num-rep osds are selected even if more number of
osds are allowed by indep rule. The fix for firstn rules is already
merged as part of bug #9492. Required test files are added.

Fixes: #9492

Signed-off-by: Johnu George johnugeo@cisco.com
2014-10-03 20:01:49 -07:00
Sage Weil
38dde3d3e2 Merge remote-tracking branch 'gh/giant' 2014-10-03 17:56:31 -07:00
Sage Weil
25bcc39bb8 Merge pull request #2640 from ceph/wip-9657
messages: provide an explicit COMPAT_VERSION in MMDSBeacon

Reviewed-by: Sage Weil <sage@redhat.com>
2014-10-03 17:02:56 -07:00
Sage Weil
5c6c366d2a debian/control: fix python-ceph -> ceph file move to allow upgrades
See fe3434f41c.

Signed-off-by: Sage Weil <sage@redhat.com>
2014-10-03 16:22:57 -07:00
Greg Farnum
35fd2722cc messages: provide an explicit COMPAT_VERSION in MMDSBeacon
We weren't setting an explicit compat version and so the Message
was setting it to the head version, breaking communication with
older daemons.

Fixes: #9657
Signed-off-by: Greg Farnum <greg@inktank.com>
2014-10-03 16:06:53 -07:00
David Zafman
177a33b5e5 MemStore: Need set/get_allow_sharded_objects() to work for ceph_objectstore_tool
Keep a bool sharded in memory and use for set/get_allow_sharded_objects()
Create a file "sharded" in the data dir when sharded is true during _save()
Check for file "sharded" during _load()

Fixes: #9661

Signed-off-by: David Zafman <dzafman@redhat.com>
2014-10-03 15:15:11 -07:00
David Zafman
0b155d00c5 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>
2014-10-03 15:15:05 -07:00
Sage Weil
7f6c31bf6e debian/control: BuildDepend on lsb-release
debian/rules uses it to make lttng build conditional.

Signed-off-by: Sage Weil <sage@redhat.com>
2014-10-03 13:45:48 -07:00
Sage Weil
8d79181dd8 Merge pull request #2635 from dachary/wip-9653-ceph-disk-bootstrap-osd-giant
ceph-disk: bootstrap-osd keyring ignores --statedir (giant)
2014-10-03 11:58:54 -07:00
Sage Weil
67d9031820 Merge pull request #2633 from dachary/wip-9653-ceph-disk-bootstrap-osd
ceph-disk: bootstrap-osd keyring ignores --statedir

Reviewed-by: Sage Weil <sage@redhat.com>
2014-10-03 11:58:32 -07:00
Sage Weil
027f74f998 Merge pull request #2637 from dachary/wip-9245-test-mon-pending-giant
mon: obsolete osdmonitor_prepare_command (giant)
2014-10-03 11:24:44 -07:00
Loic Dachary
73d5bdb987 tests: remove tests requiring osdmonitor_prepare_command
Although they have been useful, their maintenance and fragility caused
more trouble than their benefits.

Signed-off-by: Loic Dachary <loic-201408@dachary.org>
(cherry picked from commit 038de0031b)
2014-10-03 19:00:34 +02:00
Loic Dachary
e8657814a6 mon: obsolete osdmonitor_prepare_command
And the mon_advanced_debug_mode option that is only used in the context
of osdmonitor_prepare_command.

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

Signed-off-by: Loic Dachary <loic-201408@dachary.org>
(cherry picked from commit 2abc8f400f)
2014-10-03 19:00:16 +02:00
Loic Dachary
d0c2d7d572 test: minor case fix
Signed-off-by: Loic Dachary <loic-201408@dachary.org>
(cherry picked from commit 6f69837456)
2014-10-03 19:00:00 +02:00
Sage Weil
a1996b5deb Merge pull request #2636 from dachary/wip-9245-test-mon-pending
mon: obsolete osdmonitor_prepare_command

Reviewed-by: Sage Weil <sage@redhat.com>
2014-10-03 09:27:27 -07:00
Joao Eduardo Luis
7e2bd2294f mon: Monitor: let 'handle_command()' deal with caps validation
If a given client doesn't have the required caps when running a command,
it must receive an EACCES or EPERM reply.  This is already handled by
Monitor::handle_command(), which does an exceptionally good job at it.

Therefore, and unlike other messages that do not expect return values,
we can't simply drop the message if the client doesn't have the
appropriate capabilities, or things can get very weird very fast from
the user's perspective.  Dropping the message for a command without a
reply has roughly the same effect as loss of quorum (timeout, pipes
failing) and confusion may ensue from it.

Signed-off-by: Joao Eduardo Luis <joao@redhat.com>
2014-10-03 16:24:20 +01:00
Joao Eduardo Luis
f0653c0401 qa/workunits: mon: auth_caps: account for mon blank caps
test creating and entity with blank caps with and without '--force'
being specified.  without '--force' they must fail with EINVAL as the
monitor will not be able to parse them.

Signed-off-by: Joao Eduardo Luis <joao@redhat.com>
2014-10-03 16:24:20 +01:00
Joao Eduardo Luis
87d06f11c4 mon: MonCommands: adjust indentation for 'auth add'
Eye-candy.  We changed indentation of a few other entries and this one
was just too darn obvious, itching all over, night terrors, the whole
nine yards.

Signed-off-by: Joao Eduardo Luis <joao@redhat.com>
2014-10-03 16:24:20 +01:00
Joao Eduardo Luis
c7d5c25324 qa/workunits: mon: auth_caps: variables must be local
We have variables with the same name that are being shared!  We don't
hit any issues with it currently because the code just kind of works
even though that happens.  Add a bit of new logic that relies on an
immutable return code (for instance) and we're in the woods.

Signed-off-by: Joao Eduardo Luis <joao@redhat.com>
2014-10-03 16:24:19 +01:00
Joao Eduardo Luis
7e85bebd74 qa/workunits: mon: auth_caps: cleanup on successful exit
Signed-off-by: Joao Eduardo Luis <joao@redhat.com>
2014-10-03 16:24:19 +01:00
Joao Eduardo Luis
5488f464c5 test/vstart_wrapper.sh: use cephx
Signed-off-by: Joao Eduardo Luis <joao@redhat.com>
2014-10-03 16:24:19 +01:00
Joao Eduardo Luis
74695617c3 mon: Monitor: remove redudant call to osdmon's dispatch
Backport: firefly

Signed-off-by: Joao Eduardo Luis <joao.luis@inktank.com>
2014-10-03 16:24:19 +01:00
Joao Eduardo Luis
c0e3bc9a30 mon: Monitor: check caps and source before dispatching messages
Only dispatch messages that a client may send if said client has at
least MON_CAP_R, and only dispatch internal monitor messages if peer is
a monitor.

Backport: firefly

Signed-off-by: Joao Eduardo Luis <joao.luis@inktank.com>
2014-10-03 16:24:19 +01:00
Joao Eduardo Luis
3d78285dfa mon: Monitor: create logical divisions on dispatch() based on msg nature
Instead of a single switch(), have multiple switch() and order them by
increasing necessity of privileges.

This patch thus divides the big switch into:

- messages not requiring auth/caps checks at all
- messages which caps shall be checked somewhere else
- messages the Monitor class needs to deal with but only require a
  client to have enough caps for the monitor to consider handling them
- messages that only a monitor is allowed to send.

Backport: firefly

Signed-off-by: Joao Eduardo Luis <joao.luis@inktank.com>
2014-10-03 16:24:19 +01:00
Joao Eduardo Luis
d0113e07d8 test: mon: test-mon-msg: Check which msgs the mons handle and reply to
Signed-off-by: Joao Eduardo Luis <joao.luis@inktank.com>
2014-10-03 16:24:19 +01:00
Joao Eduardo Luis
ea96863d2a qa/workunits: cephtool: test auth profiles
Signed-off-by: Joao Eduardo Luis <joao.luis@inktank.com>
2014-10-03 16:24:19 +01:00
Joao Eduardo Luis
d6b702ce46 mon: MonCap: add new profiles
Adds three new profiles:

  read-only:  able to issue all read-only (MON_CAP_R) commands.  Any
  command that may take additional caps (MON_CAP_W or MON_CAP_X) won't
  be allowed.

  read-write: able to issue all read-write (MON_CAP_R | MON_CAP_W)
  commands.  Commands that require MON_CAP_X will not be allowed.

  role-definer: solely able to issue commands on the 'auth' subsystem,
  to which all caps are given (MON_CAP_R | MON_CAP_W | MON_CAP_X).

Fixes: #8899

Signed-off-by: Joao Eduardo Luis <joao.luis@inktank.com>
2014-10-03 16:24:19 +01:00
Joao Eduardo Luis
940c4e2812 mon: Monitor: match command module caps against what's on MonCommands.h
We were checking the command's permissions against what we perceived as
the 'module' from parsing the command's "prefix" (specified by the
client).  This caused troubles with cap checks for commands without a
submodule clearly defined, such as 'status' or 'health' (vs 'mon dump'
or 'osd pool set', which are of submodule 'mon' and 'osd' respectively).

As such, we now grab the command's submodule (right now solely for caps
checks) from the monitor's internal representation of the commands
(defined in mon/MonCommands.h and built at compile time and stashed in
'mon_commands').  Given that commands such as 'health', 'fsid' or
'status' have properly defined modules in MonCommands.h, we simply rely
on that representation for all commands.  Which is what we should have
been doing from the start anyway, because we shouldn't be relying on the
client to point us to what we want to authenticate against.

Backport: firefly

Signed-off-by: Joao Eduardo Luis <joao@redhat.com>
2014-10-03 16:24:19 +01:00
Joao Eduardo Luis
861246158e mon: AuthMonitor: validate caps when creating or changing mon caps
The monitor doesn't really know how to validate caps not meant for it.
The MDS or the OSD may very well allow blank caps for instance, while
the monitor categorically does not.  We can't simply state a capability
is invalid because we wouldn't take it as such.

On the other hand, we must check monitor caps and make sure they are
correct, otherwise malformed caps can go unnoticed for a while,
sometimes even being hard to understand what may have gone wrong.

Backport: firefly

Signed-off-by: Joao Eduardo Luis <joao.luis@inktank.com>
2014-10-03 16:24:10 +01:00
Loic Dachary
038de0031b tests: remove tests requiring osdmonitor_prepare_command
Although they have been useful, their maintenance and fragility caused
more trouble than their benefits.

Signed-off-by: Loic Dachary <loic-201408@dachary.org>
2014-10-03 16:12:12 +02:00
Loic Dachary
2abc8f400f mon: obsolete osdmonitor_prepare_command
And the mon_advanced_debug_mode option that is only used in the context
of osdmonitor_prepare_command.

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

Signed-off-by: Loic Dachary <loic-201408@dachary.org>
2014-10-03 16:10:30 +02:00
Loic Dachary
6f69837456 test: minor case fix
Signed-off-by: Loic Dachary <loic-201408@dachary.org>
2014-10-03 16:09:05 +02:00
Loic Dachary
eb2f0f497f ceph-disk: bootstrap-osd keyring ignores --statedir
The STATEDIR variable is used to initialize the bootstrap-osd keyring
before it gets a chance to be overriden by --statedir. Replace it with
{statedir} so that it can be substituted after all options have been
parsed.

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

Signed-off-by: Loic Dachary <loic-201408@dachary.org>
(cherry picked from commit fa0bd06b46)
2014-10-03 15:53:28 +02:00
Loic Dachary
841c03763f Merge pull request #2577 from dachary/wip-9570-cpp-strerror
os: io_event.res is the size written

Reviewed-By: Christophe Courtaut <christophe.courtaut@gmail.com>
2014-10-03 15:25:14 +02:00
Loic Dachary
fa0bd06b46 ceph-disk: bootstrap-osd keyring ignores --statedir
The STATEDIR variable is used to initialize the bootstrap-osd keyring
before it gets a chance to be overriden by --statedir. Replace it with
{statedir} so that it can be substituted after all options have been
parsed.

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

Signed-off-by: Loic Dachary <loic-201408@dachary.org>
2014-10-03 14:08:57 +02:00
Guang Yang
19be358322 PG::actingset should be used when checking the number of acting OSDs for a given PG.
Signed-off-by: Guang Yang <yguang@yahoo-inc.com>
2014-10-03 01:47:28 +00:00
Sage Weil
8253ead174 osdc/Objecter: use SafeTimer; make callbacks race-tolerant
The RWTimer event cancellation is racy.  Instead, just make all of our
callbacks tolerate cancellation races.  This is already true of most of
them (in fact, they are probably broken because they try to take a write
lock while holding a read lock).  Fix C_CancelOp so that it calls the
other op_cancel (that takes a tid).

Then switch the RWTimer back to a SafeTimer.  Put it in unsafe callbacks
mode because we don't want to introduce lock cycles with timer_lock.

Fixes: #9582
See also: #9650
Signed-off-by: Sage Weil <sage@redhat.com>
2014-10-02 15:22:56 -07:00
Loic Dachary
d940ec3383 Merge pull request #2627 from theanalyst/fix/mailmap
mailmap: Yehuda Sadeh name normalization

Reviewed-by: Loic Dachary <loic-201408@dachary.org>
2014-10-02 12:47:00 +02:00
Abhishek Lekshmanan
6c37984fc7 mailmap: Yehuda Sadeh name normalization
Reported-by: Loic Dachary <loic@dachary.org>
Signed-off-by: Abhishek Lekshmanan <abhishek.lekshmanan@gmail.com>
2014-10-02 16:09:22 +05:30
Loic Dachary
50e80407f3 tools: rados put /dev/null should write() and not create()
In the rados.cc special case to handle put an empty objects, use
write_full() instead of create().

A special case was introduced 6843a0b81f
to create() an object if the rados put file is empty. Prior to this fix
an attempt to rados put an empty file was a noop. The problem with this
fix is that it is not idempotent. rados put an empty file twice would
fail the second time and rados put a file with one byte would succeed as
expected.

Signed-off-by: Loic Dachary <loic-201408@dachary.org>
2014-10-02 10:17:11 +02:00
Loic Dachary
b038969b7c Merge pull request #2625 from ceph/wip-ysw-mailmap
mailmap: update email address

Reviewed-by: Loic Dachary <loic-201408@dachary.org>
2014-10-02 07:52:43 +02:00
Yehuda Sadeh
0b0a373194 mailmap: update email address
Signed-off-by: Yehuda Sadeh <yehuda@redhat.com>
2014-10-01 19:49:33 -07:00
Sage Weil
188370a943 doc/release-notes: fix attributions for 8702 fix
Oops!

Signed-off-by: Sage Weil <sage@redhat.com>
2014-10-01 18:01:51 -07:00
Sage Weil
c0dc3a5697 doc/release-notes: v0.80.6
Signed-off-by: Sage Weil <sage@redhat.com>
2014-10-01 17:48:49 -07:00
Sage Weil
73d7be0da5 Merge pull request #2623 from ceph/wip-coverity-20141002
build and coverity fixes

Reviewed-by: Sage Weil <sage@redhat.com>
2014-10-01 16:20:09 -07:00
Sage Weil
b3e2e1ed05 Merge pull request #2622 from dachary/wip-osd-pool-ls
qa: fix osd pool ls invalid test
2014-10-01 16:18:36 -07:00