Yan, Zheng [Tue, 20 Jan 2015 12:12:11 +0000 (20:12 +0800)]
mds: save the oldest snapid of inode
When moving a inode to different snapshot realm, we need to check if
the inode is snapshotted. If the inode is snapshotted, we create a
snapshot realm for it. The snapshot realm records inode's past snapshot
realm.
Currently there is no reliable way to check if a inode is snapshotted.
So add a new field to CInode the store the oldest snapid, it's used to
check if inode is snapshotted.
Yan, Zheng [Mon, 29 Dec 2014 08:16:23 +0000 (16:16 +0800)]
mds: don't manully create snaprealm during rename
project_past_snaprealm_parent() will do the same job. Besides
MDCache::_snaprealm_create_finish() is buggy, it updates snaprealm's
current_parent_since incorrectly
Yan, Zheng [Fri, 26 Dec 2014 07:03:19 +0000 (15:03 +0800)]
mds: always create multiversion inode when cow inode
When moving a snapshotted regular file to stray directory, we need
to create an snaprealm for it. The snaprealm is required for building
correct snapshot context when purging file objects.
Current code normally create seperate inodes when a snapshotted file
inode is COWed. Each time the file inode is COWed, the head inode's
'first' is updated. So when deleting the file, we can't use head inode's
'first' to check if it was snapshotted.
This commit make MDCache::journal_cow_dentry always create multiversion
inode. multiversion inode's 'first' keeps constant.
Yan, Zheng [Fri, 19 Dec 2014 07:29:32 +0000 (15:29 +0800)]
mds: check multiversion inode when purging stray
we can't purge a multiversion directory inode when it is still referenced
by some snapshots. For regular files that are still referenced by some
snapshots, we need to keep the backtrace object.
Yan, Zheng [Fri, 12 Dec 2014 02:00:53 +0000 (10:00 +0800)]
mds: check snaprealm before drop dentries in deleted directory
There is an optimization that drop dentries in deleted directory,
so that MDS can purge corresponding inode faster. We need to check
if the deleted directory is still referenced by any snapshot. If
it is, we can't drop dentries or skip committing dirfrags to object
store. The simplest method to check if a delted directory is
potentially referenced by snaphosts is checking diri->snaprealm.
Thorsten Behrens [Wed, 10 Dec 2014 10:53:43 +0000 (11:53 +0100)]
Unconditionally chown rados log file.
This fixes bnc#905047 (in a somewhat ad-hoc way). Sadly the log
file gets created from several places, so its existence does not
mean init-radosgw had actually run.
Mykola Golub [Fri, 23 Jan 2015 09:47:45 +0000 (11:47 +0200)]
msg: fixup for 2ffacbe (crc configuration in messenger)
* Update the remaining Message::encode() calls, which now expect crc
flags to be passed as a flags parameter instead of a bool (this e.g.
fixes the issue with routing messages forwarded from an older client).
* In Message::encode() data crc is calculated when MSG_CRC_DATA is
set, but in decode_message(), Pipe::read/write_message() data crc is
calculated when MSG_CRC_HEADER is set. Fix this.
Note, 2ffacbe changed the behavior of Pipe::read_message/write_message():
previously the methods always calculated crc, now they calculate it
only if crc is enabled in the config. This means crc can not be disabled
if there are monitors of older version in the cluster.
Signed-off-by: Mykola Golub <mgolub@mirantis.com> Reviewed-by: Sage Weil <sage@redhat.com>
John Spray [Tue, 3 Feb 2015 10:54:50 +0000 (10:54 +0000)]
mds: implement export dir asok
This was available as a legacy mds tell command
previously: make it availably via the cleaner
asok interface. asok rather than new `tell` because
it's a low level/debug thing.
Min Chen [Wed, 4 Feb 2015 08:09:13 +0000 (16:09 +0800)]
rbd-recover-tool: implement the function framework
add control files & config files
rbd-recover-tool is an offline tool for dead ceph cluster
to recever rbd image in replicated pool from all osds.
it is a simple but usefull policy to keep data secruity on ceph
Loic Dachary [Tue, 3 Feb 2015 16:40:41 +0000 (17:40 +0100)]
install-deps.sh: babeltrace is not on wheezy
The babeltrace package is not found on wheezy, not just squeeze.
Fix the regular expression that incorrectly replaced
libbabeltrace-ctf-dev with -ctf-dev leading to a strange error
E: Opening configuration file tf-dev - ifstream::ifstream (2: No such file or directory)
Jason Dillaman [Mon, 2 Feb 2015 20:08:42 +0000 (15:08 -0500)]
librbd: fixed object map issues discovered via fsx
The object map wasn't being properly refreshed after setting
the snapshot context on the parent image. Additionally fixed
a potential deadlock that could have occurred if no object
map update was required when trimming an image.
Fixes: #10706 Signed-off-by: Jason Dillaman <dillaman@redhat.com> Reviewed-by: Josh Durgin <jdurgin@redhat.com>
Jason Dillaman [Tue, 3 Feb 2015 11:07:00 +0000 (06:07 -0500)]
librbd: prevent copyup during image shrink operations
If a cloned image was shrunk, it was possible for a copyup
to be performed on objects outside of the new image range.
Resize now pre-shrinks the parent overlap to disable copyup
when removing objects.
Signed-off-by: Jason Dillaman <dillaman@redhat.com>
Karel Striegel [Tue, 3 Feb 2015 10:42:06 +0000 (11:42 +0100)]
rdb: update init-rbdmap to fix duplicate mount point
According to the manual 'mount -f' adds an entry in /etc/mtab.
Therefore the 'mount -v' command needs the flag -n to avoid
duplicate entries in /etc/mtab.
Jason Dillaman [Tue, 3 Feb 2015 09:15:43 +0000 (04:15 -0500)]
cls_rbd: fixed object_map_resize boundary issue
The object_map_resize sanity check ensures that a resize will
not erase state for an in-use object. The check was incorrectly
including a block within the new object map range.
Signed-off-by: Jason Dillaman <dillaman@redhat.com>
Jason Dillaman [Mon, 2 Feb 2015 15:50:09 +0000 (10:50 -0500)]
librbd: pending AIO operations are now flushed asynchronously
If exclusive locking was enabled, the librbd aio_flush command
would block waiting for queued AIO operations to proceed once
the exclusive lock was obtained. Now librbd will no longer
block when aio_flush is invoked and AIO operations are waiting
on the exclusive lock.
Fixes: #10714 Signed-off-by: Jason Dillaman <dillaman@redhat.com> Reviewed-by: Josh Durgin <jdurgin@redhat.com>
Billy Olsen [Mon, 2 Feb 2015 23:24:59 +0000 (16:24 -0700)]
Fix memory leak in python rados bindings
A circular reference was inadvertently created when using the
CFUNCTYPE binding for callbacks for the asynchronous i/o callbacks.
This commit refactors the usage of the callbacks such that the
Ioctx object does not have a class reference to the callbacks.
Fixes: #10723
Backport: giant, firefly, dumpling Signed-off-by: Billy Olsen <billy.olsen@gmail.com> Reviewed-by: Dan Mick <dmick@redhat.com> Reviewed-by: Josh Durgin <jdurgin@redhat.com>