doc: Change listed RBD cache defaults to actual defaults

Signed-off-by: Adam Crume <adamcrume@gmail.com>
osdc: Fix ObjectCounter::_readx perf counters

Signed-off-by: Adam Crume <adamcrume@gmail.com>
librbd: Add read-ahead

Signed-off-by: Adam Crume <adamcrume@gmail.com>
client: Replace client readahead logic with Readahead

Signed-off-by: Adam Crume <adamcrume@gmail.com>
For pgls OP, get/put budget on per list session basis, instead of per OP basis, which could lead to deadlock.

Signed-off-by: Guang Yang (yguang@yahoo-inc.com)
Clock: Using clock_gettime instead of gettimeofday in linux os.

The precision of utime_t is nsec. In func ceph_clock_now, it use
gettimeofday to set utime_t. But the precision of gettimeofday is
microseconds. In linux, the precision of clock_gettime is nsec.
So using clock_gettime install gettimeofday in order to get higer
precision.

Signed-off-by: Jianpeng Ma <jianpeng.ma@intel.com>
os/FileStore: using FIEMAP_FLAGS_SYNC instead of fsync() before call
fiemap.

When call fiemap, it need sync the file. Now it used fsync() to achieve
this. But for fiemap, there is a flag FIEMAP_FLAGS_SYNC which do the
same thing like fsync().

Signed-off-by: Jianpeng Ma <jianpeng.ma@intel.com>
mds: Add session to sessionmap when its state becomes opening

following sequence events may happen.
- client sends reconnect message to a recovering MDS.
- MDS::ms_verify_authorizer() create a session for the client, the
  session is in closed state.
- MDS::handle_client_reconnect() sends session close message to
  the client.
- client closes the old connection and opens a new connection
- MDS::ms_verify_authorizer() is called for a new connection
- MDS::ms_handle_reset() is called for the old connection
- MDS::ms_handle_accept() is called for the new connection

MDS::ms_handle_reset() removes client's session from the session map, this
can cause null pointer dereference when handling client request. The fix
is add session to sessionmap when its state becomes 'opening' and remove
session from sessionmap when its state becomes 'closed'

Signed-off-by: Yan, Zheng <zyan@redhat.com>
PG: release backfill reservations if a backfill peer rejects

Also, the full peer will wait until the rejection from the primary
to do a state transition.

Fixes: #9626
Backport: giant, firefly, dumpling
Signed-off-by: Samuel Just <sam.just@inktank.com>
mon: move paxos write wait into a helper

Avoid duplicated code.

Signed-off-by: Sage Weil <sage@redhat.com>
mon: flush paxos write before setting shutdown state

Paxos::commit_finish() makes assertions about our state (writing |
writing-previous).

Fixes: #9635
Signed-off-by: Sage Weil <sage@redhat.com>
mon: wait for paxos writes before touching state

Fix two other paths where may change the mon state so that we wait for the
pending write first.  start_election() in particular can be triggered at
almost any time if we see an election message from another mon.

Signed-off-by: Sage Weil <sage@redhat.com>
mon: put 'ceph status' health items on separate lines

This makes it *way* easier to read.

Signed-off-by: Sage Weil <sage@redhat.com>
mon: put 'ceph status' quorum status on new line

Signed-off-by: Sage Weil <sage@redhat.com>
mon: break recovery status onto separate lines

This affects both the 'health' and 'pgmap' sections of 'ceph status'
output.

Signed-off-by: Sage Weil <sage@redhat.com>
ReplicatedPG: clean out completed trimmed objects as we go

Also, explicitely maintain a max number of concurrently trimming
objects.

Fixes: 9113
Backport: dumpling, firefly, giant
Signed-off-by: Samuel Just <sam.just@inktank.com>
ReplicatedPG: do not queue the snap trimmer constantly

Previously, we continuously requeued the snap trimmer while in
TrimmingObjects.  This is not a good idea now that we try to
limit the number of snap trimming repops in flight and requeue
the snap trimmer directly as those repops complete.

Fixes: #9113
Backport: giant, dumpling, firefly
Signed-off-by: Samuel Just <sam.just@inktank.com>
ReplicatedPG: dump snap_trimq on pg query

Signed-off-by: Samuel Just <sam.just@inktank.com>
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 6843a0b81f10125842c90bc63eccc4fd873b58f2
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>
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>