This prevents the relatively long process of queueing
finishers from preventing op submission.
In submit_entry, we no longer check for full before placing
the write in the writeq, committed_thru should work anyway,
and we don't want to grab the required lock.
Signed-off-by: Samuel Just <sam.just@inktank.com>
Previously, we tended to dump a lot of log output under
the Throttle lock. The log level for most log statements
has been reduced to 10.
Additionally, count and max are now atomic_t and can be
read without the Throttle lock.
Finally, most of the perf counter manipulations have been
moved outside of the lock.
Signed-off-by: Samuel Just <sam.just@inktank.com>
Neither caller of queue_op can race.
1) in queue_transactions, already under submit lock
2) in _journaled_ahead, journal finisher is single threaded
Signed-off-by: Samuel Just <sam.just@inktank.com>
syncing the filestore requires a stable commit point (i.e., all ops
up to applied_seq must have been applied). Previously, we used
journal_lock to atomically block new applies while waiting for
the remaining ones to finish. This creates unnecessary contention.
We now use apply_manager to manage that state atomically with its
own lock.
Signed-off-by: Samuel Just <sam.just@inktank.com>
Previously, we ensured op ordering by queueing for journal and
the op queue under the journal lock. All that is required is
that obtaining an op sequence, queueing for journal, and
(for parallel) queueing for application to the fs are done
atomically. To that end, submit_manager now handles op submission.
Signed-off-by: Samuel Just <sam.just@inktank.com>
Previously, data_align began at 0 and remained that way if no
transaction contained a large data segment. This 0 was propagated
to prepare_single_write, which padded out most of a page to ensure
that the bl started with 0 alignment. Passing -1 will ensure that
we don't prepad these small segments.
Signed-off-by: Samuel Just <sam.just@inktank.com>
Precreates objects and does writes to random offsets within
random objects.
Includes rados, filestore, and vanilla fs variants
Signed-off-by: Samuel Just <sam.just@inktank.com>
Start the accepter thread when the first dispatcher is ready. This ensures
that there will be someone around to verify authorizers for incoming
connections, and means we have a bit less failure noise on the monitors
as a result.
Signed-off-by: Sage Weil <sage@inktank.com>
Prod the kernel to refresh the partition table after we create one. The
partprobe program is packaged with parted, which we already use, so this
introduces no new dependency.
Signed-off-by: Sage Weil <sage@inktank.com>
If the disk has no valid label we get an error like
Error: /dev/sdi: unrecognised disk label
Assume any error we get is that and go with an id label of 1.
Signed-off-by: Sage Weil <sage@inktank.com>
The kernel client expects seq #'s to start at 1 or else it is unhappy.
So, only randomize these values if the MSG_AUTH feature is present--that is
the only time it matters anyway.
Signed-off-by: Sage Weil <sage@inktank.com>
Switch size_t in clip_io to uint64_t; it's just easier, and the
alternative would be to limit 32-bit builds to sizes <= 4GB
Signed-off-by: Dan Mick <dan.mick@inktank.com>
Reviewed-by: Josh Durgin <josh.durgin@inktank.com>
Way back in fc869dee1e (v0.42) when we redid
the osd type encoding we forgot to make this conditionally encode the old
format for old clients. In particular, this means that kernel clients
will fail to decode the osdmap if there is a rados pool with a pool-level
snapshot defined.
Fixes: #3290
Signed-off-by: Sage Weil <sage@inktank.com>
Peforming a hard link through the libcephfs interface causes
a double free on shutdown, due to the Client::link call decrementing
the parent (of the target) directory's inode. This fix removes the
put_inode(dir) call, to match the behavior of Client::ll_link.
Signed-off-by: Sam Lang <sam.lang@inktank.com>
Reviewed-by: Sage Weil <sage@inktank.com>
This is unused, and mostly broken in that there is no cleanup when there
is a failure. Also, the support in the OSD has been largely removed.
Signed-off-by: Sage Weil <sage@inktank.com>
Rename check_io to clip_io, which can modify the passed-in length
to clamp it to the device size. This is expected behavior for
block-device emulation.
Call clip_io in rbd_write(); need to return clipped length there,
even though aio_write() is calling clip_io() as well (for the
direct path).
Signed-off-by: Dan Mick <dan.mick@inktank.com>
Reviewed-by: Josh Durgin <josh.durgin@inktank.com>
When checking if inode's SnapRealm is different from readdir
SnapRealm, we should use find_snaprealm() to get inode's SnapRealm.
Without this fix, I got lots of "ceph_add_cap: couldn't find snap
realm 100" from kernel client.
Signed-off-by: Yan, Zheng <zheng.z.yan@intel.com>
Allow try_eval(MDSCacheObject*, int mask) to eval locks on replica objects
so that they don't get stuck in an unstable state. The eval(CInode*, mask)
handles the non-auth already. For the dentry case, call eval_any(), which
handles the non-auth case, instead of directly calling simple_eval(), which
does not.
Reported-by: Yan, Zheng <zheng.z.yan@intel.com>
Signed-off-by: Sage Weil <sage@inktank.com>
Commit f8110c (Allow export subtrees in other MDS' stray directory)
make the "directory in stray " check always return false. This is
because the directory in question is grandchild of mdsdir.
Signed-off-by: Yan, Zheng <zheng.z.yan@intel.com>
The stray migration/reintegration generates a source path that will
be rooted in a (possibly remote) MDS's MDSDIR; adjust the check in
handle_client_rename()
Signed-off-by: Yan, Zheng <zheng.z.yan@intel.com>