David Zafman [Thu, 21 Nov 2013 23:21:53 +0000 (15:21 -0800)]
osd: Interim backfill changes
Make peer_backfill_info a map which holds a
BackfillInterval for all backfill targets.
Initially see if recover_backfill() can just backfill
the first one and mark them all finished.
Signed-off-by: David Zafman <david.zafman@inktank.com>
David Zafman [Wed, 11 Dec 2013 01:29:48 +0000 (17:29 -0800)]
osd: Fix problems in ReplicatedPG::do_op() logic
Fix assert(is_degraded_object(soid)) in ReplicatedPG::wait_for_degraded_object()
Use last_backfill_started as the backfill line
Handle uncommon case of multi op source after backfill line and target before
backfill line and !is_degraded_object().
Include backfill line itself for before_backfill (<= instead of <)
Signed-off-by: David Zafman <david.zafman@inktank.com>
David Zafman [Thu, 19 Dec 2013 18:35:39 +0000 (10:35 -0800)]
osd: Remove redundant incompat feature
We can remove this CompatSet bit without worry because the only
way it could have been set is if an erasure coded pool was create.
This isn't supported as of yet.
Signed-off-by: David Zafman <david.zafman@inktank.com>
Loic Dachary [Wed, 1 Jan 2014 20:23:18 +0000 (21:23 +0100)]
common: CEPH_ARGS should trim whitespaces
CEPH_ARGS when parsed by env_to_vec did not trim trailing and leading
whitespaces: they would unexpectedly be parsed as empty arguments and
lead to confusing errors such as :
The parsing code is replaced with str_vec(). It also resolves the
problem of the hard limit to 1000 characters imposed by the static
buffer that would silently truncate any CEPH_ARGS content.
Loic Dachary [Mon, 30 Dec 2013 11:26:20 +0000 (12:26 +0100)]
ceph-disk: prepare --data-dir must not override files
ceph-disk does nothing when given a device that is already prepared. If
given a directory that already contains a successfully prepared OSD, it
will however override it.
Instead of overriding the files in the osd data directory, return
immediately if the magic file exists. Make it so the magic file is
created last to accurately reflect the success of the OSD preparation.
Loic Dachary [Sun, 29 Dec 2013 11:40:05 +0000 (12:40 +0100)]
mon: do not use the keyring if auth = none
The Monitor::is_keyring_required() predicate is defined to be used in
the mkfs code path and not require the keyring to be set unless it is
actually going to be used.
If authentication is turned on later on existing monitors, the keyring
files will have to be set by an external tool in the mon data directory
and the mon restarted.
Loic Dachary [Sun, 29 Dec 2013 12:14:14 +0000 (13:14 +0100)]
mon: make ceph-mon --mkfs idempotent
A mon is considered to exist if the mon-data directory exists and is not
empty. If ceph-mon --mkfs is run twice, it will display succeed the
second time around and display an informative message.
Noah Watkins [Mon, 30 Dec 2013 20:56:32 +0000 (12:56 -0800)]
make: conditionally build filestore backends
Each of btrfs and zfs backends are wrapped in if __linux__ and if
WITH_ZFS, respectively, resulting in empty object files and the
associated warnings. This builds them under the same conditions.
According to this https://code.google.com/p/googletest/source/detail?r=446
the use of unnamed types (in this case the protection flag enums from
librbd/parent_types.h) as template parameters (in this case the gtest
macros) is not valid C++ pre C++0x.
As suggested, converting the enum into an int with integral promotion
via unary plus operator solves the problem.
Noah Watkins [Mon, 30 Dec 2013 20:14:02 +0000 (12:14 -0800)]
make: avoid symbol exporting for C++ libs on non-Linux
This removes export-symbol-regex for installed libraries with C++
interfaces on non-Linux where the hidden symbols are not resolved. This
is a temporary fix.
See ceph-devel topic "Shared library symbol visibility" for discussion
about a perm solution.
Noah Watkins [Mon, 30 Dec 2013 20:10:53 +0000 (12:10 -0800)]
make: add top-level libcommon dependency
On OSX there is consistently a problem with resolving pipe_cloexec and other
symbols through indirect libtool dependencies (below libglobal has a dependency
on libcommon). This makes the dependency top-level for most executables.
CXXLD ceph_test_timers
Undefined symbols for architecture x86_64:
"_pipe_cloexec", referenced from:
AdminSocket::create_shutdown_pipe(int*, int*) in libglobal.a(admin_socket.o)
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Rutger ter Borg [Wed, 27 Nov 2013 08:49:00 +0000 (00:49 -0800)]
librados: read into user's bufferlist for aio_read
* The 'buf' argument to read() used to be passed into
AioCompletionImpl, and the results would be copied back after
reading. This is replaced with the creation of a static buffer of
that buf.
* The pbl argument in AioCompletionImpl is removed.
The patch is tested against an application using librados. I've
assumed that 'pbl' in
aio_read( ...., pbl, )
is allocated by the user. It may even speed things up: a buffer copy
is prevented.
Loic Dachary [Mon, 30 Dec 2013 09:30:51 +0000 (10:30 +0100)]
common: evaluate --show-config* after CEPH_ARGS
The content of CEPH_ARGS is appended to the list of arguments. When
--show-config or --show-config-value is also set, it should be evaluated
after all arguments are parsed to accurately reflect the value that
would be visible to the program.
It failed to do so because the action for --show-config* was carried out
immediately. It is postponed until all options are parsed instead.
Loic Dachary [Mon, 30 Dec 2013 09:09:41 +0000 (10:09 +0100)]
vstart: set fsid in [global]
If not set, commands that rely on --show-config-value fsid or something
equivalent will fail. ceph-disk does, for instance and setting the fsid
in CEPH_ARGS won't help because it will be appended after
--show-config-value :
Noah Watkins [Sun, 29 Dec 2013 18:01:38 +0000 (10:01 -0800)]
gtest: disable tr1/tuple
Not all compilers are supporting tr1/tuple. This forces libgtest to use
an internal implementation of tuple. Alternatively, the newer 1.6
version of gtest may correctly handle this case automatically.
Noah Watkins [Sun, 29 Dec 2013 18:32:22 +0000 (10:32 -0800)]
c++11: fix std::lock naming conflicts
Unfortunately, 'using namespace std;' is in pretty widespread use in the Ceph
tree, so we need to rename to avoid the conflict.
Example error output:
test/streamtest.cc:37:19: error: reference to 'lock' is ambiguous
Mutex::Locker l(lock);
^
test/streamtest.cc:32:7: note: candidate found by name lookup is 'lock'
Mutex lock("streamtest.cc lock");
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/c++/v1/mutex:346:1: note: candidate found by name lookup is 'std::__1::lock'
lock(_L0& __l0, _L1& __l1)
Noah Watkins [Sun, 29 Dec 2013 21:10:02 +0000 (13:10 -0800)]
kvstore: only build on linux
There are several non-standard errno values used. There is still work to
do on addressing errno portability in Ceph, and this disables kvstore on
non-Linux platforms until that work is complete.
Adds a ceph_spinlock_t implementation that will use pthread_spinlock_t
if available, and otherwise reverts to pthread_mutex_t. Note that this
spinlock is not intended to be used in process-shared memory.
Switches implementation in:
ceph_context
SimpleMessenger
atomic_t
Only ceph_context initialized its spinlock with PTHREAD_PROCESS_SHARED.
However, there does not appear to be any instance in which CephContext
is allocated in shared memory, and thus can use the default private
memory space behavior.
Haomai Wang [Sat, 28 Dec 2013 09:57:43 +0000 (17:57 +0800)]
Fix rbd bench-write improper behavior
"rbd bench-write" eject all write operations with the same offset at the same
time. It will result in non-objective performance result from this command.
fix #7066
Co-Author: Rongze Zhu <rongze@unitedstack.com> Signed-off-by: Haomai Wang <haomaiwang@gmail.com>
Ilya Dryomov [Fri, 27 Dec 2013 17:40:59 +0000 (19:40 +0200)]
rbd: expose options available to rbd map
Add a -o / --options option, which would allow users to specify
rbd-specific and generic ceph client and osd options available at
mapping time in a comma separated list (similar to mount(8) mount
options).