]> git.apps.os.sepia.ceph.com Git - ceph.git/log
ceph.git
11 years agoqa: workunits: cephtool: test 'osd bench' limits 1324/head 1351/head
Joao Eduardo Luis [Mon, 3 Mar 2014 15:28:04 +0000 (15:28 +0000)]
qa: workunits: cephtool: test 'osd bench' limits

Signed-off-by: Joao Eduardo Luis <joao.luis@inktank.com>
11 years agoosd: OSD: limit the value of 'size' and 'count' on 'osd bench'
Joao Eduardo Luis [Mon, 3 Mar 2014 14:40:07 +0000 (14:40 +0000)]
osd: OSD: limit the value of 'size' and 'count' on 'osd bench'

Otherwise, a high enough 'count' value will trigger all sorts of timeouts
on the OSD; a low enough 'size' value will have the same effect for a
high enough value of 'count' (even the default value may have ill effects
on the osd's behaviour).  Limiting these values do not fix how 'osd bench'
should behave, but avoid someone from inadvertently bork an OSD.

Four options have been added and the user may adjust them if he so
desires to play with the OSD's fate:

 - 'osd_bench_small_size_max_iops' [default: 100] defines the amount of
   expected IOPS for a small block size (i.e., <1MB).
 - 'osd_bench_large_size_max_throughput' [default: 100<<20] defines
   the expected throughput in B/s.  We assume 100MB/s.
 - 'osd_bench_max_block_size' [default: 64 << 20] caps the block size
   allowed.  We have defined 64 MB.
 - 'osd_bench_duration' [default: 30] caps the expected duration.  This
   values is used when calculating the maximum allowed 'count', and is
   not enforced as the maximum duration of the operation.  If other IO
   is undergoing, or 'osd bench' is somehow slowed down, 'osd bench' may
   go over this duration.  Adjusting this option does however allow the
   user to specify higher 'count' values for (e.g.) a small block size,
   as the operation is assumed to perform the operation over a longer
   time span.

These options attempt to avoid combinations of dangerous parameters.  For
instance, we limit the block size to 64 MB (by default) so that there is
no temptation to specify a large enough block size, along with a very small
'count', such that the end result is similar to specifying a big count with
a sane block size.

Fixes: 7248
Signed-off-by: Joao Eduardo Luis <joao.luis@inktank.com>
11 years agoMerge pull request #1344 from ceph/wip-7539
Sage Weil [Mon, 3 Mar 2014 05:06:01 +0000 (21:06 -0800)]
Merge pull request #1344 from ceph/wip-7539

Wip 7539

Reviewed-by: Sage Weil <sage@inktank.com>
11 years agoMerge pull request #1322 from ceph/wip-librados-end-iterator
Sage Weil [Sun, 2 Mar 2014 20:51:30 +0000 (12:51 -0800)]
Merge pull request #1322 from ceph/wip-librados-end-iterator

librados: fix ObjectIterator::operator= for the end iterator

Reviewed-by: Sage Weil <sage@inktank.com>
11 years agoMerge pull request #1337 from ceph/wip-fix-coverity-20140228
Sage Weil [Sun, 2 Mar 2014 03:56:45 +0000 (19:56 -0800)]
Merge pull request #1337 from ceph/wip-fix-coverity-20140228

Fix different issues found by Coverity

Reviewed-by: Sage Weil <sage@inktank.com>
11 years agoMerge pull request #1336 from ceph/wip-nfs-export
Sage Weil [Sun, 2 Mar 2014 03:54:23 +0000 (19:54 -0800)]
Merge pull request #1336 from ceph/wip-nfs-export

Wip nfs export

Reviewed-by: Sage Weil <sage@inktank.com>
11 years agoosd_types,PG: trim mod_desc for log entries to min size 1344/head
Samuel Just [Sat, 1 Mar 2014 22:33:11 +0000 (14:33 -0800)]
osd_types,PG: trim mod_desc for log entries to min size

In the event that mod_desc.bl contains pointers into a large
message buffer, we'd otherwise end up keeping around the entire
MOSDECSubOpWrite which created each log entry.

Fixes: #7539
Signed-off-by: Samuel Just <sam.just@inktank.com>
11 years agoMOSDECSubOpWrite: drop transaction, log_entries in clear_buffers
Samuel Just [Sat, 1 Mar 2014 22:12:09 +0000 (14:12 -0800)]
MOSDECSubOpWrite: drop transaction, log_entries in clear_buffers

Signed-off-by: Samuel Just <sam.just@inktank.com>
11 years agoTrackedOp: clear_payload as well in unregister_inflight_op
Samuel Just [Sat, 1 Mar 2014 21:55:24 +0000 (13:55 -0800)]
TrackedOp: clear_payload as well in unregister_inflight_op

We want to minimize the cost of maintaining the historic ops.

Signed-off-by: Samuel Just <sam.just@inktank.com>
11 years agoOpTracker: clarify that unregister_inflight_op is only called if enabled
Samuel Just [Sat, 1 Mar 2014 21:54:53 +0000 (13:54 -0800)]
OpTracker: clarify that unregister_inflight_op is only called if enabled

The !tracking_enabled branch actually had a leak which was unreachable
since the caller does the check for tracking_enabled.

Signed-off-by: Samuel Just <sam.just@inktank.com>
11 years agoMOSDOp: drop ops vector in clear_data()
Samuel Just [Sat, 1 Mar 2014 21:39:57 +0000 (13:39 -0800)]
MOSDOp: drop ops vector in clear_data()

Otherwise, clear_data on MOSDOp will leave essentially
all of the buffers intact.  This is a problem since the
OpTracker mechanism relies on being able to keep the mesage
around without keeping around the data.

Signed-off-by: Samuel Just <sam.just@inktank.com>
11 years agoReplicatedPG: delete mark_all_unfound_lost transactions after completion
Greg Farnum [Fri, 28 Feb 2014 19:08:17 +0000 (11:08 -0800)]
ReplicatedPG: delete mark_all_unfound_lost transactions after completion

This was a minor memory leak.

Signed-off-by: Greg Farnum <greg@inktank.com>
11 years agoMerge pull request #1339 from ceph/wip-7572
Loic Dachary [Sat, 1 Mar 2014 17:46:50 +0000 (18:46 +0100)]
Merge pull request #1339 from ceph/wip-7572

mon: fix 'pg dump' JSON output

Reviewed-by: Loic Dachary <loic@dachary.org>
11 years agomon: fix 'pg dump' JSON output 1339/head
John Spray [Sat, 1 Mar 2014 17:01:10 +0000 (17:01 +0000)]
mon: fix 'pg dump' JSON output

This was broken by 40bdcb88.  The 'acting' array had
the up_primary and acting_primary appended.

Fixes: #7572
Signed-off-by: John Spray <john.spray@inktank.com>
11 years agoreq_state: fix uninitialized bool var 1337/head
Danny Al-Gaaf [Sat, 1 Mar 2014 13:26:18 +0000 (14:26 +0100)]
req_state: fix uninitialized bool var

CID 717359 (#1 of 1): Uninitialized scalar field (UNINIT_CTOR)
 uninit_member: Non-static class member "bucket_exists" is not
 initialized in this constructor nor in any functions that it calls.

Set bucket_exists to false in req_state::req_state().

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
11 years agoObjecter::recalc_op_target: fix uninitialized scalar variable
Danny Al-Gaaf [Sat, 1 Mar 2014 12:45:53 +0000 (13:45 +0100)]
Objecter::recalc_op_target: fix uninitialized scalar variable

CID 1160848 (#1 of 1): Uninitialized scalar variable (UNINIT)
 uninit_use: Using uninitialized value "best".

Init 'best' with -1 (from the code logic it will be set at least to 0)
to silence coverity.

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
11 years agoPGMonitor: fix uninitialized scalar variable
Danny Al-Gaaf [Sat, 1 Mar 2014 12:33:18 +0000 (13:33 +0100)]
PGMonitor: fix uninitialized scalar variable

Fix type handling in dump_stuck_pg_stats. If type is type doesn't
match to known PGMap::STUCK_* type print out a message and return
directly from function.

CID 1030132 (#2 of 2): Uninitialized scalar variable (UNINIT)
 uninit_use_in_call: Using uninitialized value "stuck_type" when calling
 "PGMap::dump_stuck(ceph::Formatter *, PGMap::StuckPG, utime_t) const"

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
11 years agoMDCache: fix potential null pointer deref
Danny Al-Gaaf [Sat, 1 Mar 2014 12:11:48 +0000 (13:11 +0100)]
MDCache: fix potential null pointer deref

CID 716921 (#1 of 1): Dereference after null check (FORWARD_NULL)
 var_deref_model: Passing null pointer "dir" to function
 "operator <<(std::ostream &, CDir &)", which dereferences it.

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
11 years agoMDCache::handle_discover: fix null pointer deref
Danny Al-Gaaf [Sat, 1 Mar 2014 11:10:56 +0000 (12:10 +0100)]
MDCache::handle_discover: fix null pointer deref

CID 716990 (#1 of 1): Dereference null return value (NULL_RETURNS)
 dereference: Dereferencing a pointer that might be null "cur" when calling
 "MDCache::replicate_inode(CInode *, int, ceph::bufferlist &)"

Add assert to check for return value from get_inode() as done in other places.

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
11 years agoFileStore: fix resource leak in queue_transactions() blackhole case
Danny Al-Gaaf [Sat, 1 Mar 2014 10:53:09 +0000 (11:53 +0100)]
FileStore: fix resource leak in queue_transactions() blackhole case

CID 1135931 (#1 of 1): Resource leak (RESOURCE_LEAK)
 leaked_storage: Variable "ondisk" going out of scope leaks the storage it
 points to.

CID 1135932 (#1 of 1): Resource leak (RESOURCE_LEAK)
 leaked_storage: Variable "onreadable" going out of scope leaks the storage
 it points to.

CID 1135933 (#1 of 1): Resource leak (RESOURCE_LEAK)
 leaked_storage: Variable "onreadable_sync" going out of scope leaks the
 storage it points to.

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
11 years agoc_read_operations.cc: fix resource leak
Danny Al-Gaaf [Sat, 1 Mar 2014 10:44:39 +0000 (11:44 +0100)]
c_read_operations.cc: fix resource leak

CID 1188154 (#2 of 2): Resource leak (RESOURCE_LEAK)
 overwrite_var: Overwriting "op" in "op = rados_create_read_op()" leaks
 the storage that "op" points to.

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
11 years agoc_write_operations.cc: fix some ioctx resource leaks
Danny Al-Gaaf [Sat, 1 Mar 2014 10:36:18 +0000 (11:36 +0100)]
c_write_operations.cc: fix some ioctx resource leaks

CID 1160833 (#3 of 3): Resource leak (RESOURCE_LEAK)
 leaked_storage: Variable "ioctx" going out of scope leaks the storage
 it points to

CID 1160835 (#3 of 3): Resource leak (RESOURCE_LEAK)
 leaked_storage: Variable "ioctx" going out of scope leaks the storage
 it points to.

CID 1188156 (#5 of 5): Resource leak (RESOURCE_LEAK)
 leaked_storage: Variable "ioctx" going out of scope leaks the storage
 it points to.

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
11 years agoReplicatedBackend: check result of dynamic_cast to fix null pointer deref
Danny Al-Gaaf [Sat, 1 Mar 2014 10:16:27 +0000 (11:16 +0100)]
ReplicatedBackend: check result of dynamic_cast to fix null pointer deref

CID 1188135 (#1 of 1): Unchecked dynamic_cast (FORWARD_NULL)
 var_deref_model: Passing null pointer "t" to function
 "RPGTransaction::get_transaction()", which dereferences it

CID 1188134 (#1 of 1): Unchecked dynamic_cast (FORWARD_NULL)
 var_deref_op: Dereferencing null pointer "to_append".

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
11 years agomds: use "lookup-by-ino" helper to handle LOOKUPPARENT request 1336/head
Yan, Zheng [Sat, 1 Mar 2014 09:49:38 +0000 (17:49 +0800)]
mds: use "lookup-by-ino" helper to handle LOOKUPPARENT request

Signed-off-by: Yan, Zheng <zheng.z.yan@intel.com>
11 years agoMerge pull request #1326 from ceph/wip-7542
Samuel Just [Sat, 1 Mar 2014 05:08:30 +0000 (21:08 -0800)]
Merge pull request #1326 from ceph/wip-7542

Wip 7542

Reviewed-by: Greg Farnum <greg@inktank.com>
11 years agostore_test.cc: fix unchecked return value
Danny Al-Gaaf [Sat, 1 Mar 2014 00:24:37 +0000 (01:24 +0100)]
store_test.cc: fix unchecked return value

CID 1188126 (#1 of 1): Unchecked return value (CHECKED_RETURN)
 2. check_return: Calling function "ObjectStore::stat(coll_t,
    ghobject_t const &, stat *, bool)" without checking return value
    (as is done elsewhere 8 out of 9 times).
 3. unchecked_value: No check of the return value of "this->store->stat(
    coll_t(this->cid), hoid, &buf, false)".

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
11 years agohistogram.h: fix potential div by zero
Danny Al-Gaaf [Fri, 28 Feb 2014 23:19:58 +0000 (00:19 +0100)]
histogram.h: fix potential div by zero

CID 1188131 (#1 of 1): Division or modulo by zero (DIVIDE_BY_ZERO)
 divide_by_zero: In expression "lower_sum * 1000000UL / total", division
 by expression "total" which may be zero has undefined behavior

Added check for non zero total.

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
11 years agoReplicatedPG.cc: fix ressource leak, delete cb
Danny Al-Gaaf [Fri, 28 Feb 2014 23:04:05 +0000 (00:04 +0100)]
ReplicatedPG.cc: fix ressource leak, delete cb

CID 1188145 (#1 of 1): Resource leak (RESOURCE_LEAK)
 leaked_storage: Variable "cb" going out of scope leaks the storage it points to.

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
11 years agoMerge pull request #1331 from ceph/wip-cache-pool
Gregory Farnum [Fri, 28 Feb 2014 22:09:49 +0000 (14:09 -0800)]
Merge pull request #1331 from ceph/wip-cache-pool

mon/OSDMonitor: make default false-positive-probability 5%

Reviewed-by: Greg Farnum <greg@inktank.com>
11 years agoECBackend: don't leak transactions 1326/head
Samuel Just [Thu, 27 Feb 2014 22:41:11 +0000 (14:41 -0800)]
ECBackend: don't leak transactions

Fixes: #7539
Signed-off-by: Samuel Just <sam.just@inktank.com>
11 years agoOSD::handle_misdirected_op: handle ops to the wrong shard
Samuel Just [Wed, 26 Feb 2014 22:47:39 +0000 (14:47 -0800)]
OSD::handle_misdirected_op: handle ops to the wrong shard

OSD recomputes op target based on current OSDMap. With an EC pg, we can get
this result:
1) client at map 512 sends an op to osd 3, pg_t 3.9 based on mapping
   [CRUSH_ITEM_NONE, 2, 3]/3
2) OSD 3 at map 513 remaps op to osd 3, spg_t 3.9s0 based on mapping [3, 2, 3]/3
3) PG 3.9s0 dequeues the op at epoch 512 and notices that it isn't
   primary -- misdirected op
4) client resends and this time PG 3.9s0 having caught up to 513 gets it and
   fulfils it

We can't compute the op target based on the sending map epoch due to
splitting.  The simplest thing is to detect such cases in
OSD::handle_misdirected_op and drop them without an error (the client
will resend anyway).

Signed-off-by: Samuel Just <sam.just@inktank.com>
11 years agoMerge pull request #1332 from ceph/wip-pg-msg
Loic Dachary [Fri, 28 Feb 2014 17:35:11 +0000 (18:35 +0100)]
Merge pull request #1332 from ceph/wip-pg-msg

mon/OSDMonitor: missing space in string

Reviewed-by: Sage Weil <sage@inktank.com>
Reviewed-by: Loic Dachary <loic@dachary.org>
11 years agomon/OSDMonitor: missing space in string 1325/head 1332/head
John Spray [Fri, 28 Feb 2014 01:26:29 +0000 (01:26 +0000)]
mon/OSDMonitor: missing space in string

Minor glitch.  Was printing ..."exceeds per-OSD max of32)"

Signed-off-by: John Spray <john.spray@inktank.com>
11 years agoFix python-requests package dependencies.
Dan Mick [Thu, 27 Feb 2014 01:11:05 +0000 (17:11 -0800)]
Fix python-requests package dependencies.

python-ceph does not require requests, but ceph-common does (for ceph-brag).

Signed-off-by: Dan Mick <dan.mick@inktank.com>
(cherry picked from commit 9a0ef6a181e90b81cdccbd54298270f5aa960767)

11 years agolibrados: fix ObjectIterator::operator= for the end iterator 1322/head
Josh Durgin [Wed, 26 Feb 2014 21:00:33 +0000 (13:00 -0800)]
librados: fix ObjectIterator::operator= for the end iterator

We can't set a shared_ptr to NULL, we need to reset it instead. Add
another test for various permutations of this.

Fixes: #7538
Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
11 years agomon/OSDMonitor: make default false-positive-probability 5% 1330/head 1331/head
Sage Weil [Fri, 28 Feb 2014 16:06:03 +0000 (08:06 -0800)]
mon/OSDMonitor: make default false-positive-probability 5%

This is a more conservative default (as in, less memory consumed) for
newly created cache pools.

Signed-off-by: Sage Weil <sage@inktank.com>
11 years agomds: fix nested_anchors update during journal replay
Yan, Zheng [Wed, 26 Feb 2014 02:17:34 +0000 (10:17 +0800)]
mds: fix nested_anchors update during journal replay

check if the inode is anchored/unanchored before updating the inode

Fixes: #7530
Signed-off-by: Yan, Zheng <zheng.z.yan@intel.com>
Reviewed-by: Greg Farnum <greg@inktank.com>
11 years agoMerge pull request #1319 from ceph/wip-primary-temp-fix
Gregory Farnum [Wed, 26 Feb 2014 15:12:04 +0000 (07:12 -0800)]
Merge pull request #1319 from ceph/wip-primary-temp-fix

osd/OSDMap: respect temp primary without temp acting

Reviewed-by: Greg Farnum <greg@inktank.com>
11 years agoosd/OSDMap: respect temp primary without temp acting 1319/head
Samuel Just [Wed, 26 Feb 2014 06:48:18 +0000 (22:48 -0800)]
osd/OSDMap: respect temp primary without temp acting

be2748c6d540891f2e1a62e7034cb44f7d04bf18 ensured that
if the temp acting mapping contains only CRUSH_ITEM_NONE,
that the acting_primary is left at -1.  However, even if
acting.empty(), we need to respect a temp_primary mapping.
Thus, use _acting_primary unless acting.empty() &&
acting_primary == -1.

Bug introduced in be2748c6d540891f2e1a62e7034cb44f7d04bf18.
Signed-off-by: Samuel Just <sam.just@inktank.com>
11 years agoMerge pull request #1317 from ceph/wip-7537
Samuel Just [Wed, 26 Feb 2014 04:42:18 +0000 (20:42 -0800)]
Merge pull request #1317 from ceph/wip-7537

Wip 7537

Reviewed-by: David Zafman <david.zafman@inktank.com>
11 years agoOSDMap::_pg_to_up_acting_osds: use _acting_primary unless acting is empty 1317/head
Samuel Just [Wed, 26 Feb 2014 00:47:21 +0000 (16:47 -0800)]
OSDMap::_pg_to_up_acting_osds: use _acting_primary unless acting is empty

If the temp set for whatever reason has only CRUSH_ITEM_NONE,
we need primary to be -1.

Signed-off-by: Samuel Just <sam.just@inktank.com>
11 years agoMerge pull request #1311 from ceph/wip-dz-scrub-fixes
Samuel Just [Tue, 25 Feb 2014 23:28:08 +0000 (15:28 -0800)]
Merge pull request #1311 from ceph/wip-dz-scrub-fixes

Wip dz scrub fixes

Reviewed-by: Samuel Just <sam.just@inktank.com>
11 years agoOSDMonitor: when thrashing, only generate valid temp pg mappings
Samuel Just [Tue, 25 Feb 2014 20:34:57 +0000 (12:34 -0800)]
OSDMonitor: when thrashing, only generate valid temp pg mappings

Since backfill peers are no longer placed into the acting set,
temp mappings will never exceed the pool size.  Also, for ec
pools, temp mappings will never be less than the pool size.

Signed-off-by: Samuel Just <sam.just@inktank.com>
11 years agoRevert "osd/PG: fix assert when deep repair finds no errors" 1311/head
David Zafman [Tue, 25 Feb 2014 03:56:48 +0000 (19:56 -0800)]
Revert "osd/PG: fix assert when deep repair finds no errors"

This reverts commit e3e3328ec8a57f1ae2a2fd9893c51068798720a0.

11 years agoosd: Don't include primary's shard in repair result message
David Zafman [Tue, 25 Feb 2014 00:49:28 +0000 (16:49 -0800)]
osd: Don't include primary's shard in repair result message

Signed-off-by: David Zafman <david.zafman@inktank.com>
11 years agoMerge pull request #1308 from ceph/wip-osdmap-inc
Gregory Farnum [Mon, 24 Feb 2014 17:17:42 +0000 (09:17 -0800)]
Merge pull request #1308 from ceph/wip-osdmap-inc

mon/OSDMonitor: fix osdmap encode feature logic

Reviewed-by: Greg Farnum <greg@inktank.com>
11 years agoMerge pull request #1302 from ceph/wip-create-null
Gregory Farnum [Mon, 24 Feb 2014 17:08:36 +0000 (09:08 -0800)]
Merge pull request #1302 from ceph/wip-create-null

client: fix possible null dereference in create

Reviewed-by: Greg Farnum <greg@inktank.com>
11 years agoceph_test_objectstore: fix i386 build (again)
Sage Weil [Mon, 24 Feb 2014 03:54:14 +0000 (19:54 -0800)]
ceph_test_objectstore: fix i386 build (again)

test/objectstore/store_test.cc: In member function ‘void SyntheticWorkloadState::read()’:
error: test/objectstore/store_test.cc:462:23: no matching function for call to ‘swap(uint64_t&, size_t&)’

Signed-off-by: Sage Weil <sage@inktank.com>
11 years agoMerge pull request #1307 from ceph/wip-7517
Sage Weil [Mon, 24 Feb 2014 03:49:18 +0000 (19:49 -0800)]
Merge pull request #1307 from ceph/wip-7517

Wip 7517

11 years agomon/OSDMonitor: fix osdmap encode feature logic 1308/head
Sage Weil [Mon, 24 Feb 2014 02:23:55 +0000 (18:23 -0800)]
mon/OSDMonitor: fix osdmap encode feature logic

If we are encoding a full map based on an old Incremental that does not
encode the features, fall back to the quorum features or (barring that)
all features.  Do *not* do no features or else we will end up with
encode_client_old which does not even include the extended info and will
cause the mon to crash when decoding.

This was observed when upgading a 0.76 cluster to 0.77 (all mons stopped,
upgraded, and then started)

Reported-by: Aaron Ten Clay <aarontc@aarontc.com>
Signed-off-by: Sage Weil <sage@inktank.com>
11 years agoPG: skip pg_whoami.osd, not pg_whoami.shard in scrub feature check 1307/head
Samuel Just [Mon, 24 Feb 2014 00:02:43 +0000 (16:02 -0800)]
PG: skip pg_whoami.osd, not pg_whoami.shard in scrub feature check

Caused by typo in 68184d4574cd507ab3a065693e392917b98e16ec.

Fixes: #7517
Signed-off-by: Samuel Just <sam.just@inktank.com>
11 years agoMerge pull request #1304 from ceph/wip-last-epoch-clean
Samuel Just [Sun, 23 Feb 2014 23:32:18 +0000 (15:32 -0800)]
Merge pull request #1304 from ceph/wip-last-epoch-clean

mon: fix min_last_epoch_clean handling

Reviewed-by: Samuel Just <sam.just@inktank.com>
11 years agoMerge pull request #1306 from ceph/wip-7512
Sage Weil [Sun, 23 Feb 2014 22:48:10 +0000 (14:48 -0800)]
Merge pull request #1306 from ceph/wip-7512

wip-7512

Reviewed-by: Sage Weil <sage@inktank.com>
11 years agoOSD::project_pg_history needs to account for acting_primary/up_primary 1306/head
Samuel Just [Sat, 22 Feb 2014 20:30:29 +0000 (12:30 -0800)]
OSD::project_pg_history needs to account for acting_primary/up_primary

Fixes: #7512
Signed-off-by: Samuel Just <sam.just@inktank.com>
11 years agoObjecter/OSDMap: factor out primary_changed() into static OSDMap method
Samuel Just [Sun, 23 Feb 2014 21:23:42 +0000 (13:23 -0800)]
Objecter/OSDMap: factor out primary_changed() into static OSDMap method

We need to reuse this logic in OSD::project_pg_history.

Signed-off-by: Samuel Just <sam.just@inktank.com>
11 years agoPG: clarify same_primary_since updates regarding primary rank
Samuel Just [Sun, 23 Feb 2014 21:29:07 +0000 (13:29 -0800)]
PG: clarify same_primary_since updates regarding primary rank

pg_shard_t includes the position, so these checks handle
same osd/different rank properly.

Signed-off-by: Samuel Just <sam.just@inktank.com>
11 years agomon/PGMap: fix osd_epochs update 1304/head
Sage Weil [Sat, 22 Feb 2014 17:29:15 +0000 (09:29 -0800)]
mon/PGMap: fix osd_epochs update

The insert() call here does not overwrite a previous entry, which means
that the osd_epochs map is never moving forward in time.  This seems to
have been broken since it was introduced in 091809b814.

Backport: emperor, dumpling
Signed-off-by: Sage Weil <sage@inktank.com>
11 years agomon/PGMap: add unit test for min_last_epoch_clean
Sage Weil [Sat, 22 Feb 2014 17:17:44 +0000 (09:17 -0800)]
mon/PGMap: add unit test for min_last_epoch_clean

Signed-off-by: Sage Weil <sage@inktank.com>
11 years agoECBackend: skip canceled xattr reads as well
Samuel Just [Sun, 23 Feb 2014 08:48:27 +0000 (00:48 -0800)]
ECBackend: skip canceled xattr reads as well

Signed-off-by: Samuel Just <sam.just@inktank.com>
11 years agoclient: fix possible null dereference in create 1302/head
Sage Weil [Sun, 23 Feb 2014 18:18:02 +0000 (10:18 -0800)]
client: fix possible null dereference in create

There are two paths that jump to the out label for which 'in' can be
NULL and outp can be non-NULL.  For those cases we want to fill in the
caller's pointer value (they asked for it) but we clearly cannot take
a reference.

Backport: emperor, dumpling
Signed-off-by: Sage Weil <sage@inktank.com>
11 years agoosd: increase default leveldb write buffer, cache size
Sage Weil [Sun, 23 Feb 2014 18:05:39 +0000 (10:05 -0800)]
osd: increase default leveldb write buffer, cache size

The FileStore's leveldb currently uses libleveldb's defaults for cache and
write buffer size, which are both 4 MB. Increase the cache size to 128MB and
the write buffer to 8MB.

Tested-by: Dmitry Smirnov <onlyjob@member.fsf.org>
Signed-off-by: Sage Weil <sage@inktank.com>
11 years agoceph_test_objectstore: fix i386 build error
Sage Weil [Sun, 23 Feb 2014 17:05:56 +0000 (09:05 -0800)]
ceph_test_objectstore: fix i386 build error

We can't swap size_t and uint64_t; just change the len type to match.

Signed-off-by: Sage Weil <sage@inktank.com>
11 years agoceph_test_objectstore: fix signed/unsigned warning
Sage Weil [Sun, 23 Feb 2014 17:03:42 +0000 (09:03 -0800)]
ceph_test_objectstore: fix signed/unsigned warning

In file included from test/objectstore/store_test.cc:33:0:
../src/gtest/include/gtest/gtest.h: In function ‘testing::AssertionResult testing::internal::CmpHelperEQ(const char*, const char*, const T1&, const T2&) [with T1 = int, T2 = unsigned int]’:
../src/gtest/include/gtest/gtest.h:1300:30: instantiated from ‘static testing::AssertionResult testing::internal::EqHelper::Compare(const char*, const char*, const T1&, const T2&) [with T1 = int, T2 = unsigned int, bool lhs_is_null_literal = false]’
test/objectstore/store_test.cc:484:193: instantiated from here
warning: ../src/gtest/include/gtest/gtest.h:1263:3: comparison between signed and unsigned integer expressions [-Wsign-compare]

Signed-off-by: Sage Weil <sage@inktank.com>
11 years agoerasure-code: test that changing the pool size is not allowed
Loic Dachary [Wed, 19 Feb 2014 14:05:50 +0000 (15:05 +0100)]
erasure-code: test that changing the pool size is not allowed

http://tracker.ceph.com/issues/7360 fixes #7360

Signed-off-by: Loic Dachary <loic@dachary.org>
11 years agoMerge pull request #1294 from ceph/wip-librados-object-iterator
Sage Weil [Sun, 23 Feb 2014 15:25:13 +0000 (07:25 -0800)]
Merge pull request #1294 from ceph/wip-librados-object-iterator

fix bugs in librados::ObjectIterator

Reviewed-by: Sage Weil <sage@inktank.com>
11 years agoMerge pull request #1295 from yuyuyu101/keyvaluestore-enhance
Sage Weil [Sun, 23 Feb 2014 15:24:43 +0000 (07:24 -0800)]
Merge pull request #1295 from yuyuyu101/keyvaluestore-enhance

Keyvaluestore enhance(backport to firely)

Pulling this into firefly because it doesn't (substantiatively) touch anything outside of KeyValueStore.

Reviewed-by: Sage Weil <sage@inktank.com>
11 years agoMerge pull request #1297 from ceph/wip-ec-bugs
Sage Weil [Sun, 23 Feb 2014 15:12:40 +0000 (07:12 -0800)]
Merge pull request #1297 from ceph/wip-ec-bugs

Wip ec bugs

Reviewed-by: Sage Weil <sage@inktank.com>
11 years agounittest_ecbackend: fix signed/unsigned warnings
Sage Weil [Sun, 23 Feb 2014 06:00:55 +0000 (22:00 -0800)]
unittest_ecbackend: fix signed/unsigned warnings

In file included from test/osd/TestECBackend.cc:20:0:
../src/gtest/include/gtest/gtest.h: In instantiation of ‘testing::AssertionResult testing::internal::CmpHelperEQ(const char*, const char*, const T1&, const T2&) [with T1 = long unsigned int; T2 = int]’:
../src/gtest/include/gtest/gtest.h:1300:30: required from ‘static testing::AssertionResult testing::internal::EqHelper::Compare(const char*, const char*, const T1&, const T2&) [with T1 = long unsigned int; T2 = int; bool lhs_is_null_literal = false]’
test/osd/TestECBackend.cc:30:281: required from here
warning: ../src/gtest/include/gtest/gtest.h:1263:3: comparison between signed and unsigned integer expressions [-Wsign-compare]

Signed-off-by: Sage Weil <sage@inktank.com>
11 years agoMerge pull request #1301 from ceph/wip-scrub-primary
Sage Weil [Sun, 23 Feb 2014 05:56:53 +0000 (21:56 -0800)]
Merge pull request #1301 from ceph/wip-scrub-primary

mon/PGMonitor: fix primary osd check on deep-scrub

gitbuilders are now passing

11 years agomon/PGMonitor: fix primary osd check on deep-scrub 1301/head
Sage Weil [Sun, 23 Feb 2014 05:31:48 +0000 (21:31 -0800)]
mon/PGMonitor: fix primary osd check on deep-scrub

s/!=/==/.  Logic was reversed.

Broken in 40bdcb88504aea6288d461d29d24d5b0bf7aeebc.

Signed-off-by: Sage Weil <sage@inktank.com>
11 years agoMerge pull request #1300 from ceph/wip-7513
Samuel Just [Sun, 23 Feb 2014 01:35:46 +0000 (17:35 -0800)]
Merge pull request #1300 from ceph/wip-7513

PGLog::activate_not_complete typo

Reviewed-by: David Zafman <david.zafman@inktank.com>
11 years agoPGLog::activate_not_complete: fix log.complete_to increment typo 1300/head
Samuel Just [Sun, 23 Feb 2014 00:38:46 +0000 (16:38 -0800)]
PGLog::activate_not_complete: fix log.complete_to increment typo

info.last_complete should be the entry before log.complete_to.

This appears to have been a typo introduced in
dd71051a8f6ec611b3559f8e2aff3c001be37792.

Signed-off-by: Samuel Just <sam.just@inktank.com>
11 years agoMerge pull request #1298 from ceph/wip-subscribe
Samuel Just [Sun, 23 Feb 2014 01:18:55 +0000 (17:18 -0800)]
Merge pull request #1298 from ceph/wip-subscribe

osd: fix off-by-one is boot subscription

Reviewed-by: Samuel Just <sam.just@inktank.com>
11 years agoMerge pull request #1299 from ceph/wip-repair
David Zafman [Sat, 22 Feb 2014 22:55:08 +0000 (14:55 -0800)]
Merge pull request #1299 from ceph/wip-repair

osd/PG: fix assert when a shallow repair has fixed all errors.

Reviewed-by: David Zafman <david.zafman@inktank.com>
11 years agoosd/PG: fix assert when deep repair finds no errors 1299/head
David Zafman [Sat, 22 Feb 2014 21:51:03 +0000 (13:51 -0800)]
osd/PG: fix assert when deep repair finds no errors

If there are no deep repairs, we don't want to assert.
Fixes:

    -1> 2014-02-21 21:13:56.393087 7f0258ff9700  0 log [INF] : 0.0 repair ok, 0 fixed
     0> 2014-02-21 21:13:56.428703 7f0258ff9700 -1 osd/PG.cc: In function 'void PG::scrub_finish()' thread 7f0258ff9700 time 2014-02-21 21:13:56.393127
osd/PG.cc: 4294: FAILED assert(deep_scrub)

Signed-off-by: David Zafman <david.zafman@inktank.com>
Signed-off-by: Sage Weil <sage@inktank.com>
11 years agoPGLog: test for missing using the correct shard value 1296/head 1297/head
Samuel Just [Fri, 21 Feb 2014 21:25:36 +0000 (13:25 -0800)]
PGLog: test for missing using the correct shard value

Signed-off-by: Samuel Just <sam.just@inktank.com>
11 years agoOSD: fix query for ec pgs
Samuel Just [Fri, 21 Feb 2014 21:25:17 +0000 (13:25 -0800)]
OSD: fix query for ec pgs

We need to parse a pg_t and translate it into an spg_t.

Signed-off-by: Samuel Just <sam.just@inktank.com>
11 years agoObjecter: make is_pg_changed static and const for old/newacting
Samuel Just [Fri, 21 Feb 2014 20:00:06 +0000 (12:00 -0800)]
Objecter: make is_pg_changed static and const for old/newacting

Signed-off-by: Samuel Just <sam.just@inktank.com>
11 years agoOSDMap: make calc_pg_rank/role const for acting
Samuel Just [Fri, 21 Feb 2014 19:59:16 +0000 (11:59 -0800)]
OSDMap: make calc_pg_rank/role const for acting

Signed-off-by: Samuel Just <sam.just@inktank.com>
11 years agoObjecter: resend op if primary role changed
Samuel Just [Fri, 21 Feb 2014 19:59:04 +0000 (11:59 -0800)]
Objecter: resend op if primary role changed

Fixes: #7508
Signed-off-by: Samuel Just <sam.just@inktank.com>
11 years agoECTransaction: require hash_infos for deleted objects
Samuel Just [Fri, 21 Feb 2014 17:34:15 +0000 (09:34 -0800)]
ECTransaction: require hash_infos for deleted objects

Otherwise, an append preceded by a delete may not see the
correct HashInfo state since it won't have been cached
until the delete is applied.

Fixes: #7506
Signed-off-by: Samuel Just <sam.just@inktank.com>
11 years agoECUtil: clear() should reset hashes to -1, not 0
Samuel Just [Fri, 21 Feb 2014 17:33:05 +0000 (09:33 -0800)]
ECUtil: clear() should reset hashes to -1, not 0

Signed-off-by: Samuel Just <sam.just@inktank.com>
11 years agoReplicatedPG::cancel_pull: ECBackend might cancel_pull on a non-missing object
Samuel Just [Fri, 21 Feb 2014 02:32:08 +0000 (18:32 -0800)]
ReplicatedPG::cancel_pull: ECBackend might cancel_pull on a non-missing object

Signed-off-by: Samuel Just <sam.just@inktank.com>
11 years agoECBackend::filter_read_op: clean up read state properly
Samuel Just [Fri, 21 Feb 2014 02:31:35 +0000 (18:31 -0800)]
ECBackend::filter_read_op: clean up read state properly

Fixes: #7494
Signed-off-by: Samuel Just <sam.just@inktank.com>
11 years agoosd: fix off-by-one is boot subscription 1298/head
Sage Weil [Sat, 22 Feb 2014 16:08:37 +0000 (08:08 -0800)]
osd: fix off-by-one is boot subscription

If we have osdmap N, we want to onetime subscribe
starting at N+1.  Among other things, it means we
hear when the NOUP flag is cleared.

This appears to have broken somewhere around
3c76b81f2f96b790b72f2088164ed8e9d5efbba1.

Fixes: #7511
Signed-off-by: Sage Weil <sage@inktank.com>
11 years agoRename keyvaluestore_check_backend to keyvaluestore_debug_check_backend 1282/head 1295/head
Haomai Wang [Sat, 22 Feb 2014 15:57:02 +0000 (23:57 +0800)]
Rename keyvaluestore_check_backend to keyvaluestore_debug_check_backend

Signed-off-by: Haomai Wang <haomaiwang@gmail.com>
11 years agoAdd KeyValueStore op thread options
Haomai Wang [Fri, 21 Feb 2014 14:48:00 +0000 (22:48 +0800)]
Add KeyValueStore op thread options

Signed-off-by: Haomai Wang <haomaiwang@gmail.com>
11 years agoRemove eio inject codes in KeyValueStore
Haomai Wang [Fri, 21 Feb 2014 14:44:39 +0000 (22:44 +0800)]
Remove eio inject codes in KeyValueStore

Signed-off-by: Haomai Wang <haomaiwang@gmail.com>
11 years agoAdd config tracker to KeyValueStore
Haomai Wang [Fri, 21 Feb 2014 14:35:10 +0000 (22:35 +0800)]
Add config tracker to KeyValueStore

Signed-off-by: Haomai Wang <haomaiwang@gmail.com>
11 years agoAdd backend check option to KeyValueStore
Haomai Wang [Fri, 21 Feb 2014 14:33:58 +0000 (22:33 +0800)]
Add backend check option to KeyValueStore

Signed-off-by: Haomai Wang <haomaiwang@gmail.com>
11 years agoRemove filestore_inject_stall
Haomai Wang [Fri, 21 Feb 2014 14:14:52 +0000 (22:14 +0800)]
Remove filestore_inject_stall

Signed-off-by: Haomai Wang <haomaiwang@gmail.com>
11 years agoRemove m_eio in KeyValueStore
Haomai Wang [Fri, 21 Feb 2014 14:10:17 +0000 (22:10 +0800)]
Remove m_eio in KeyValueStore

KeyValueStore use kv backend to detect errors and nearly can't know the actual
reason for error.

Signed-off-by: Haomai Wang <haomaiwang@gmail.com>
11 years agoMake SequencePosition sync by each transaction
Haomai Wang [Fri, 21 Feb 2014 13:59:42 +0000 (21:59 +0800)]
Make SequencePosition sync by each transaction

Each object modify will increase SequencePosition and sync it to disk

Signed-off-by: Haomai Wang <haomaiwang@gmail.com>
11 years agoImplement collection_rename interface in KeyValueStore
Haomai Wang [Fri, 21 Feb 2014 13:36:48 +0000 (21:36 +0800)]
Implement collection_rename interface in KeyValueStore

Signed-off-by: Haomai Wang <haomaiwang@gmail.com>
11 years agoRemove unnecessary "check_coll" check
Haomai Wang [Fri, 21 Feb 2014 12:55:19 +0000 (20:55 +0800)]
Remove unnecessary "check_coll" check

The goal of "check_coll" is aimed to ensure the collection is exists. But
the create and delete of collection already ensured by OSD, just remove check.

Signed-off-by: Haomai Wang <haomaiwang@gmail.com>
11 years agoOptimize write call add enhance error detect
Haomai Wang [Fri, 21 Feb 2014 08:46:53 +0000 (16:46 +0800)]
Optimize write call add enhance error detect

A single write call may need several keys in the backend kv store. Let get these
keys one time.

Signed-off-by: Haomai Wang <haomaiwang@gmail.com>
11 years agoUnify object level lock in GenericObjectMap
Haomai Wang [Fri, 21 Feb 2014 06:44:48 +0000 (14:44 +0800)]
Unify object level lock in GenericObjectMap

Before we copy lock implementation from DBObjectMap which provide with two locks
for header. Here just unify it to make ease.

Signed-off-by: Haomai Wang <haomaiwang@gmail.com>
11 years agoFix incorrect read and truncate
Haomai Wang [Fri, 21 Feb 2014 04:23:10 +0000 (12:23 +0800)]
Fix incorrect read and truncate

If the first chunk of object is not read entirely, the current implementation
will contain it entirely which make wrong.

Signed-off-by: Haomai Wang <haomaiwang@gmail.com>
11 years agoReturn 0 when the offset of read exceed the length of object
Haomai Wang [Fri, 21 Feb 2014 04:22:24 +0000 (12:22 +0800)]
Return 0 when the offset of read exceed the length of object

Signed-off-by: Haomai Wang <haomaiwang@gmail.com>
11 years agoAdd read/write operation to store_test.cc
Haomai Wang [Thu, 20 Feb 2014 08:57:34 +0000 (16:57 +0800)]
Add read/write operation to store_test.cc

Signed-off-by: Haomai Wang <haomaiwang@gmail.com>