Introduce a new class Capability::Import and use it to send information
of imported caps back to the exporter. This is preparation for including
counterpart's information in cap import/export message.
Signed-off-by: Yan, Zheng <zheng.z.yan@intel.com>
Following sequence of events can happen when exporting inodes:
- client sends open file request to mds.0
- mds.0 handles the request and sends inode stat back to the client
- mds.0 export the inode to mds.1
- mds.1 sends cap import message to the client
- mds.0 sends cap export message to the client
- client receives the cap import message from mds.1, but the client
still doesn't have corresponding inode in the cache. So the client
releases the imported caps.
- client receives the open file reply from mds.0
- client receives the cap export message from mds.0.
After the end of these events, the client doesn't have any cap for
the opened file.
To fix the message ordering issue, this patch introduces a new session
operation FLUSHMSG. Before exporting caps, we send a FLUSHMSG seesion
message to client and wait for the acknowledgment. When receiveing the
FLUSHMSG_ACK message from client, we are sure that clients have received
all messages sent previously.
Signed-off-by: Yan, Zheng <zheng.z.yan@intel.com>
For case:
- client voluntarily releases some caps through cap update message
- mds shares the new max by sending cap grant message
- mds recevies the cap update message
If mds doesn't increase the cap sequence when sharing the max size.
It can't determine if the cap update message was sent before or after
client reveived the cap grant message that updates max size.
Signed-off-by: Yan, Zheng <zheng.z.yan@intel.com>
encode inode version in auth mds' lock messages, so that version
of replica inodes get updated. This is important because client
use inode version in mds reply to check if the cached inode is
already up-to-date. It skips updating the inode if it thinks the
inode is already up-to-date.
Signed-off-by: Yan, Zheng <zheng.z.yan@intel.com>
If MDS receives a client request, but find there is an existing
slave request. It's possible that other MDS forwarded the request
to us, but the MMDSSlaveRequest::OP_FINISH message arrives after
the client request.
Signed-off-by: Yan, Zheng <zheng.z.yan@intel.com>
unlike locks of other types, dentry lock in unreadable state can
block path traverse, so it should be in sync state as much as
possible.
This patch make Locker::try_eval() change dentry lock's state to
sync even when the dentry is freezing. Also make migrator check
imported dentries' lock states, change locks' states to sync if
necessary.
Signed-off-by: Yan, Zheng <zheng.z.yan@intel.com>
After importing inode, the issued caps can be less than the caps
client wants. So always re-issue caps after importing inode.
Signed-off-by: Yan, Zheng <zheng.z.yan@intel.com>
commit 1d86f77edf (mds: fix cross-authorty rename race) introduced
rename notify, but it puts the code in wrong bracket.
This patch also fixes a rename notify related bug in
MDCache::handle_mds_failure()
Signed-off-by: Yan, Zheng <zheng.z.yan@intel.com>
If want_xlocked becomes true, we can not rely on previously sent discover
because it's likely the previous discover is blocked on the xlocked dentry.
Signed-off-by: Yan, Zheng <zheng.z.yan@intel.com>
Since commit 310032ee81(fix mds scatter_writebehind starvation), rdlock
a scatter lock does not always propagate dirty fragstats to corresponding
inode. So Server::_dir_is_nonempty() needs to check each dirfrag's stat
intead of checking inode's dirstat.
Signed-off-by: Yan, Zheng <zheng.z.yan@intel.com>
A recovering MDS may receives strong cache rejoin from a survivor,
then the survivor restarts, the recovering MDS receives week cache
rejoin from the same MDS. Before processing the week cache rejoin,
we should scour replicas added by the obsoleted strong cache rejoin.
Signed-off-by: Yan, Zheng <zheng.z.yan@intel.com>
MDSCacheObject::replica_nonce is defined as __s16, but nonce type
in MDSCacheObject::replica_map is int. This mismatch may confuse
MDCache::handle_cache_expire().
this patch unifies the nonce type as uint32
Signed-off-by: Yan, Zheng <zheng.z.yan@intel.com>
Current code uses import state to detect obsolete import/export messages.
it does not work for the case: cancel a subtree export, export the same
subtree again, the messages for the first export get dispatched.
This patch introduces "transation ID" for subtree exports. Each subtree
export has a unique TID, the ID is recorded in all import/export related
messages. By comparing the TID, we can reliably detect stale messages.
Signed-off-by: Yan, Zheng <zheng.z.yan@intel.com>
Current code uses several STL maps to record import/export related
states. A map lookup is required for each state access, this is not
efficient. It's better to put import/export related states together.
Signed-off-by: Yan, Zheng <zheng.z.yan@intel.com>
there are two situations that result freeze tree deadlock.
- mds.0 authpins an item in subtree A
- mds.0 sends request to mds.1 to authpin an item in subtree B
- mds.0 freezes subtree A
- mds.1 authpins an item in subtree B
- mds.1 sends request to mds.0 to authpin an item in subtree A
- mds.1 freezes subtree B
- mds.1 receives the remote authpin request from mds.0
(wait because subtree B is freezing)
- mds.0 receives the remote authpin request from mds.1
(wait because subtree A is freezing)
- client request authpins items in subtree B
- freeze subtree B
- import subtree A which is parent of subtree B
(authpins parent inode of subtree B, see CDir::set_dir_auth())
- freeze subtree A
- client request tries authpinning items in subtree A
(wait because subtree A is freezing)
Enforcing a authpinning order can avoid the deadlock, but it's very
expensive. The deadlock is rare, so I think deadlock detection is
more suitable for the case.
This patch introduces freeze tree deadlock detection. We record the
start time of freezing tree. If we fail to freeze the tree within a
given duration, cancel the process of freezing tree.
Signed-off-by: Yan, Zheng <zheng.z.yan@intel.com>
instead of assuming the pool size is 2, query it and increment it to
test for pool set data size. It allows to run the test from vstart.sh
without knowing what the required pool size is in advance:
rm -fr dev out ; mkdir -p dev ; \
MON=1 OSD=3 ./vstart.sh -n -X -l mon osd
LC_ALL=C PATH=:$PATH CEPH_CONF=ceph.conf \
../qa/workunits/cephtool/test.sh
Signed-off-by: Loic Dachary <loic@dachary.org>
The file removal installed to be triggered when the script stops must
not fail if the file does not exist.
Signed-off-by: Loic Dachary <loic@dachary.org>
Instead of always returning true, the error code is set if at least one
operation fails.
EINVAL if the OSD id is invalid (osd.foobar for instance).
EBUSY if trying to remove and OSD that is up.
When used with the ceph command line, it looks like this:
ceph -c ceph.conf osd rm osd.0
Error EBUSY: osd.0 is still up; must be down before removal.
kill PID_OF_osd.0
ceph -c ceph.conf osd down osd.0
marked down osd.0.
ceph -c ceph.conf osd rm osd.0 osd.1
Error EBUSY: removed osd.0, osd.1 is still up; must be down before removal.
http://tracker.ceph.com/issues/6824fixes#6824
Signed-off-by: Loic Dachary <loic@dachary.org>
If given no argument, ceph-disk zap should display the usage instead of
silently doing nothing. Silence can be confused with "I zapped all the
disks".
http://tracker.ceph.com/issues/6981fixes#6981
Signed-off-by: Loic Dachary <loic@dachary.org>
The thread created to test Throttle race conditions updates a value (
throttle.get_current() ) that is tested by the main gtest thread but is
not protected by a lock. Instead of adding a lock, the main thread tests
the value after pthread_join() on the child thread.
http://tracker.ceph.com/issues/6679fixes#6679
Signed-off-by: Loic Dachary <loic@dachary.org>
Reverted Emperor versionadded to Dumpling as it gets backported.
Added default index and bucket pools to pool creation
Added default default_placment setting
Added placement_pools key val pair examples.
Added comments for re-running the procedure for the secondary region.
Signed-off-by: John Wilkins <john.wilkins@inktank.com>