Developer quick start guide

Signed-off-by: Luis Pabón <lpabon@redhat.com>
Renamed README to README.md to render in markdown

Signed-off-by: Luis Pabón <lpabon@redhat.com>
Merge pull request #2208 from lpabon/osd_dev_doc

Developer quick start guide

Reviewed-by: Sage Weil <sage@redhat.com>
msgr: add ms_blackhole_$type options

Add the ability to blackhole messages sent or received from the given
entity type.  This will let us inject a network stall that will appear
similar to a network partition of a single node from its peers.

Signed-off-by: Sage Weil <sage@inktank.com>
librados: add osd_command() to c++ api

This is already present in the C API.

Signed-off-by: Sage Weil <sage@inktank.com>
osd/PG: drop unused queue_{notify,info,log}()

Signed-off-by: Sage Weil <sage@inktank.com>
osd/PG: uninline PG::init_primary_up_acting()

Signed-off-by: Sage Weil <sage@inktank.com>
osd/PG: refactor primary_init_up_acting

Get rid of the early return.

Signed-off-by: Sage Weil <sage@redhat.com>
ceph_test_osd_stale_read: add StaleRead test

This reproduces the "read hole".

Signed-off-by: Sage Weil <sage@inktank.com>
osd: do not rebind heartbeat messengers on wrongly marked down

If we are wrongly marked down and need to rejoin, it is important that we
bind to a new cluster address so that our peer to peer sessions are fully
distinct.

However, it we can still use the same heartbeat ports.  If we get a ping
from someone with an old map, it is better to still be there and tell them
that there is a newer map than for them to get crickets.

Signed-off-by: Sage Weil <sage@inktank.com>
doc: stale reads wip

Signed-off-by: Sage Weil <sage@inktank.com>
osd: include up_from, consumed_epoch in MOSDPing

Signed-off-by: Sage Weil <sage@inktank.com>
osd: some minor refactoring/cleanup in handle_osd_ping

Use local con variable.
Use a local utime_t now variable.

Signed-off-by: Sage Weil <sage@inktank.com>
osd: track some heartbeat stats for peer OSDs

We need to keep track of peer epochs and when they last sent or replied
to pings.  Keep this info in a separate ref-counted struct so that we can
point to it directly from other parts of the OSD that will need it.  For
now, this includes just the HeatbeatSession so that we can efficiently
update when we receive ping messages.

Signed-off-by: Sage Weil <sage@inktank.com>
osd: note rx_stamp in MNotifyRec

Note the timestamp we received the notify in the MNotifyRec struct.

Signed-off-by: Sage Weil <sage@inktank.com>
osd: calculate a per-pg readable_until map

For a given PG, calculate a readable_until map that, for each interval
that may still be relevant, includes a current lower bound on the amount
of time we will still be allowed to service reads.  This value is based on
the heartbeats we've responded to (as a non-primary) or gotten replies to
(as a primary).  For a stray, we know nothing.

Signed-off-by: Sage Weil <sage@redhat.com>
osd: include readable_delta in pg_notify_t

Whenever we send a pg_notify_t to a peer, include an upper bound on the
amount of time that the PG may remain readable after the message is sent.
For a replica, this value is based on the most recent heartbeat ack that
we have sent to the primary.  For the primary, it is based on all of the
acks we have received from replicas.  In either case, the value we send is
a delta to the current time so that we can avoid problems with clock
skew.  Obviously, the ultimate upper bound the receiver can infer on
receipt is bloated by network transit time.

Signed-off-by: Sage Weil <sage@inktank.com>
osd/PG: track peer readable_until values during peering

Translate the over-the-wire delta value to a timestamp in the process.
Clear on peering event.  Ignore after we are active.

Signed-off-by: Sage Weil <sage@inktank.com>
osd: recalc readable_until on each new peering interval

This ensure that the last calculated value for prior intervals is accurate,
as after this point we will only update the current interval's value.

Signed-off-by: Sage Weil <sage@inktank.com>
fix recalc_readble_until