CID 717359 (#1 of 1): Uninitialized scalar field (UNINIT_CTOR)
uninit_member: Non-static class member "bucket_exists" is not
initialized in this constructor nor in any functions that it calls.
Set bucket_exists to false in req_state::req_state().
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
CID 1160848 (#1 of 1): Uninitialized scalar variable (UNINIT)
uninit_use: Using uninitialized value "best".
Init 'best' with -1 (from the code logic it will be set at least to 0)
to silence coverity.
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
Fix type handling in dump_stuck_pg_stats. If type is type doesn't
match to known PGMap::STUCK_* type print out a message and return
directly from function.
CID 1030132 (#2 of 2): Uninitialized scalar variable (UNINIT)
uninit_use_in_call: Using uninitialized value "stuck_type" when calling
"PGMap::dump_stuck(ceph::Formatter *, PGMap::StuckPG, utime_t) const"
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
CID 716921 (#1 of 1): Dereference after null check (FORWARD_NULL)
var_deref_model: Passing null pointer "dir" to function
"operator <<(std::ostream &, CDir &)", which dereferences it.
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
CID 716990 (#1 of 1): Dereference null return value (NULL_RETURNS)
dereference: Dereferencing a pointer that might be null "cur" when calling
"MDCache::replicate_inode(CInode *, int, ceph::bufferlist &)"
Add assert to check for return value from get_inode() as done in other places.
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
CID 1135931 (#1 of 1): Resource leak (RESOURCE_LEAK)
leaked_storage: Variable "ondisk" going out of scope leaks the storage it
points to.
CID 1135932 (#1 of 1): Resource leak (RESOURCE_LEAK)
leaked_storage: Variable "onreadable" going out of scope leaks the storage
it points to.
CID 1135933 (#1 of 1): Resource leak (RESOURCE_LEAK)
leaked_storage: Variable "onreadable_sync" going out of scope leaks the
storage it points to.
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
CID 1188154 (#2 of 2): Resource leak (RESOURCE_LEAK)
overwrite_var: Overwriting "op" in "op = rados_create_read_op()" leaks
the storage that "op" points to.
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
CID 1160833 (#3 of 3): Resource leak (RESOURCE_LEAK)
leaked_storage: Variable "ioctx" going out of scope leaks the storage
it points to
CID 1160835 (#3 of 3): Resource leak (RESOURCE_LEAK)
leaked_storage: Variable "ioctx" going out of scope leaks the storage
it points to.
CID 1188156 (#5 of 5): Resource leak (RESOURCE_LEAK)
leaked_storage: Variable "ioctx" going out of scope leaks the storage
it points to.
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
CID 1188126 (#1 of 1): Unchecked return value (CHECKED_RETURN)
2. check_return: Calling function "ObjectStore::stat(coll_t,
ghobject_t const &, stat *, bool)" without checking return value
(as is done elsewhere 8 out of 9 times).
3. unchecked_value: No check of the return value of "this->store->stat(
coll_t(this->cid), hoid, &buf, false)".
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
CID 1188131 (#1 of 1): Division or modulo by zero (DIVIDE_BY_ZERO)
divide_by_zero: In expression "lower_sum * 1000000UL / total", division
by expression "total" which may be zero has undefined behavior
Added check for non zero total.
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
CID 1188145 (#1 of 1): Resource leak (RESOURCE_LEAK)
leaked_storage: Variable "cb" going out of scope leaks the storage it points to.
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
OSD recomputes op target based on current OSDMap. With an EC pg, we can get
this result:
1) client at map 512 sends an op to osd 3, pg_t 3.9 based on mapping
[CRUSH_ITEM_NONE, 2, 3]/3
2) OSD 3 at map 513 remaps op to osd 3, spg_t 3.9s0 based on mapping [3, 2, 3]/3
3) PG 3.9s0 dequeues the op at epoch 512 and notices that it isn't
primary -- misdirected op
4) client resends and this time PG 3.9s0 having caught up to 513 gets it and
fulfils it
We can't compute the op target based on the sending map epoch due to
splitting. The simplest thing is to detect such cases in
OSD::handle_misdirected_op and drop them without an error (the client
will resend anyway).
Signed-off-by: Samuel Just <sam.just@inktank.com>
Move agent_clear() from only being done when becoming replica
Do it in clear_primary_state() whenever we stop being primary
clear_primary_state() passed whether we are staying a primary
Add asserts in agent_stop() and don't need to clear agent_queue
Fixes: #7458
Signed-off-by: David Zafman <david.zafman@inktank.com>
python-ceph does not require requests, but ceph-common does (for ceph-brag).
Signed-off-by: Dan Mick <dan.mick@inktank.com>
(cherry picked from commit 9a0ef6a181)
We can't set a shared_ptr to NULL, we need to reset it instead. Add
another test for various permutations of this.
Fixes: #7538
Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
check if the inode is anchored/unanchored before updating the inode
Fixes: #7530
Signed-off-by: Yan, Zheng <zheng.z.yan@intel.com>
Reviewed-by: Greg Farnum <greg@inktank.com>
be2748c6d5 ensured that
if the temp acting mapping contains only CRUSH_ITEM_NONE,
that the acting_primary is left at -1. However, even if
acting.empty(), we need to respect a temp_primary mapping.
Thus, use _acting_primary unless acting.empty() &&
acting_primary == -1.
Bug introduced in be2748c6d5.
Signed-off-by: Samuel Just <sam.just@inktank.com>
Since backfill peers are no longer placed into the acting set,
temp mappings will never exceed the pool size. Also, for ec
pools, temp mappings will never be less than the pool size.
Signed-off-by: Samuel Just <sam.just@inktank.com>
test/objectstore/store_test.cc: In member function ‘void SyntheticWorkloadState::read()’:
error: test/objectstore/store_test.cc:462:23: no matching function for call to ‘swap(uint64_t&, size_t&)’
Signed-off-by: Sage Weil <sage@inktank.com>
If we are encoding a full map based on an old Incremental that does not
encode the features, fall back to the quorum features or (barring that)
all features. Do *not* do no features or else we will end up with
encode_client_old which does not even include the extended info and will
cause the mon to crash when decoding.
This was observed when upgading a 0.76 cluster to 0.77 (all mons stopped,
upgraded, and then started)
Reported-by: Aaron Ten Clay <aarontc@aarontc.com>
Signed-off-by: Sage Weil <sage@inktank.com>
The insert() call here does not overwrite a previous entry, which means
that the osd_epochs map is never moving forward in time. This seems to
have been broken since it was introduced in 091809b814.
Backport: emperor, dumpling
Signed-off-by: Sage Weil <sage@inktank.com>
There are two paths that jump to the out label for which 'in' can be
NULL and outp can be non-NULL. For those cases we want to fill in the
caller's pointer value (they asked for it) but we clearly cannot take
a reference.
Backport: emperor, dumpling
Signed-off-by: Sage Weil <sage@inktank.com>
The FileStore's leveldb currently uses libleveldb's defaults for cache and
write buffer size, which are both 4 MB. Increase the cache size to 128MB and
the write buffer to 8MB.
Tested-by: Dmitry Smirnov <onlyjob@member.fsf.org>
Signed-off-by: Sage Weil <sage@inktank.com>