Commit Graph

81 Commits

Author SHA1 Message Date
Michal Jarzabek
be2b51ded2 osd: pass shared_ptr by const reference
Signed-off-by: Michal Jarzabek <stiopa@gmail.com>
2016-09-28 23:18:47 +01:00
shawn
eb355fadbc PGBackend: optimize header file dependency to decreace compile time when modify any file
hmm, everytime modify any file, then compile, then wait&wait&wait, so trying to optimize
this part, wish to decrease header dependency, try to improve compile speed.

Signed-off-by: Xiaowei Chen <chen.xiaowei@h3c.com>
2016-05-19 22:42:02 -04:00
shawn
d07f2cb2fd OSD: erase duplicated header include
especially osd_types.h, maybe affect compile speed.
Signed-off-by: Xiaowei Chen <chen.xiaowei@h3c.com>
2016-05-16 23:05:41 -04:00
Samuel Just
0a5b4c1d93 src/osd: use unique_ptr for backend trasaction, move into submit_transaction
submit_transaction takes ownership of the transaction implicitely.  Make
this implicit using an rvalue ref to force usage of std::move and move
constructor.

Signed-off-by: Samuel Just <sjust@redhat.com>
2016-02-25 10:56:41 -08:00
Danny Al-Gaaf
bbf0582342 make ctors with one argument explicit
Use explicit keyword for constructors with one argument to
prevent implicit usage as conversion functions.

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
2016-01-29 23:48:58 +01:00
Sage Weil
6560b14df9 osd: associate a CollectionHandle& with PGBackend
Make this a ref to the PG's handle because the backend is
constructed before the handle is opened.

Signed-off-by: Sage Weil <sage@redhat.com>
2016-01-27 14:34:51 -05:00
David Zafman
5c999b1528 osd: Allow get_hash_info to use attrs map if available
Signed-off-by: David Zafman <dzafman@redhat.com>
2016-01-04 11:19:50 -08:00
Guang Yang
8c8e1b7835 pg: add auto-repair for EC pool
Fixes: #12754
Signed-off-by: Guang Yang <yguang@yahoo-inc.com>
2015-10-16 20:29:48 +00:00
David Zafman
c09c1192db osd: Send reads to other shards if erasure coded chunk reads fail
Handle errors in a common way whether redundant reads or not

Signed-off-by: David Zafman <dzafman@redhat.com>
2015-08-27 14:03:23 -07:00
David Zafman
da2987d79d osd: Fix ECBackend to handle mismatch of total chunk size
Fixes: #12200

Signed-off-by: David Zafman <dzafman@redhat.com>
2015-08-27 14:03:22 -07:00
Guang Yang
131214dc6d ec: add support for fast read on PGBackend/ECBackend async read
Extend the PGBackend::objects_read_async interface to support *fast read*,
add the implemenation for ECBackend, in which we issue redundant reads,
and use the first returned (to decode) to serve clients.

Signed-off-by: Guang Yang <yguang@yahoo-inc.com>
2015-08-27 14:01:56 -07:00
Sage Weil
a208832cef explicitly specify comparator for all hobject_t maps and sets
This is necessary now that operator< is not defined.

Signed-off-by: Sage Weil <sage@redhat.com>
2015-08-07 10:16:04 -04:00
Guang G Yang
466b083166 osd: Move IsRecoverablePredicate/IsReadablePredicate to osd_types.h
Signed-off-by: Guang Yang <yguang@yahoo-inc.com>
2015-07-13 17:34:29 +00:00
Sage Weil
3b1b5a93af osd: eliminate temp collections
The temp objects have distinct pool ids.  Old temp objects are already
blown away on OSD restart.  This patch removes all the futzing with
temp_coll and puts the temp objects in the same collection as everything
else.

Interesting, collection_move_rename is now always using the same source
and dest collection.  Hmm!

Signed-off-by: Sage Weil <sage@redhat.com>
2015-06-18 17:02:45 -07:00
Samuel Just
1f1c6b5e53 Merge pull request #3539 from athanatos/wip-7861
osd: allow writes on degraded objects

Reviewed-by: Sage Weil <sage@redhat.com>
2015-02-02 09:18:22 -08:00
Petr Machata
85717394c3 support Boost 1.57.0
Sometime after 1.55, boost introduced a forward declaration of
operator<< in optional.hpp. In 1.55 and earlier, when << was used
without the _io having been included, what got dumped was an implicit
bool conversion.

http://tracker.ceph.com/issues/10688 Refs: #10688
Signed-off-by: Ken Dreyer <kdreyer@redhat.com>
2015-01-29 13:24:59 -07:00
Samuel Just
46212362cc PGBackend: rename clear_state to clear_recovery_state
This is called when we complete recovery, and does not clear
all state.  clear_recovery_state is clearer.

Signed-off-by: Samuel Just <sjust@redhat.com>
2015-01-22 13:11:50 -08:00
Samuel Just
27dcb148cd osd/: pass log_entries in write path as const ref
We need to use them after the submit_transaction call, so
we can't pass them by non-const ref.

Signed-off-by: Samuel Just <sjust@redhat.com>
2015-01-22 13:11:50 -08:00
Sage Weil
7d73f41f0d osd: use -1 for deep scrub digest seed on new OSDs
0 is a weak initial value for a CRC since it doesn't change with a sequence
of 0 bytes (which are relatively common).  -1 is better.  Use -1 when
everyone in the acting set supports it.

Signed-off-by: Sage Weil <sage@redhat.com>
2014-12-20 07:28:52 -08:00
Jianpeng Ma
5f92d825ea osd: Make async-read can handle fadvise flags.
Signed-off-by: Jianpeng Ma <jianpeng.ma@intel.com>
2014-12-12 14:23:35 +08:00
Jianpeng Ma
fc639b1961 PGBackend: Make objects_read_sync can handle fadvise flags
Signed-off-by: Jianpeng Ma <jianpeng.ma@intel.com>
2014-12-12 14:23:35 +08:00
Loic Dachary
45a61ad6b3 erasure-code: ECRecPred must be true if all chunks can be recovered
ECRecPred assumes recovering any number of chunk is possible as long as
at least K chunks are available. It builds the want() set accordingly in
the constructor and arbitrarily set the first K chunks. But it would be
the same if it set the last K chunks.

While this is correct for jerasure and isa plugins, it is not true in
general. The predicate should assume that all chunks are going to be
recovered and return true if they can all be recovered. Otherwise, the
following can happen:

  * a PG has chunks 0,1,2,3 for K=2, M=2
  * ECRecPred is initialized a set want to 0,1 because K=2
  * ECRecPred claims the plugin can recover when provided 0,1
  * the plugin is then required to recover 0,1 using 2,3 and fails

This can happen for the LRC plugin with k=4,m=2,l=3 which is

  01234567
  DDc_DDc_
  DDDc____
  ____DDDc

and if chunks 0,1,2,3 are missing there is no way to recover chunks
4,5,6,7.

Signed-off-by: Loic Dachary <loic-201408@dachary.org>
2014-08-29 19:39:57 +02:00
Ma Jianpeng
92d0bbe1cb ECBackend: Using ROUND_UP_TO to refactor function get_recovery_chunk_size()
Signed-off-by: Ma Jianpeng <jianpeng.ma@intel.com>
2014-08-01 08:32:23 +08:00
Sage Weil
49e5c8ec88 Merge remote-tracking branch 'gh/next' 2014-07-11 14:56:40 -07:00
Sage Weil
e299357e2a osd: separate cleanup from PGBackend::on_change()
The generic portion of on_change() cleaned up temporary on-disk objects
and requires a Transaction.  The rest is clearing out in-memory state and
does not.  Separate the two.

Signed-off-by: Sage Weil <sage@inktank.com>
2014-07-08 16:12:25 -07:00
Samuel Just
953c33edb6 osd/: plumb rollback_trim_to through interfaces and messages
We simply trim the roll back info up to min_last_complete_ondisk
since we cannot correctly rollback past that point anyway!

ReplicatedPG
-> PGBackend::submit_transaction
-> Backend messages
-> PGBackend::Listener::log_operation
-> append_log

Signed-off-by: Samuel Just <sam.just@inktank.com>
2014-06-27 13:25:52 -07:00
Samuel Just
5821cc7e55 osd/: propogate hit_set history with repop
We don't actually send the whole info on each repop, just the log
entries, updated stats, and a few other bits.  For hit_set ops, we need
to also communicate the new hit_set history status atomically with the
log entries and the transaction.  Thus, we add a channel for an optional
pg_hit_set_history_t field in PGBackend::submit_transaction interface
and associated messages and implementations to update the hit_set info
field along with the log entries.

This also means that hit_set_(persist|trim) update an
updated_hit_set_history field on the OpContext instead of directly
modifying the info field.

Fixes: #8124
Signed-off-by: Samuel Just <sam.just@inktank.com>
2014-04-21 10:53:04 -07:00
Dan Mick
1268dbb36e Change tid_t to ceph_tid_t to avoid conflicts with a popular type
Signed-off-by: Dan Mick <dan.mick@inktank.com>
2014-03-18 19:06:55 -07:00
Samuel Just
b90584a837 osd/: instantiate the right backend based on pool
Signed-off-by: Samuel Just <sam.just@inktank.com>
2014-02-17 20:12:16 -08:00
Samuel Just
792f0a85d0 ECBackend: flesh out ECBackend implementation
Signed-off-by: Samuel Just <sam.just@inktank.com>
2014-02-17 20:12:16 -08:00
Samuel Just
e8820ac42a src/osd/: add ECBackend stubs
Signed-off-by: Samuel Just <sam.just@inktank.com>
2014-02-17 20:12:15 -08:00