Jason Dillaman [Tue, 21 Apr 2015 14:15:58 +0000 (10:15 -0400)]
librbd: allow updates to snapshot object maps
The modified copyup behavior will need to update snapshot object
maps when performing a copyup since the object will now exist within
all snapshots of the image.
Signed-off-by: Jason Dillaman <dillaman@redhat.com>
Jason Dillaman [Mon, 20 Apr 2015 16:12:05 +0000 (12:12 -0400)]
librados_test_stub: support AIO snapshot context
AIO operations can be executed with a different snapshot
context from the IoCtx. librbd takes advantage of this
capability to perform a deep object copyup.
Signed-off-by: Jason Dillaman <dillaman@redhat.com>
Jason Dillaman [Thu, 16 Apr 2015 20:27:56 +0000 (16:27 -0400)]
librbd: copyup should use empty snapshot context
This allows child object to exist through all existing
snapshots as well as HEAD. If the operation was a CoW,
issue the write ops as a separate RADOS op with the
correct snapshot context.
Signed-off-by: Jason Dillaman <dillaman@redhat.com>
Jason Dillaman [Thu, 16 Apr 2015 18:15:10 +0000 (14:15 -0400)]
librbd: move copyup class method call to CopyupRequest
Move AbstractWrite's invocation of copyup to the CopyupRequest
class. The AioRequest write path will now always create a
CopyupRequest, which will now append the actual write ops to the
copyup.
Signed-off-by: Jason Dillaman <dillaman@redhat.com>
Jason Dillaman [Wed, 15 Apr 2015 18:25:08 +0000 (14:25 -0400)]
librbd: add new deep-flatten RBD feature
Copy-on-read/write will now use an empty snapshot context to
deep-copy the object through all existing snapshots. With the
deep-flatten feature enabled, the flatten operation will now
disconnect a child image from its parent even if it has existing
snapshots.
Signed-off-by: Jason Dillaman <dillaman@redhat.com>
Sage Weil [Wed, 6 May 2015 21:01:34 +0000 (14:01 -0700)]
librbd: fix warning
librbd/librbd.cc: In member function 'int librbd::Image::metadata_get(const string&, std::string*)':
librbd/librbd.cc:845:76: warning: suggest braces around empty body in an 'else' statement [-Wempty-body]
Jason Dillaman [Wed, 6 May 2015 18:48:50 +0000 (14:48 -0400)]
librbd: ignore lack of support for metadata on older OSDs
If an Infernalis librbd attempts to open an image stored on a
pre-Infernalis OSD, the new config metadata operations won't
be supported. This error can be safely ignored.
Fixes: #11549 Signed-off-by: Jason Dillaman <dillaman@redhat.com>
Tim Serong [Fri, 1 May 2015 15:59:53 +0000 (01:59 +1000)]
json_spirit: use utf8 intenally when parsing \uHHHH
When the python CLI is given non-ASCII characters, it converts them to
\uHHHH escapes in JSON. json_spirit parses these internally into 16 bit
characters, which could only work if json_spirit were built to use
std::wstring, which it isn't; it's using std::string, so the high byte
ends up being zero'd, leaving the low byte which is effectively garbage.
This hack^H^H^H^H change makes json_spirit convert to utf8 internally
instead, which can be stored just fine inside a std::string.
Note that this implementation still assumes \uHHHH escapes are four hex
digits, so it'll only cope with characters in the Basic Multilingual
Plane. Still, that's rather a lot more characters than it could cope
with before ;)
(For characters outside the BMP, Python seems to generate escapes in the
form \uHHHHHHHH, i.e. 8 hex digits, which the current implementation
doesn't expect to see)
Fixes: #7387 Signed-off-by: Tim Serong <tserong@suse.com>
Zhiqiang Wang [Wed, 6 May 2015 08:14:29 +0000 (16:14 +0800)]
librbd: fix the image format detection
If the detection of the old format fails with reasons other than
-ENOENT, we should return with this error. Otherwise, if we continue the
new format detection and fail with -ENOENT, the caller will get the
missleading failure information.
Signed-off-by: Zhiqiang Wang <zhiqiang.wang@intel.com>
rados cli: add preventing using --block-size with bench seq and rand
Add handling of situation when '-b|--block-size' option is using with
'bench seq' or 'bench rand' which is erroneous according to the help message:
-b op_size
set the size of write ops for put or benchmarking
'trans_size' description from header: "size of the write/read to perform"
But really 'object_size' is used in write/read operations. 'trans_size' is used
only in ObjBencher::status_printer for calc current and average bandwidth.
As result - bad statistics in case 'trans_size' and and 'object_size' are different.
Ken Dreyer [Tue, 5 May 2015 17:25:46 +0000 (11:25 -0600)]
SubmittingPatches: clarify backport procedure
Developers should not add "Backport: " fields to Git commits, because
this data is immutable after the commits are merged. It makes more sense
to handle this information in Redmine instead.
Jianpeng Ma [Tue, 28 Apr 2015 05:12:47 +0000 (13:12 +0800)]
librbd: For format 2, don't forget set objectcache max objects.
For format 2, before create object_cache, it call init_layout and set
the max object for object cache.
In the later ictx_refresh, it only set for format1.
Now move set logic after creating object cache.
Signed-off-by: Jianpeng Ma <jianpeng.ma@intel.com>
Jianpeng Ma [Fri, 24 Apr 2015 06:47:28 +0000 (14:47 +0800)]
librbd: remove the perfcounter l_librbd_aio_rd/write/discard_*.
Now for non-aio read/write/discard, the internal implementation used the
related aio function. So we don't differentiate the aio perfcounter from non-aio for
read/write/discard operations.
Signed-off-by: Jianpeng Ma <jianpeng.ma@intel.com>
Jason Dillaman [Fri, 1 May 2015 18:41:40 +0000 (14:41 -0400)]
librbd: object map is not properly updated when deleting clean objects
With the new fast diff feature flagging which objects haven't changed
between snapshots, unmodified objects are now flagged with a new state
code in the object map. The OBJECT_EXISTS_CLEAN state needs to be
treated as if it were OBJECT_EXISTS when deleting.
Signed-off-by: Jason Dillaman <dillaman@redhat.com>
John Spray [Wed, 29 Apr 2015 20:48:53 +0000 (21:48 +0100)]
mon: add MonClient::flush_log
A simple reasonable-effort call for emitting
a MLog before shutting down. Used in MDS which
also waits for its beacon to be acked, so due to
message ordering implicitly waits for this to land
too -- no need to implement a waiting log flush
for this use case.