Skip to content

Rgw nfs 5 - #7634

Merged
yehudasa merged 271 commits into
masterfrom
rgw-nfs-5
Feb 12, 2016
Merged

yehudasa merged 271 commits into
masterfrom
rgw-nfs-5

Conversation

@yehudasa

Copy link
Copy Markdown
Member

No description provided.

Signed-off-by: Matt Benjamin <[email protected]>
Signed-off-by: Matt Benjamin <[email protected]>
The operation on store is missing, but interface works.

Signed-off-by: Matt Benjamin <[email protected]>
Widen rgw_mount(...) to take the library context, which from
there on follows struct rgw_fs.

Implement an open-coded version of list buckets in rgw_readdir(...),
which now...lists buckets.

The future home of this and the rest of the rgw_file impl. logic
looks to be a more fully elaborated RGWLib* class family.

Signed-off-by: Matt Benjamin <[email protected]>
Signed-off-by: Matt Benjamin <[email protected]>
In order to support direct/library clients, we want to
more fully decouple RGWOp processing from client HTTP
processing, since in the direct case, there is no HTTP
client.

This change tackles essentially just RGWClientIO, by moving
stream operations to a new subclass RGWStreamIO, and updating
the stream backends (e.g., SWIFT, S3) and REST handlers
accordingly.

In addition, the RGWLib backend is incrementally updated, with
RGWLibIO still deriving from the base RGWClientIO.  The RGWLib
path is incomplete as of this change, but is moving in the
direction of its own process_request call path (incomplete,
partly due to header conflicts that will be resolved in
subsequent commits).

Signed-off-by: Matt Benjamin <[email protected]>
RGWLibIO is forward declared in rgw_rest.h.

Signed-off-by: Matt Benjamin <[email protected]>
* RGWLib bucket ops prototyped
* progress made on RGWOp+RGWRequest unification (RGWLib only)
* mostly-harmlessness of RGWHandler-free operation try-checked

The replacement for process_request is the next code to prototype--
RGWHandler-free operation, for great justice.

Signed-off-by: Matt Benjamin <[email protected]>
It would be nice to have some compile-type assistance w/the
dual RGWOp & RGWLibRequest boilerplate.

Signed-off-by: Matt Benjamin <[email protected]>
all RGW_Auth_S3::authorize() from process_request().  Add a
read_permissions() primitive replacing RGWHandler's version in
RGWLibRequest.

Signed-off-by: Matt Benjamin <[email protected]>
The method just called delete on the RGWOp pointer.

Signed-off-by: Matt Benjamin <[email protected]>
* move RGWLibRequest decls into rgw_file.h
* revise include guard token in rados/rgw_file.h (avoid conflict)
* save CephContext* in RGWLibRequest
* initialize RGWLibRequest cct in ctor, req_state in process_request

Signed-off-by: Matt Benjamin <[email protected]>
Fix public header inclusion from rgw_file.h internal header, which
of course needs to see the public interface.

Finish up the minimal RGWListBucketsRequest callback functor.

Signed-off-by: Matt Benjamin <[email protected]>
This change renames RGWHandler_ObjStore to RGWHandler_REST, and
moves the following protected, virtual, RESTful methods:

  virtual bool is_obj_update_op() { return false; }
  virtual RGWOp *op_get() { return NULL; }
  virtual RGWOp *op_put() { return NULL; }
  virtual RGWOp *op_delete() { return NULL; }
  virtual RGWOp *op_head() { return NULL; }
  virtual RGWOp *op_post() { return NULL; }
  virtual RGWOp *op_copy() { return NULL; }
  virtual RGWOp *op_options() { return NULL; }

and the following public, virtual methods not needed by the
prototyped RGWLibHandler:

  virtual RGWOp *get_op(RGWRados *store);
  virtual void put_op(RGWOp *op);

from RGWHandler into the renamed class.

The motivation for this change is to allow a (maybe) transitional
refactoring stage which allows to implement the RGWHandler
interface, without implementing get_handler() or get_op(), put_op(),
or op_*().

Prior refactoring (which could be reversed) moved authorize() and
read_permissions() into the precursor RGWHandler_ObjStore

Signed-off-by: Matt Benjamin <[email protected]>
Derive RGWLibRequest from RGWRequest, RGWHandler.

This strategy defines the dialect of ops following the derivation
pattern for RGWLib actions to be their handler.

On the negative side, RGWLibRequest has struct req_state* s from two
ancestors.  Since we don't use virtal inheritance, the only overhead is
the extra copy, and need for disambiguation in the direct descendants
(this is only 1 method in 1 file, atm).

The motivation is as follows.  RGWHandler currently has 3 responsibilities:
1) op-chasing; 2) to hold authorize() and read_permissions() methods
3) to initialize req_state

RGWLib actions have no use for the op-chasing behavior, and authorize()
and read_permissions() methods are arguably more naturally expressed as
methods on the actions.  Meanwhile struct req_state appears to be a
candidate for refactoring into the RGWRequest class hierarchy, which would
mean that initalization probably should move from hanlder to request, as
well.  Refactoring req_state is would be quite intrusive, so this change
defers that for later, but keeps the 1-1 mappings from request to
handler at 0 cost.

Signed-off-by: Matt Benjamin <[email protected]>
There's some tricky overloading induced by multiple inheritance,
also this design makes repeatedly shared handles in current framework
very visible.

The most important non-boilerplate is in descendant RGWRequest
initializers (rgw_lib.h), which need to set up req_state appropriately
for their action/op.

Signed-off-by: Matt Benjamin <[email protected]>
The REST cognates of this class largely deal with HTTP, and is 1-1
w/request, client-io, op, etc.  At worst, its functions can be absorbed
into one of those (client-io, initially).

Signed-off-by: Matt Benjamin <[email protected]>
Adds the missing bits of RGWLibProcess and RGWLibFrontend, and
calls them from rgw_readdir().

Clients can call enqueue_req() to route a request through the
work queue, or execute_req() to run it inline.

Signed-off-by: Matt Benjamin <[email protected]>
Refactor RGWLib variant of process_request(...) as a (actually 2,
one which puts an RGWLibIO on the stack) member function of
RGWLibProcess.

Also replace extern abort_early with static inline abort_req(),
since the rgw_rest extern assumes HTTP/REST.

Signed-off-by: Matt Benjamin <[email protected]>
* initialize RGWEnv with required HTTP_HOST (incorrectly!)
* assign req_state::cio (not really correctly)
* remove incorrect delete of RGWOp, which no longer alloc'd

Now runs, but don't see buckets.

Signed-off-by: Matt Benjamin <[email protected]>
1. the prior commit had authorize cognate with S3
1.1 which may be right
1.2 but maybe not for each request
1.3 and lacked priming/forged auth data

The forging of auth data is now easy, but the interesting part is
caching and efficiently attaching it so I paused, and

2. disabled auth, which was now overriding and anonymizing all
requests (good!)

3. fixed another instance of reinterpret_cast where (one of)
dynamic_cast or a saved pointer descendant request (avoids a runtime
check, so will add later) is needed

4. fixed bad offset argument to rgw_readdir

The list bucket facility now works, modulo non-auth.

Signed-off-by: Matt Benjamin <[email protected]>
mattbenjamin and others added 24 commits February 12, 2016 12:08
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 <[email protected]>
Remove unused routines:

 * librgw_acl_bin2xml
 * librgw_free_xml
 * librgw_acl_xml2bin
 * librgw_free_bin(librgw_t rgw, char* bin)

Signed-off-by: Matt Benjamin <[email protected]>
Unit tests correctly see fail result from librgw_create.

Signed-off-by: Matt Benjamin <[email protected]>
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 <[email protected]>
Ensure that key symbols from global are satisfied in the library.

Signed-off-by: Matt Benjamin <[email protected]>
Signed-off-by: Yehuda Sadeh <[email protected]>
Signed-off-by: Matt Benjamin <[email protected]>
Signed-off-by: Yehuda Sadeh <[email protected]>
Signed-off-by: Matt Benjamin <[email protected]>
Signed-off-by: Yehuda Sadeh <[email protected]>
Signed-off-by: Matt Benjamin <[email protected]>
The declaration being skipped was meant as a placeholder for future
optimization work, moved to a comment.

Signed-off-by: Matt Benjamin <[email protected]>
This file originated at Red Hat.

Signed-off-by: Matt Benjamin <[email protected]>
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 <[email protected]>
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 <[email protected]>
Files accidentally added.

Signed-off-by: Matt Benjamin <[email protected]>
Signed-off-by: Matt Benjamin <[email protected]>
yehudasa added a commit that referenced this pull request Feb 12, 2016
nfs for rgw (Matt Benjamin, Orit Wasserman)

Reviewed-by: Yehuda Sadeh <[email protected]>
@yehudasa
yehudasa merged commit 5542c6e into master Feb 12, 2016
@yuyuyu101
yuyuyu101 deleted the rgw-nfs-5 branch February 13, 2016 04:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants