xie xingguo [Mon, 22 Feb 2016 07:23:14 +0000 (15:23 +0800)]
OSD: put a guard for updating heartbeat peers
As get_next_up_osd_after() and get_previous_up_osd_before() may refer to the same
osd, so we need to put a guard in case we try to add the same osd into want.
Note that the STL set can handle the above case, so this commit should be only
considered as cleanup, not a big deal.
xie xingguo [Wed, 17 Feb 2016 10:28:11 +0000 (18:28 +0800)]
OSD: fix fusestore hanging during stop/quit
If both 'stop' and 'osd_objectstore_fuse' are set to true, then the
fuse_store will be stopped first and then restarted and is left hanging,
which is incorrect.
Jason Dillaman [Mon, 15 Feb 2016 15:50:33 +0000 (10:50 -0500)]
librbd: potential deadlock during AIO image re-open
The AIO image open might complete under the librados AIO callback.
Attempting to close the old image handle under that thread will
deadlock under the new librados_test_stub flush handling.
Signed-off-by: Jason Dillaman <dillaman@redhat.com>
Pete Zaitcev [Fri, 12 Feb 2016 22:07:06 +0000 (15:07 -0700)]
rgw: cleanups to comments and messages
These are minor cleanups that do not affect the code in a
material way:
- Forgot to add --tenant to usage message
- Make the help slightly less misleading
- Fix a strange error message "could not add remove caps"
- Spelling in a comment
- The vstart.sh can be run with civetweb
The commit adding Seastar sstring.h replaced a part of the interface
which used an internal string-view type, with an equivalent using
basic_string_ref from Boost. I relied on a default template argument
not present in older versions.
Signed-off-by: Matt Benjamin <mbenjamin@redhat.com>
Matt Benjamin [Tue, 2 Feb 2016 14:38:51 +0000 (09:38 -0500)]
librgw: consolidate S3 bucket name validation
There is more cleanup potential here, but it is intrusive, as the
validators for bucket and object names have been factored through
the handler inheritance hierarchy.
This change just deletes the S3 validate_bucket_name for now, as
that method was large. The corresponding object name validator was
not defined in RGWHandler_REST_S3, so I've left it as is, for now.
Signed-off-by: Matt Benjamin <mbenjamin@redhat.com>
Matt Benjamin [Thu, 28 Jan 2016 17:37:03 +0000 (12:37 -0500)]
librgw/rgw: reorganize autotools linkage
Adds the RGW-NFS library to the radosgw build, with unit tests.
Adds -fPIC to compile flags to satisfy the linker, but should have
been evident to automake/libtool.
Signed-off-by: Matt Benjamin <mbenjamin@redhat.com>
Matt Benjamin [Sun, 17 Jan 2016 22:30:06 +0000 (17:30 -0500)]
librgw: temporary fix RGWWrite
The current behavior of put_data_and_throttle leads to data
curruption, because the supplied buffer is apparently still being
written when the call returns--regardless of the value of
need_to_wait.
For now, do a buffer::copy of the supplied buffer, rather than the
original buffer::static, since that will at least be released
when no longer needed.
Probably this improves apparent rgw_write performance, but is not
what was originally intended.
Signed-off-by: Matt Benjamin <mbenjamin@redhat.com>
Matt Benjamin [Thu, 14 Jan 2016 22:25:45 +0000 (17:25 -0500)]
librgw: fix timestamp on create (another case)
In the rgw_create regular file case, the timestamp and size update
logic (though present) was being bypassed because the "FLAG_CREATE"
indicator which formerly propagated up from RGWLibFS::lookup_fh
was lost in the LRU change, which refactored the code for creating
new RGWFileHandle objects.
Signed-off-by: Matt Benjamin <mbenjamin@redhat.com>
Matt Benjamin [Thu, 14 Jan 2016 16:38:24 +0000 (11:38 -0500)]
librgw: add missing RGWFileHandle::stat in rgw_mkdir
The lack of stat here induced a serious memory corruption, due to
the organization of Ganesha file attributes (and their reliance on
the FSAL to initialize the memory).
Signed-off-by: Matt Benjamin <mbenjamin@redhat.com>
Matt Benjamin [Tue, 12 Jan 2016 23:21:56 +0000 (18:21 -0500)]
librgw: fix leading-slash special case, again
Fix boilerplate to sanitize relative_object_name() in rgw_create
as well as the RGWStatObjRequest case of RGWLibFS::stat_leaf. Signed-off-by: Matt Benjamin <mbenjamin@redhat.com> Signed-off-by: Matt Benjamin <mbenjamin@redhat.com>
Rewrite rgw_getattr to just dispatch into RGWLibFS::getattr, where
we can better use RGWFileHandle and RGWLibFS internals.
Initially, this change intended to dispatch a new RGWStatObjRequest
in the file case, but during implementation, discovered that in
(apparently) all file cases, it has already been done--but the path
had stopped working with the naming change.
Current GETATTR_DIRS1 unit test, when repeated so relying on lookup
(rather than saving size after rgw_write/rgw_close), passes.
Signed-off-by: Matt Benjamin <mbenjamin@redhat.com>
Matt Benjamin [Thu, 7 Jan 2016 01:57:36 +0000 (20:57 -0500)]
librgw: likely correct marker handling
New logic propagates is_truncated traveral-finished indicator up
from bucket and object list operations in all cases, and correctly
expands relative paths.
Unit test output looks promising.
Signed-off-by: Matt Benjamin <mbenjamin@redhat.com>
Matt Benjamin [Wed, 6 Jan 2016 00:03:49 +0000 (19:03 -0500)]
librgw: rework full_object_name() and friends
Flex RGWFileHandle::full_object_name() to build either a search
prefix (omits leading "/" and bucket name) or else the full path
to the root (e.g., for pretty-printing), depending on the value
of a boolean omit_bucket argument.
New convenience methods search_prefix() and relative_object_name()
select these, respectively.
Signed-off-by: Matt Benjamin <mbenjamin@redhat.com>
Matt Benjamin [Tue, 5 Jan 2016 17:26:36 +0000 (12:26 -0500)]
librgw: add continued readdir test
Verify that files created in a single, large directory are correctly
enumerated through a sequence of rgw_readdir() calls, at successive
offsets checking cookie/marker and bounds invariants.
Signed-off-by: Matt Benjamin <mbenjamin@redhat.com>
Matt Benjamin [Thu, 24 Dec 2015 17:45:16 +0000 (12:45 -0500)]
librgw: dir traversal state GC added
To minimize overhead, traversal events are modeled as a linear
sequence of fh_key, timestamp tuples. GC operates out-of-line in
LIFO order, and includes a ref cycle. If the matching directory
object can't be found by handle, it's already gone, and nothing
happens.
To avoid lock contention, scanning of the event sequence is done
in groups of 24 by default, but in groups of sequence/4 if the
event sequence grows larger than 500 events.
Push READDIR events on successful component readdir (bucket or
object listing partial result, as appropriate).
Revise locking, timestamp and update link count in all cases. Link
counts are approximate (metadata to represent it is not stored).
Signed-off-by: Matt Benjamin <mbenjamin@redhat.com>