A broken client (e.g., v0.56) can send a request that ends up with an
rmw_flags of 0. Treat this as invalid and return EINVAL.
Fixes: #4556
Signed-off-by: Sage Weil <sage@inktank.com>
Remove redundant setting of dirty_info
Fix PG::upgrade() to conform to programming style
Set dirty_big_info in PG::write_info for upgrades
BUG: #4562
Signed-off-by: David Zafman <david.zafman@inktank.com>
Reviewed-by: Sam Just <sam.just@inktank.com>
If the mds is in clientreplay, a session close
request needs to be delayed until it reaches
active. Otherwise, the session state gets set to
'closing', and the replay requests get dropped on the
floor.
Fixes#4564.
Signed-off-by: Sam Lang <sam.lang@inktank.com>
If the mds is standby, when a segment is trimmed, we need
to clear the backtrace updates list to avoid the following
assertion when the segment is deleted.
./include/elist.h: 92: FAILED assert(_head.empty())
ceph version 0.59-478-g8befbca (8befbca77a)
(MDLog::standby_trim_segments()+0xce5) [0x6ccec5]
(MDS::C_MDS_StandbyReplayRestartFinish::finish(int)+0x39) [0x4e86b9]
(Journaler::_finish_reprobe(int, unsigned long, Context*)+0x190)
[0x6d3210]
(Filer::_probed(Filer::Probe*, object_t const&, unsigned long,
utime_t)+0x558) [0x704a88]
(Objecter::C_Stat::finish(int)+0xc0) [0x705900]
(Objecter::handle_osd_op_reply(MOSDOpReply*)+0xe38) [0x6f1df8]
(MDS::handle_core_message(Message*)+0xae8) [0x4dc318]
(MDS::_dispatch(Message*)+0x2f) [0x4dc4df]
(MDS::ms_dispatch(Message*)+0x1db) [0x4ddf7b]
(DispatchQueue::entry()+0x341) [0x81f561]
(DispatchQueue::DispatchThread::entry()+0xd) [0x79c6ad]
(()+0x7e9a) [0x7f346bb9ee9a]
(clone()+0x6d) [0x7f346a3574bd]
Fixes#4539.
Signed-off-by: Sam Lang <sam.lang@inktank.com>
Fix for: "The serializable class does not declare a static final
serialVersionUID field" warning.
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
Otherwise, we update the stat.stat structure, but not the
stat.invalid_stats part. This will result in a recently
split primary propogating the invalid stats but not the
invalid marker. Sending the whole pg_stat_t structure
also mirrors MOSDSubOp.
Fixes: #4557
Backport: bobtail
Signed-off-by: Samuel Just <sam.just@inktank.com>
Reviewed-by: Sage Weil <sage@inktank.com>
Remove now superfluous directory changes
that are causing tests to fail.
This code should have been removed when we transitioned
from running tests with Ant to using Java to run the tests.
Signed-off-by: Joe Buck <jbbuck@gmail.com>
Reviewed-by: Noah Watkins <noahwatkins@gmail.com>
The assertion failure reported in #4530 is triggered
by the following:
1. client sends request
2. mds sends unsafe reply
3. before request gets journaled, mds is killed
4. mds restarts
5. client receives session close (from close request before restart)
6. session close does kick_requests()
7. kick_requests tries to signal caller that doesn't exist.
This fix avoids signaling a caller if the unsafe reply
has been received and the make_request() function has completed.
We do this by setting the caller_cond to null once the caller
is woken up, and only signal the caller in kick_requests if
caller_cond is non-null. This avoids trying to resend requests
listed in mds_request but that have already received unsafe replies.
The unsafe requests are handled by resend_unsafe_requests() code,
so skipping those requests is allowable.
Fixes#4530.
Signed-off-by: Sam Lang <sam.lang@inktank.com>
Reviewed-by: Sage Weil <sage@inktank.com>
The long_name variable is not initialized. When the append_oname
function is called, it will strlen(long_name) and get a result
that depends on the stack content. The long_name is truncated to a
zero length string to prevent this unexpected behavior.
There is no sure way to trigger the problem by writing a unit
test. Unit tests are added for all public methods of the FlatIndex
class. Most of the time the tests fail if the long_name variable is
not properly initialized.
* uint32_t collection_version()
* coll_t coll() const
* void set_ref(std::tr1::shared_ptr<CollectionIndex> ref)
* int cleanup()
* int init()
* int created(const hobject_t &hoid, const char *path)
* int unlink(const hobject_t &hoid)
* int lookup(const hobject_t &hoid, IndexedPath *path, int *exist)
* int collection_list(vector<hobject_t> *ls)
* int collection_list_partial(const hobject_t &start, int min_count, int max_count, snapid_t seq, vector<hobject_t> *ls, hobject_t *next)
There are a number of border cases that cannot be tested, such as the
logic of the lfn_get static function. Since FlatIndex code is designed
to transition from older namespace conventions, it is difficult to
figure out.
The tests rely on xattr(2) and their availability is checked before
running them.
http://tracker.ceph.com/issues/4542 refs #4542
Signed-off-by: Loic Dachary <loic@dachary.org>
After changing the partition table, allow the udev event to be
processed before calling partprobe. This helps prevent partprobe
from getting a resource busy error on some platforms.
Signed-off-by: Gary Lowell <gary.lowell@inktank.com>
Always increment the iterator when adding old pools
to the backtrace. This fixes a bug on files where
the layout had been set to a different pool and then
back to the same pool, causing continuous looping in
the build_backtrace() function.
Fixes#4537.
Signed-off-by: Sam Lang <sam.lang@inktank.com>
Split up the conditionals handling unsafe reply
and signaling the caller to improve readability.
The overall behavior of the code remains the same.
Signed-off-by: Sam Lang <sam.lang@inktank.com>
If the mds sends a duplicate safe reply, the mds_requests
map won't contain a matching request id (tid). Instead of
assert failing, we log a message that we saw a reply without
a matching request.
Also remove redundant mds_requests->erase(tid) line.
Signed-off-by: Sam Lang <sam.lang@inktank.com>
The client MetaRequest should always be cleaned up
and removed from the mds_requests map once the client
gets a safe reply. This patch avoids a leak where the
mds does not send back an unsafe reply and the request
is never cleaned up.
Signed-off-by: Sam Lang <sam.lang@inktank.com>
Once a safe reply is received, we remove the
request from the mds_requests map, so checking that
it might be a duplicate won't succeed. This patch
removes the got_safe checks in the reply handling code
and the got_safe field on the MetaRequest to avoid confusion.
Signed-off-by: Sam Lang <sam.lang@inktank.com>
Passing the result of c_str() to a function that takes
std::string as argument is slow and redundant.
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>