Fixes: #5209
Backport: bobtail, cuttlefish
If the head object wrongfully contains data, but according to the
manifest we don't read from the head, we shouldn't copy the prefetched
data. Also fix the length calculation for that data.
Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
Reviewed-by: Greg Farnum <greg@inktank.com>
Fixes: #5204
When copying object we ended up also copying the original
object idtag which overrode the newly generated one. When
refcount put is called with the wrong idtag the count
does't go down.
Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
Reviewed-by: Greg Farnum <greg@inktank.com>
Put it on the heap so that we can destroy it before the g_ceph_context
cct that it references. This fixes a crash like
*** Caught signal (Segmentation fault) **
in thread 4034a80
ceph version 0.63-204-gcf9aa7a (cf9aa7a003)
1: ceph-mon() [0x59932a]
2: (()+0xfcb0) [0x4e41cb0]
3: (Mutex::Lock(bool)+0x1b) [0x6235bb]
4: (PerfCountersCollection::remove(PerfCounters*)+0x27) [0x6a0877]
5: (LevelDBStore::~LevelDBStore()+0x1b) [0x582b2b]
6: (LevelDBStore::~LevelDBStore()+0x9) [0x582da9]
7: (main()+0x1386) [0x48db16]
8: (__libc_start_main()+0xed) [0x658076d]
9: ceph-mon() [0x4909ad]
Signed-off-by: Sage Weil <sage@inktank.com>
When we trim items N to M, compact over range (N-1) to M so that the
items in the queue will share bounds and get merged. There is no harm in
compacting over a larger range here when the lower bound is a key that
doesn't exist anyway.
Signed-off-by: Sage Weil <sage@inktank.com>
If we get behind and multiple adjacent ranges end up in the queue, merge
them so that we fire off compaction on larger ranges.
Signed-off-by: Sage Weil <sage@inktank.com>
Switch to using regular pointers here. The lifecycle of these services is
very simple such that refcounting is overkill.
Signed-off-by: Sage Weil <sage@inktank.com>
When a monitor is freshly created and for some reason its initial sync is
aborted, it will end up with an incorrect backup monmap. This monmap is
incorrect in the sense that it will not contain the monitor's names as
it will expect on the next run.
This results from us being using the quorum features to encode the monmap
when backing it up, instead of CEPH_FEATURES_ALL.
Fixes: #5203
Signed-off-by: Joao Eduardo Luis <joao.luis@inktank.com>
If we use operator[] on a new int field its value is undefined; avoid
reading it or using |= et al until we initialize it.
Fixes: #4967
Backport: cuttlefish, bobtail
Signed-off-by: Sage Weil <sage@inktank.com>
Reviewed-by: David Zafman <david.zafman@inktank.com>
If we are in the SCAN state, stay there until the recovery finishes. Do
not jump to another state from file_eval().
Signed-off-by: Sage Weil <sage@inktank.com>
(cherry picked from commit 0071b8e75b)
For a list-snaps operation on the snapdir, do not assume that the obc for the
head means the object exists. This fixes a race between a head deletion and
a list-snaps that wrongly returns ENOENT, triggered by the DiffItersateStress
test when thrashing OSDs.
Fixes: #5183
Backport: cuttlefish
Signed-off-by: Sage Weil <sage@inktank.com>
Reviewed-by: Samuel Just <sam.just@inktank.com>
This will reduce the work that leveldb is asked to do by only triggering
compaction of the keys that were just trimmed.
We ma want to further reduce the work by compacting less frequently, but
this is at least a step in that direction.
Signed-off-by: Sage Weil <sage@inktank.com>
Allow a transaction to describe the compaction of a range of keys. Do this
in a backward compatible say, such that older code will interpret the
compaction of a prefix + range as compaction of the entire prefix. This
allows us to avoid introducing any new feature bits.
Signed-off-by: Sage Weil <sage@inktank.com>
We generally do not want to block while compacting a range of leveldb.
Push the blocking+waiting off to a separate thread. (leveldb will do what
it can to avoid blocking internally; no reason for us to wait explicitly.)
This addresses part of #5176.
Signed-off-by: Sage Weil <sage@inktank.com>
Fix a few bugs introduced by 27381c0c62:
- check against both front and back cons; either one may have failed.
- close *both* front and back before reopening either. this is
overkill, but slightly simpler code.
- fix leak of con when marking down
- handle race against osdmap update and note_down_osd
Fixes: #5172
Signed-off-by: Sage Weil <sage@inktank.com>
Otherwise, the links might be ordered after the in progress
operation tag write. We need the in progress operation tag to
correctly recover from an interrupted merge, split, or col_split.
Fixes: #5180
Backport: cuttlefish, bobtail
Signed-off-by: Samuel Just <sam.just@inktank.com>
Reviewed-by: Sage Weil <sage@inktank.com>
Call AioCompletion::release() if the completion is no longer needed.
CID 727978 (#1-2 of 2): Resource leak (RESOURCE_LEAK)
leaked_storage: Variable "obj_aioc" going out of scope leaks the
storage it points to.
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
Call AioCompletion::release() if the completion is no longer needed.
CID 727979 (#1-2 of 2): Resource leak (RESOURCE_LEAK)
leaked_storage: Variable "a" going out of scope leaks the storage
it points to.
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
Call AioCompletion::release() if the completion is no longer
needed.
CID 727980 (#1-4 of 4): Resource leak (RESOURCE_LEAK)
leaked_storage: Variable "aioc" going out of scope leaks
the storage it points to.
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
If ceph-mon segfault, socket file isn't removed.
By adding a remove in post-stop, upstart clean run directory properly.
Signed-off-by: Guilhem Lettron <guilhem@lettron.fr>