Commit Graph

91710 Commits

Author SHA1 Message Date
Kefu Chai
b0c8102cfb
Merge pull request #24691 from iridescent-rsy/fix_typo
common: fix typos in BackoffThrottle

Reviewed-by: Kefu Chai <kchai@redhat.com>
2018-10-23 10:56:13 +08:00
Sage Weil
a0b5445bc8 Merge PR #24697 into nautilus
* refs/pull/24697/head:
	ceph_test_msgr: fix authorizer behavior

Reviewed-by: Gregory Farnum <gfarnum@redhat.com>
2018-10-22 20:45:40 -05:00
Brad Hubbard
a20ba3dcf7
Merge pull request #24652 from badone/wip-undefined-gperftool-symbols-2
rpm: Use updated gperftools-libs at runtime

Reviewed-by: Kefu Chai <kchai@redhat.com>
Reviewed-by: Tim Serong <tserong@suse.com>
2018-10-23 09:37:35 +10:00
Gregory Farnum
3e22376353
Merge branch 'master' into bug_fix_1 2018-10-22 16:11:48 -07:00
Jason Dillaman
b765a86345 include/types: fixed compile warning for signed/unsigned comparison
Signed-off-by: Jason Dillaman <dillaman@redhat.com>
2018-10-22 15:50:45 -04:00
Jason Dillaman
d0a7423f1a osd/PrimaryLogPG: uncommitted dup ops should respond with logged return code
Fixes: http://tracker.ceph.com/issues/36408
Signed-off-by: Jason Dillaman <dillaman@redhat.com>
2018-10-22 15:50:45 -04:00
Jason Dillaman
bd6b20cd26 osd/PrimaryLogPG: propagate error return codes on object copy_get ops
Signed-off-by: Jason Dillaman <dillaman@redhat.com>
2018-10-22 15:50:45 -04:00
Jason Dillaman
3b66716a4b osd/PGLog: optionally record error return codes for extra_reqids
When a cache tier promotes an object with one or more error PG log
entries, these errors need to be propagated and recorded for dup
op detection.

Signed-off-by: Jason Dillaman <dillaman@redhat.com>
2018-10-22 15:50:45 -04:00
Jason Dillaman
a4e40331d5 osd/osd_types: include PG log return codes in object copy data
If the base tier records an error against an operation, the cache
tier currently might incorrectly respond with a success return code.

Signed-off-by: Jason Dillaman <dillaman@redhat.com>
2018-10-22 15:50:45 -04:00
Sage Weil
020bd7b5f3 os/bluestore: fix race between SharedBlobSet::lookup and SharedBlob::put
A                             B
SharedBlobSet::lookup()
  takes lock
  nref is not 0
                              SharedBlob::put()
                                --nref
returns SharedBlobRef,
  ++nref
                                takes cache lock
                                SharedBlobSet::remove
                                  takes lock
                                  removes
                                deletes SharedBlob

-> A ends up with a ref to deleted SharedBlob

Fix by verifying that nref is still zero in SharedBlobSet::remove(),
while we are holding the SharedBlobSet::lock.  The lock ensures that we
have increased the ref for the lookup before entering remove, so we can
verify that nref is still zero before removing it.  If not, we have
raced, and put() bails out and does nothing.

Fixes: http://tracker.ceph.com/issues/36526
Signed-off-by: Sage Weil <sage@redhat.com>
2018-10-22 14:45:37 -05:00
Casey Bodley
e515d92067 rgw: aws:SecureTransport uses rgw_transport_is_secure()
Signed-off-by: Casey Bodley <cbodley@redhat.com>
2018-10-22 14:56:22 -04:00
Casey Bodley
8f9464310b rgw: SSE operations check rgw_transport_is_secure()
Fixes: http://tracker.ceph.com/issues/27221

Signed-off-by: Casey Bodley <cbodley@redhat.com>
2018-10-22 14:56:22 -04:00
Casey Bodley
73d355fc51 rgw: add helper function rgw_transport_is_secure()
Signed-off-by: Casey Bodley <cbodley@redhat.com>
2018-10-22 14:56:22 -04:00
Casey Bodley
d3dd5a996d common: add config option rgw_trust_forwarded_https
Signed-off-by: Casey Bodley <cbodley@redhat.com>
2018-10-22 14:56:22 -04:00
Ilya Dryomov
cefbc82e36 test/log: drop redundant test case
After the recent logging rework, ManyGatherLog and
ManyGatherLogStringAssign are identical barring the string.

Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
2018-10-22 20:09:24 +02:00
Ilya Dryomov
5f25c0ab30 common/StackStringStream: don't reserve before every insert
Unlike ConcreteEntry, MutableEntry can be appended to.  Reserving the
exact number of elements before every append is harmful: vector will
likely reallocate each time and grow linearly instead of geometrically.
This results in quadratic behaviour when we spill past the preallocated
capacity and doesn't benefit the fast path in any way.

The new test case takes half a second with this patch and many hours
spinning in memmove without this patch.

Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
2018-10-22 20:09:10 +02:00
alfonsomthd
85570639cb mgr/dashboard: Add TSLint rule
- TSlint no-unused-variable rule added.
- Cleanup: unused imports and variables.

Signed-off-by: Alfonso Martínez <almartin@redhat.com>
2018-10-22 19:38:38 +02:00
Lenz Grimmer
9d79acdaac
Merge pull request #24591 from tspmelo/wip-testing-module
mgr/dashboard: Unit Tests cleanup

Reviewed-by: Ricardo Marques <rimarques@suse.com>
Reviewed-by: Stephan Müller <smueller@suse.com>
2018-10-22 19:33:53 +02:00
Sage Weil
1a01cf4872 ceph_test_msgr: fix authorizer behavior
Fixes breakage from this PR 2152d8ffb7.

Fixes: http://tracker.ceph.com/issues/36495
Signed-off-by: Sage Weil <sage@redhat.com>
2018-10-22 10:06:06 -05:00
Kefu Chai
3d0d24a228 include/ceph_assert.h: do not pack assert params if WITH_ASAN
we pack the asset() params for smaller code size, but this creates a
inlined `assert_data_ctx` instance for every compilation unit which
call ceph_assert() defined in .h .

__PRETTY_FUNCTION__ is likely to be referenced by `assert_data_ctx`
sections which are included by different compiled object files. if the
ceph_assert() call is used by header file, then there will be multiple
`assert_data_ctx` sections sharing the same identifier. these sections are
defined as "COMDAT" group sections, i.e. common data sections. when linker
see multiple COMDAT sections with the same identifer, it will simply discard
the duplicated ones, and only keep a single copy of them. without enabling
ASan, GCC can always handle this problem just fine. but the dedup feature
does not work well with ASan. if ASan is enabled, and we link the objects
with the wrong order, some references will be pointing to the discarded
sections.

to address this issue, we could audit the link command line and inspect
all .o files to make sure they are properly ordered. but this is
non-trivial. as a workaround, in this change, the assert params are not
packed, and sent to the  __ceph_assert_fail() overrides which accepts
unpacked params directly, so the COMDAT section is not created.

Signed-off-by: Kefu Chai <kchai@redhat.com>
2018-10-22 23:01:36 +08:00
Jason Dillaman
5d56014c61 qa/tasks/qemu: use unique clone directory to avoid race with workunit
If there is a workunit task associated with the same client, the two
tasks will attempt to clone the suite repo to the same directory.
Worse, if it's parallel tasks, the two clones will clobber each
other.

Fixes: http://tracker.ceph.com/issues/36542
Signed-off-by: Jason Dillaman <dillaman@redhat.com>
2018-10-22 10:44:40 -04:00
Josh Durgin
36ca230776
Merge pull request #24667 from liewegas/wip-ec-thrash-full
qa/suites/rados/thrash-erasure-code*/thrashers/*: less likely resv rejection injection

Reviewed-by: Josh Durgin <jdurgin@redhat.com>
2018-10-22 07:39:26 -07:00
Kefu Chai
4af71e7c00
Merge pull request #23103 from ifed01/wip-ifed-bluefs-migrate
os/bluestore: allow ceph-bluestore-tool to coalesce, add and migrate BlueFS backing volumes

Reviewed-by:  Sage Weil <sage@redhat.com>
2018-10-22 22:33:08 +08:00
Kefu Chai
09c31bbea3
Merge pull request #23090 from mingshuaiwang/master
OSD: ceph-osd parent process need to restart log service after fork

Reviewed-by: Neha Ojha <nojha@redhat.com>
2018-10-22 22:30:41 +08:00
Sage Weil
883fc4d122 Merge PR #24689 into nautilus
* refs/pull/24689/head:
	qa/tasks/ceph_manager: fix get_stuck_pgs from pg dump change

Reviewed-by: Kefu Chai <kchai@redhat.com>
2018-10-22 09:20:50 -05:00
Sage Weil
ae583f5dde Merge PR #24689 into master
* refs/pull/24689/head:
	qa/tasks/ceph_manager: fix get_stuck_pgs from pg dump change
	Merge PR #24625 into nautilus
	qa/suites/rados/mgr/tasks/module_selftest: whitelist 'foo bar security'

Reviewed-by: Kefu Chai <kchai@redhat.com>
2018-10-22 09:19:46 -05:00
Sage Weil
90c3c2032c os/bluestore: show compress and buffered from WriteContext
Signed-off-by: Sage Weil <sage@redhat.com>
2018-10-22 08:29:27 -05:00
Sage Weil
6e14a50e20 os/bluestore: fix rename race with trim on replacement onode at old name
- rename from foo to bar
 - foo onode is moved to bar in onode_map
 - keys removed at position foo as part of txc
 - new onode for foo is installed at foo in map
...
- cache trims foo
...
- new txn B does get_onode on foo, reads old foo (now bar) onode into foo ***
- txn A commits
-> onode cache has foo with stale bar content

Fix by holding a ref to the replacement foo onode so that get_onode cannot
read stale metadata out of kvdb before txn A commits.

Fixes: http://tracker.ceph.com/issues/36541
Signed-off-by: Sage Weil <sage@redhat.com>
2018-10-22 08:29:26 -05:00
Ricardo Marques
48eb0a336b mgr/dashboard: Fix RBD actions disable
Fixes: https://tracker.ceph.com/issues/36403

Signed-off-by: Ricardo Marques <rimarques@suse.com>
2018-10-22 14:02:37 +01:00
Volker Theile
7a44726645 mgr/dashboard: Confirmation modal doesn't close
Fixes: https://tracker.ceph.com/issues/24729

Signed-off-by: Volker Theile <vtheile@suse.com>
2018-10-22 13:29:38 +02:00
Tiago Melo
f775e9844c mgr/dashboard: Fix problem with ErasureCodeProfileService
ErasureCodeProfileService was being provided twice and that was causing
problems in production mode.

Fixes: https://tracker.ceph.com/issues/36544

Signed-off-by: Tiago Melo <tmelo@suse.com>
2018-10-22 11:57:01 +01:00
Erwan Velu
ef0ceef7c7 ceph_volume: Checking device validity at init time
When initializing the Device structure, it have to run is_valid() to
ensure the data structures (_is_valid & rejected_reasons) to be
populated accordingly to the device state.

Signed-off-by: Erwan Velu <erwan@redhat.com>
2018-10-22 11:56:19 +02:00
Erwan Velu
d5de9583ee ceph_volume: Rejecting locked devices
If we cannot open a block device in O_RDWR in exclusive mode, it means
someone is actually using it like a raw database or similar.

In that case, the device should be considered as unusable as OSDs will
not be in a position to use it.

Signed-off-by: Erwan Velu <erwan@redhat.com>
2018-10-22 11:56:19 +02:00
Erwan Velu
e0ea3d475a ceph_volume: Reporting nr_requests
We are already reporting the rotational & scheduler of a disk device.
Reporting the nr_requests could be useful to get how many concurrent IOs
the device supports/reports.

That could help detecting badly detected/configured devices.

Signed-off-by: Erwan Velu <erwan@redhat.com>
2018-10-22 11:56:19 +02:00
Erwan Velu
5972079407 ceph_volume: Reporting firmware revision
We are already reporting model & vendor of a given disk, let's also
report the revision of the firmware. That is useful to filter-out some
known broken revisions.

Signed-off-by: Erwan Velu <erwan@redhat.com>
2018-10-22 11:56:19 +02:00
Erwan Velu
f1a9435006 ceph_volume: Rejecting Read-only devices
If a devices is said to be read-only, there is no chance we can actually
use it. So let's report it as unusable.

Signed-off-by: Erwan Velu <erwan@redhat.com>
2018-10-22 11:56:19 +02:00
Erwan Velu
d8fdf0b753 ceph_volume: Adding Device.is_valid()
A block device can be filtered-out/ignored because it have features that
doesn't match Ceph's expectations.

As of today, the current code was rejected removable devices but it was
pretty hidden from the user, and implicit in the get_devices() function.

This patch is creating a new is_valid() function to perform all the
rejection tests and returns if this device can be used in the Ceph
context or not.

If is_valid() is returning False, the 'rejected_reasons' list reports all
the reasons why that devices got rejected.

Signed-off-by: Erwan Velu <erwan@redhat.com>
2018-10-22 11:56:14 +02:00
Kefu Chai
399923c71a
Merge pull request #20004 from mogeb/steady-clock-tools-rados
librados: use steady clock for rados_mon_op_timeout

Reviewed-by: Kefu Chai <kchai@redhat.com>
2018-10-22 17:46:44 +08:00
Kefu Chai
298da11351
Merge pull request #24658 from tchaikov/wip-18202-rebased
blkdev: Rework API and add FreeBSD support

Reviewed-by: Willem Jan Withagen <wjw@digiware.nl>
2018-10-22 17:44:07 +08:00
Kefu Chai
5e12cef930 include/ceph_assert: always use __PRETTY_FUNCTION__ for C++
we've moved to GCC-7, no need to check for ancient compiler versions

Signed-off-by: Kefu Chai <kchai@redhat.com>
2018-10-22 16:53:05 +08:00
Kefu Chai
fd58e5d4ad cmake,ceph.in: preload libasan if WITH_ASAN
we need to preload libasan.so as the python exectuable is not likely to
be compiled with ASan enabled.
see:
https://github.com/google/sanitizers/wiki/AddressSanitizerAsDso#asan-and-ld_preload

just to ease the use of ASan, for fine-tuned behaviour, use
`ASAN_OPTIONS`.

Signed-off-by: Kefu Chai <kchai@redhat.com>
2018-10-22 14:40:03 +08:00
Kefu Chai
e851462977 ceph.in: extract get_cmake_variables()
so it can be reused

Signed-off-by: Kefu Chai <kchai@redhat.com>
2018-10-22 14:40:03 +08:00
Kefu Chai
669853e018 cmake: should compile libzstd with -fPIC
otherwise we will have

/usr/bin/ld: libzstd/lib/libzstd.a(error_private.c.o): relocation
R_X86_64_32S against `.rodata' can not be used when making a shared
object; recompile with -fPIC

Signed-off-by: Kefu Chai <kchai@redhat.com>
2018-10-22 14:40:03 +08:00
Kefu Chai
b605210b97 cmake: pass Sanitizers flags to linker for linking .so
see
https://github.com/google/sanitizers/wiki/AddressSanitizer#using-addresssanitizer

to be specific,

> In order to use AddressSanitizer you will need to compile and link your
> program using `clang` with the `-fsanitize=address` switch.

Signed-off-by: Kefu Chai <kchai@redhat.com>
2018-10-22 14:40:03 +08:00
Kefu Chai
38e7686a37 cmake: pass cflags to disutils using CC instead of CFLAGS
in python's distutils.ccompiler, linker_exe is composed using CC instead
of LDFLAGS. the latter only effects how it builds (shared) library.

and put CMAKE_C_FLAGS into the cflags for the compiler for building
python C extensions, it's more consistent this way. more importantly,
if we build with ASan enabled, the canary program, a.k.a. rados_dummy.c,
won't link without proper CFLAGS.

without this change, rados.so fails to build with errors like:

/usr/bin/ld: /var/ssd/ceph/build/lib/librados.so: undefined reference to
`__asan_stack_free_10'
/usr/bin/ld: /var/ssd/ceph/build/lib/librados.so: undefined reference to
`__asan_report_exp_store8'
...
...

clang: error: linker command failed with exit code 1 (use -v to see
invocation)

Link Error: RADOS library not found
make[3]: ***
[src/pybind/rados/CMakeFiles/cython_rados.dir/build.make:57:
src/pybind/rados/CMakeFiles/cython_rados] Error 1

Signed-off-by: Kefu Chai <kchai@redhat.com>
2018-10-22 14:40:03 +08:00
Kefu Chai
3ac8c8dca7 common/TextTable: define endrow
otherwise "cmake -DWITH_ASAN=ON -DCMAKE_BUILD_TYPE=Debug" will fail to
build with

/usr/bin/ld: //var/ssd/ceph/build/lib/libceph-common.so.0: undefined
reference to `TextTable::endrow'

Signed-off-by: Kefu Chai <kchai@redhat.com>
2018-10-22 14:40:03 +08:00
Shiyang Ruan
99ce7cf48b common: fix typos in BackoffThrottle
Signed-off-by: Shiyang Ruan <ruansy.fnst@cn.fujitsu.com>
2018-10-22 13:09:20 +08:00
Yan, Zheng
19d2cecd97 PendingReleaseNotes: note about cephfs client state reclaim
Fixes: http://tracker.ceph.com/issues/36394
Signed-off-by: "Yan, Zheng" <zyan@redhat.com>
2018-10-22 11:57:08 +08:00
Sage Weil
b678356594 qa/tasks/ceph_manager: fix get_stuck_pgs from pg dump change
Fixes 95b7d2340c

Fixes: http://tracker.ceph.com/issues/36485
Signed-off-by: Sage Weil <sage@redhat.com>
2018-10-21 10:52:38 -05:00
myoungwon oh
10993596d9 src/test: fix unordered manifest-unset op
- manifest unset op to foo-chunk object
 - remove manifest flag
 - commit
 - send an ack to a client
 - send decrement mesages ("chunk_put") to old chunks (bar-chunk)

Current unit test(ManifestUnset) send "chunk_read" command (to bar-chunk)
in order to see whether chunk's reference count is decreased.
But, as described above, "chunk_read" event can be triggered after a client
(test application) receives an ack. Therefore, there is a corner case
such as bar-chunk (in chunk pool) receives "chunk_read" first instead of "chunk_put"

Reference count model of dedup/tiering is based on false-positive (#24230).
So decreasing reference count is not guaranteed. If reference mismatch occur,
chunk-scrub (this is WIP) will fix it.
One guaranteed thing is that existing manifest flag is removed.

So, the solution of this commit is just re-send unset op, and then
chenk that return value is -EOPNOTSUPP (this means manifest flags is removed).

Fixes: http://tracker.ceph.com/issues/24485
Signed-off-by: Myoungwon Oh <omwmw@sk.com>
2018-10-21 18:05:40 +09:00