Commit Graph

26648 Commits

Author SHA1 Message Date
Danny Al-Gaaf
db2fbb1d61 bench/dumb_backend.cc: check return value of lseek()
CID 743395 (#1 of 1): Unchecked return value from library (CHECKED_RETURN)
  check_return: Calling function "lseek(fd, offset, 0)" without checking
   return value. This library function may fail and return an error code.
  unchecked_value: No check of the return value of "lseek(fd, offset, 0)".

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
2013-05-31 19:15:22 +02:00
Danny Al-Gaaf
a7a0425de7 bench/dumb_backend.cc: check return value of posix_fadvise()
CID 743396 (#1 of 1): Unchecked return value from library (CHECKED_RETURN)
  check_return: Calling function "posix_fadvise(fd, offset, bl->length(), 4)"
   without checking return value. This library function may fail and return
   an error code.
  unchecked_value: No check of the return value of
   "posix_fadvise(fd, offset, bl->length(), 4)".

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
2013-05-31 19:15:22 +02:00
Danny Al-Gaaf
679775ae2d small_io_bench_fs.cc: check return value of FileStore::mkfs/mount()
CID 743398 (#1 of 1): Unchecked return value (CHECKED_RETURN)
  check_return: Calling function "FileStore::mount()" without
   checking return value (as is done elsewhere 4 out of 5 times).
  unchecked_value: No check of the return value of "fs.FileStore::mount()"

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
2013-05-31 19:15:22 +02:00
Danny Al-Gaaf
2a02409183 mds/Locker.cc: fix explicit null dereferenced
CID 716916 (#1 of 1): Explicit null dereferenced (FORWARD_NULL)
  var_deref_model: Passing null pointer "in" to function
  "CInode::is_head()", which dereferences it.

Add assert.

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
2013-05-31 19:15:22 +02:00
Danny Al-Gaaf
39a53e5c72 mds/Server.cc: fix explicit null dereferenced
CID 716928 (#1 of 1): Explicit null dereferenced (FORWARD_NULL)
  var_deref_model: Passing null pointer "session" to function
  "Session::trim_completed_requests(tid_t)", which dereferences it.

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
2013-05-31 19:15:22 +02:00
Yehuda Sadeh
c5fc52ae0f rgw: only append prefetched data if reading from head
Fixes: #5209
Backport: bobtail, cuttlefish
If the head object wrongfully contains data, but according to the
manifest we don't read from the head, we shouldn't copy the prefetched
data. Also fix the length calculation for that data.

Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
Reviewed-by: Greg Farnum <greg@inktank.com>
2013-05-31 10:10:51 -07:00
Yehuda Sadeh
b1312f94ed rgw: don't copy object idtag when copying object
Fixes: #5204
When copying object we ended up also copying the original
object idtag which overrode the newly generated one. When
refcount put is called with the wrong idtag the count
does't go down.

Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
Reviewed-by: Greg Farnum <greg@inktank.com>
2013-05-31 10:10:42 -07:00
Samuel Just
fbf5a242d9 Merge branch 'wip-5046'
Reviewed-by: Samuel Just <sam.just@inktank.com>
2013-05-30 22:39:12 -07:00
Sage Weil
df2d06db6f mon: destroy MonitorDBStore before g_ceph_context
Put it on the heap so that we can destroy it before the g_ceph_context
cct that it references.  This fixes a crash like

*** Caught signal (Segmentation fault) **
in thread 4034a80
ceph version 0.63-204-gcf9aa7a (cf9aa7a003)
1: ceph-mon() [0x59932a]
2: (()+0xfcb0) [0x4e41cb0]
3: (Mutex::Lock(bool)+0x1b) [0x6235bb]
4: (PerfCountersCollection::remove(PerfCounters*)+0x27) [0x6a0877]
5: (LevelDBStore::~LevelDBStore()+0x1b) [0x582b2b]
6: (LevelDBStore::~LevelDBStore()+0x9) [0x582da9]
7: (main()+0x1386) [0x48db16]
8: (__libc_start_main()+0xed) [0x658076d]
9: ceph-mon() [0x4909ad]

Signed-off-by: Sage Weil <sage@inktank.com>
2013-05-30 21:43:50 -07:00
John Wilkins
f4eddd7be9 doc: Updated to reflect glossary usage.
Signed-off-by: John Wilkins <john.wilkins@inktank.com>
2013-05-30 20:28:22 -07:00
John Wilkins
474bb164d6 doc: Updated title and syntax to reflect glossary usage.
Signed-off-by: John Wilkins <john.wilkins@inktank.com>
2013-05-30 20:27:42 -07:00
John Wilkins
7365d0c36d doc: Updated to reflect glossary usage.
Signed-off-by: John Wilkins <john.wilkins@inktank.com>
2013-05-30 20:27:01 -07:00
John Wilkins
eb35d739ae doc: Updated title to reflect glossary usage.
Signed-off-by: John Wilkins <john.wilkins@inktank.com>
2013-05-30 20:26:03 -07:00
John Wilkins
65294bf67e doc: Updated conf with ServerAlias for S3 subdomains.
Signed-off-by: John Wilkins <john.wilkins@inktank.com>
2013-05-30 20:25:25 -07:00
John Wilkins
442f082a86 doc: Updated object storage quick start for S3-style subdomains.
Signed-off-by: John Wilkins <john.wilkins@inktank.com>
2013-05-30 20:24:55 -07:00
John Wilkins
5e450baa94 doc: Updated text with new glossary terms.
Signed-off-by: John Wilkins <john.wilkins@inktank.com>
2013-05-30 20:22:58 -07:00
John Wilkins
c4001b12fc doc: Removed FAQ from the index.
Signed-off-by: John Wilkins <john.wilkins@inktank.com>
2013-05-30 20:21:48 -07:00
John Wilkins
d52b8055b7 doc: Removed FAQ doc. It's now in the wiki.
Signed-off-by: John Wilkins <john.wilkins@inktank.com>
2013-05-30 20:21:20 -07:00
Sage Weil
cf9aa7a003 debian: guard upstart {start,stop} with -x check
Sigh.

Signed-off-by: Sage Weil <sage@inktank.com>
2013-05-30 17:23:36 -07:00
Sage Weil
a40010534f Merge branch 'wip-deb-removal' into next
Tested by Tamil, Gary.
2013-05-30 17:17:43 -07:00
Alex Elder
6bac8ac06c rbd/kernel.sh: quit looking for snapshot sysfs entries
The sysfs entries for snapshots went away a while ago, and this
script used them to verify sizes matched what was expected.

Instead, look at the mapped size of the snapshot in the places
that used to look for the image's snapshot sysfs files.

Also, switch over to using "udevadm settle" rather than a delay to
wait for udev to do its thing.  Insert them at more appropriate
places--right after "rmd map" commands and before and after the
"rbd unmap" calls.

Stop doing the manual refresh calls as well.  The osd will trigger
refreshes whenever the image size or shapshot context changes.

Finally, the cleanup routine is called initially, when there really
isn't expected to be anything to clean up.  Change the rbd commands
to run there conditionally, only if the target of the command
already exists.

Signed-off-by: Alex Elder <elder@inktank.com>
2013-05-30 18:38:53 -05:00
Sage Weil
38ed3e43f5 Merge pull request #334 from ceph/wip-mon
Reviewed-by: Joao Eduardo Luis <joao.luis@inktank.com>
2013-05-30 16:27:02 -07:00
Sage Weil
1d75b49c72 debian: add radosgw.postinst
Start radosgw-all job.

Signed-off-by: Sage Weil <sage@inktank.com>
2013-05-30 16:22:54 -07:00
Sage Weil
d126a205ca debian: invoke-rc.d does not work with upstart jobs
Broken by 19c5ac37ef.

Signed-off-by: Sage Weil <sage@inktank.com>
2013-05-30 16:22:40 -07:00
Sage Weil
446e0770c7 fix test users of LevelDBStore
Need to pass in cct.

Signed-off-by: Sage Weil <sage@inktank.com>
2013-05-30 15:53:35 -07:00
Loic Dachary
ec7731f737 move log, ondisklog, missing from PG to PGLog
PG::log, PG::ondisklog, PG::missing are moved from PG to a new PGLog
class and are made protected data members. It is a preliminary step
before writing unit tests to cover the methods that have side effects
on these data members and define a clean PGLog API. It improves
encapsulation and does not change any of the logic already in
place.

Possible issues :

* an additional reference (PG->PGLog->IndexedLog instead of
  PG->IndexedLog for instance) is introduced : is it optimized ?

* rewriting log.log into pg_log.get_log().log affects the readability
  but should be optimized and have no impact on performances

The guidelines followed for this patch are:

* const access to the data members are preserved, no attempt is made
  to define accessors

* all non const methods are in PGLog, no access to non const methods of
  PGLog::log, PGLog::logondisk and PGLog::missing are provided

* when methods are moved from PG to PGLog the change to their
  implementation is restricted to the minimum.

* the PG::OndiskLog and PG::IndexedLog sub classes are moved
  to PGLog sub classes unmodified and remain public

A const version of the pg_log_t::find_entry method was added.

A const accessor is provided for PGLog::get_log, PGLog::get_missing,
PGLog::get_ondisklog but no non-const accessor.

Arguments are added to most of the methods moved from PG to PGLog so
that they can get access to PG data members such as info or log_oid.

The PGLog method are sorted according to the data member they modify.

//////////////////// missing ////////////////////

* The pg_missing_t::{got,have,need,add,rm} methods are wrapped as
  PGLog::missing_{got,have,need,add,rm}

//////////////////// log ////////////////////

* PGLog::get_tail, PGLog::get_head getters are created

* PGLog::set_tail, PGLog::set_head, PGLog::set_last_requested setters
  are created

* PGLog::index, PGLog::unindex, PGLog::add wrappers,
  PGLog::reset_recovery_pointers are created

* PGLog::clear_info_log replaces PG::clear_info_log

* PGLog::trim replaces PG::trim

//////////////////// log & missing ////////////////////

* PGLog::claim_log is created with code extracted from
  PG::RecoveryState::Stray::react.

* PGLog::split_into is created with code extracted from
  PG::split_into.

* PGLog::recover_got is created with code extracted from
  ReplicatedPG::recover_got.

* PGLog::activate_not_complete is created with code extracted
  from PG::active

* PGLog:proc_replica_log is created with code extracted from
  PG::proc_replica_log

* PGLog:write_log is created with code extracted from
  PG::write_log

* PGLog::merge_old_entry replaces PG::merge_old_entry
  The remove_snap argument is used to collect hobject_t

* PGLog::rewind_divergent_log replaces PG::rewind_divergent_log
  The remove_snap argument is used to collect hobject_t
  A new PG::rewind_divergent_log method is added to call
  remove_snap_mapped_object on each of the remove_snap
  elements

* PGLog::merge_log replaces PG::merge_log
  The remove_snap argument is used to collect hobject_t
  A new PG::merge_log method is added to call
  remove_snap_mapped_object on each of the remove_snap
  elements

* PGLog:write_log is created with code extracted from PG::write_log. A
  non-static version is created for convenience but is a simple
  wrapper.

* PGLog:read_log replaces PG::read_log. A non-static version is
  created for convenience but is a simple wrapper.

* PGLog:read_log_old replaces PG::read_log_old.

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

Signed-off-by: Loic Dachary <loic@dachary.org>
2013-05-30 15:44:57 -07:00
Samuel Just
d1b3eebded os/WBThrottle: remove asserts in clear()
cur_ios, etc may not be zero due to an in progress
flush.

Signed-off-by: Samuel Just <sam.just@inktank.com>
Reviewed-by: Greg Farnum <greg@inktank.com>
2013-05-30 15:42:34 -07:00
Sage Weil
3cc0f3d803 Merge pull request #335 from ceph/wip-5176
Reviewed-by: Samuel Just <sam.just@inktank.com>
2013-05-30 15:04:21 -07:00
Sage Weil
7802292e0a os/LevelDBStore: add perfcounters
Signed-off-by: Sage Weil <sage@inktank.com>
2013-05-30 14:57:42 -07:00
Sage Weil
a47ca58398 mon: make compaction bounds overlap
When we trim items N to M, compact over range (N-1) to M so that the
items in the queue will share bounds and get merged.  There is no harm in
compacting over a larger range here when the lower bound is a key that
doesn't exist anyway.

Signed-off-by: Sage Weil <sage@inktank.com>
2013-05-30 14:36:41 -07:00
Sage Weil
f628dd0e4a os/LevelDBStore: merge adjacent ranges in compactionqueue
If we get behind and multiple adjacent ranges end up in the queue, merge
them so that we fire off compaction on larger ranges.

Signed-off-by: Sage Weil <sage@inktank.com>
2013-05-30 14:26:42 -07:00
Josh Durgin
e9c32b97aa doc: note openstack changes for Grizzly
These are just for the cinder configuration, nothing else changed.

Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
2013-05-30 14:17:35 -07:00
Christophe Courtaut
5fa098f10a Added -r option to usage
Added the -r option, which starts the radosgw and apache2 to access it
to the usage message.

Signed-off-by: Christophe Courtaut <christophe.courtaut@gmail.com>
2013-05-30 12:20:17 -07:00
Sage Weil
1ba1433617 Merge pull request #333 from ceph/wip-5203
Reviewed-by: Sage Weil <sage@inktank.com>
2013-05-30 11:42:45 -07:00
Sage Weil
c888d1d3f1 mon: fix leak of health_monitor and config_key_service
Switch to using regular pointers here.  The lifecycle of these services is
very simple such that refcounting is overkill.

Signed-off-by: Sage Weil <sage@inktank.com>
2013-05-30 11:17:04 -07:00
Sage Weil
3c5706163b mon: return instead of exit(3) via preforker
This lets us run all the locally-scoped dtors so that leak checking will
work.

Signed-off-by: Sage Weil <sage@inktank.com>
2013-05-30 11:17:04 -07:00
Joao Eduardo Luis
626de387e6 mon: Monitor: backup monmap using all ceph features instead of quorum's
When a monitor is freshly created and for some reason its initial sync is
aborted, it will end up with an incorrect backup monmap.  This monmap is
incorrect in the sense that it will not contain the monitor's names as
it will expect on the next run.

This results from us being using the quorum features to encode the monmap
when backing it up, instead of CEPH_FEATURES_ALL.

Fixes: #5203

Signed-off-by: Joao Eduardo Luis <joao.luis@inktank.com>
2013-05-30 18:21:25 +01:00
Sage Weil
59916b8efa debian: stop radosgw daemons on package removal
Signed-off-by: Sage Weil <sage@inktank.com>
2013-05-30 08:53:22 -07:00
Sage Weil
9e658f0321 debian: stop sysvinit ceph-mds daemons
Signed-off-by: Sage Weil <sage@inktank.com>
2013-05-30 08:53:05 -07:00
Sage Weil
70a383204b debian: only stop daemons on removea; not upgrade
Signed-off-by: Sage Weil <sage@inktank.com>
2013-05-30 08:51:16 -07:00
Alex Elder
f40256878d rbd/concurrent.sh: probe rbd module at start
There's no guarantee the rbd module is loaded when this script is
run, so add a line that loads it if necessary.

Signed-off-by: Alex Elder <elder@inktank.com>
2013-05-30 10:10:16 -05:00
Sage Weil
c410f032e5 Merge pull request #331 from ceph/wip-osd-interfacecheck
Reviewed-by: Samuel Just <sam.just@inktank.com>
2013-05-29 22:45:37 -07:00
Sage Weil
bd2ba0e3b2 Merge branch 'next' 2013-05-29 22:44:40 -07:00
Sage Weil
0c0595514d osd: wait for healthy pings from peers in waiting-for-healthy state
If we are (wrongly) marked down, we need to go into the waiting-for-healthy
state and verify that our network interfaces are working before trying to
rejoin the cluster.

 - make _is_healthy() check require positive proof of pings working
 - do heartbeat checks and updates in this state
 - reset the random peers every heartbeat_interval, in case we keep picking
   bad ones

Signed-off-by: Sage Weil <sage@inktank.com>
2013-05-29 22:43:50 -07:00
Sage Weil
04aa2b5edf osd: distinguish between definitely healthy and definitely not unhealthy
is_unhealthy() will assume they are healthy for some period after we
send our first ping attempt.  is_healthy() is now a strict check that we
know they are healthy.

Switch the failure report check to use is_unhealthy(); use is_healthy()
everywhere else, including the waiting-for-healthy pre-boot checks.

Signed-off-by: Sage Weil <sage@inktank.com>
2013-05-29 22:43:49 -07:00
Sage Weil
28ea184d3a osd: remove down hb peers
If a (say, random) peer goes down, filter it out.

Signed-off-by: Sage Weil <sage@inktank.com>
2013-05-29 22:43:49 -07:00
Sage Weil
a4d3b47a92 osd: only add pg peers if active
We will soon be in this method for the waiting-for-healthy state.  As
a consequence, we need to remove any down peers.

Signed-off-by: Sage Weil <sage@inktank.com>
2013-05-29 22:43:49 -07:00
Sage Weil
b586f4a92d osd: factor out _remove_heartbeat_peer
Signed-off-by: Sage Weil <sage@inktank.com>
2013-05-29 22:43:49 -07:00
Sage Weil
e1dc3fd300 osd: augment osd heartbeat peers with neighbors and randoms, to up some min
- always include our neighbors to ensure we have a fully-connected
  graph
- include some random neighbors to get at least some min number of peers.

Signed-off-by: Sage Weil <sage@inktank.com>
2013-05-29 22:43:49 -07:00
Sage Weil
50ac8917f1 osd: initialize new_state field when we use it
If we use operator[] on a new int field its value is undefined; avoid
reading it or using |= et al until we initialize it.

Fixes: #4967
Backport: cuttlefish, bobtail
Signed-off-by: Sage Weil <sage@inktank.com>
Reviewed-by: David Zafman <david.zafman@inktank.com>
2013-05-29 16:50:04 -07:00