Closed
Conversation
cascading changes, and minor improvements. Signed-off-by: Yehuda Sadeh <yehuda@redhat.com>
Signed-off-by: Yehuda Sadeh <yehuda@redhat.com>
Signed-off-by: Yehuda Sadeh <yehuda@redhat.com>
Consolidate objclass util services. Signed-off-by: Yehuda Sadeh <yehuda@redhat.com>
move code out of RGWRados, refactor a bit to use rados svc. Signed-off-by: Yehuda Sadeh <yehuda@redhat.com>
Signed-off-by: Yehuda Sadeh <yehuda@redhat.com>
Signed-off-by: Yehuda Sadeh <yehuda@redhat.com>
Signed-off-by: Yehuda Sadeh <yehuda@redhat.com>
Signed-off-by: Yehuda Sadeh <yehuda@redhat.com>
Signed-off-by: Yehuda Sadeh <yehuda@redhat.com>
move implementation out of header. Signed-off-by: Yehuda Sadeh <yehuda@redhat.com>
Signed-off-by: Yehuda Sadeh <yehuda@redhat.com>
Signed-off-by: Yehuda Sadeh <yehuda@redhat.com>
Don't include json_spirit.h, but json_spirit_value.h, and other minor changes. Signed-off-by: Yehuda Sadeh <yehuda@redhat.com>
Dependency reduction Signed-off-by: Yehuda Sadeh <yehuda@redhat.com>
Signed-off-by: Yehuda Sadeh <yehuda@redhat.com>
Signed-off-by: Yehuda Sadeh <yehuda@redhat.com>
I didn't intend for it to be such a big commit, and it's not even compiling yet. This changes the structure of how the metadata manager and handlers work. The idea is to be able to relatively easily hook in different meta backends (or same backends with different handling -- such as the otp). Added new services for meta, meta backend, and meta backend sysobj implementation. The meta backend service is responsible for the final data storage, and updating the meta log (log might be split later on, but at the moment it keeping it together for simplicity). The handlers themselves are the ones responsible for reading or modifying the metadata. This means that they need to call the meta backend service instead of calling the utility functions. The utility functions need to call the handlers, and not the other way around. Handlers can have utility methods to assist. Left to do: get everything actually compiling and implemented. The structure is there, now need to fill in the gaps. Signed-off-by: Yehuda Sadeh <yehuda@redhat.com>
Getting closer, but not there yet Signed-off-by: Yehuda Sadeh <yehuda@redhat.com>
So that it could be used now in svc.bucket without needing store. Signed-off-by: Yehuda Sadeh <yehuda@redhat.com>
and other changes Signed-off-by: Yehuda Sadeh <yehuda@redhat.com>
Signed-off-by: Yehuda Sadeh <yehuda@redhat.com>
Signed-off-by: Yehuda Sadeh <yehuda@redhat.com>
Signed-off-by: Yehuda Sadeh <yehuda@redhat.com>
and a lot of compilation fixes Signed-off-by: Yehuda Sadeh <yehuda@redhat.com>
notable changes are around user metadata. Create an api that uses the service interface (that requires backend context) and use it for higher level functions. Still a lot to do. Signed-off-by: Yehuda Sadeh <yehuda@redhat.com>
Similar to svc, just for higher level apis. Signed-off-by: Yehuda Sadeh <yehuda@redhat.com>
in rgw_user.cc Signed-off-by: Yehuda Sadeh <yehuda@redhat.com>
Signed-off-by: Yehuda Sadeh <yehuda@redhat.com>
Signed-off-by: Yehuda Sadeh <yehuda@redhat.com>
rgw-admin now compiles Signed-off-by: Yehuda Sadeh <yehuda@redhat.com>
Signed-off-by: Yehuda Sadeh <yehuda@redhat.com>
Signed-off-by: Yehuda Sadeh <yehuda@redhat.com>
Signed-off-by: Yehuda Sadeh <yehuda@redhat.com>
Signed-off-by: Yehuda Sadeh <yehuda@redhat.com>
Signed-off-by: Yehuda Sadeh <yehuda@redhat.com>
Signed-off-by: Yehuda Sadeh <yehuda@redhat.com>
No need for fetching attrs, these could be read via the get() if meta object has pattrs set (happens in the RGWBucketEntryMetadataObject case). Signed-off-by: Yehuda Sadeh <yehuda@redhat.com>
This is needed so that we can provide a backend-specific params from the top level. For example in the current case we need in some cases to be able to provide a sysobj_ctx that will be used instead of a newly generated one. The layers in between don't need to know about the backend specifics. Signed-off-by: Yehuda Sadeh <yehuda@redhat.com>
Signed-off-by: Yehuda Sadeh <yehuda@redhat.com>
Signed-off-by: Yehuda Sadeh <yehuda@redhat.com>
Signed-off-by: Yehuda Sadeh <yehuda@redhat.com>
To differentiate between the different uinfo cache indexes Signed-off-by: Yehuda Sadeh <yehuda@redhat.com>
Signed-off-by: Yehuda Sadeh <yehuda@redhat.com>
No need to pass mtime there Signed-off-by: Yehuda Sadeh <yehuda@redhat.com>
So that requests to read_bucket_instance_info() could be satisfied through cache. Signed-off-by: Yehuda Sadeh <yehuda@redhat.com>
This field was only initialized if we also read the bucket entrypoint, which is not always the case. Added ep objv_tracker field on req_state instead, and changed logic in delete_bucket() to make sure we do the right thing. Signed-off-by: Yehuda Sadeh <yehuda@redhat.com>
Signed-off-by: Yehuda Sadeh <yehuda@redhat.com>
Was passing wrong variable in constructor initialization, renamed handler member name to avoid future confusion. Signed-off-by: Yehuda Sadeh <yehuda@redhat.com>
allow both [tenant/]bucket:instance and [tenant:]bucket:instance Signed-off-by: Yehuda Sadeh <yehuda@redhat.com>
Was passing the period id (string) which triggered implicit construction of the period object. Instead pass the period object itself and make constructor explicit to avoid future similar issues. Signed-off-by: Yehuda Sadeh <yehuda@redhat.com>
put_entry() doesn't write to mdlog. Signed-off-by: Yehuda Sadeh <yehuda@redhat.com>
71218d5 to
15c5dde
Compare
… key rgw_bucket_parse_bucket_instance() was returning a meta key, e.g., bucket:instance and not just 'instance'. This caused issue when using read_bucket_instance_info(). Adjusted other users of this function, now that api changed. Signed-off-by: Yehuda Sadeh <yehuda@redhat.com>
We already get the substring as input, don't do it again. Signed-off-by: Yehuda Sadeh <yehuda@redhat.com>
Need to diffrerentiate between need to sync and actually syncing. Zone might need to sync, but we're running in radosgw-admin and we don't actually sync. Signed-off-by: Yehuda Sadeh <yehuda@redhat.com>
Signed-off-by: Yehuda Sadeh <yehuda@redhat.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
There and back again.
De-scrambling this omelette took way longer than I originally anticipated, and scope of work grew way bigger than originally intended. There were a lot of interdependencies that needed to untangle. This started as an effort to move stuff out of RGWRados into modules. Turned quickly into refactoring of metadata handling. The original metadata code was doing some funny things in order to ensure that when writing metadata entries (e.g., bucket/user creation/modification/removal), the metadata log is updated. The different calls (e.g., RGWRados::put_bucket_instance_info(), etc.) would translate the entity id (e.g., bucket, user) into a metadata key, and then would funnel into RGWMetadataManager::put_entry() that will then convert that metadata key into raods {pool, oid} (by querying the specific metadata handler), update the metadata log, and write the corresponding system object. A generic metadata put would work similarly, but will go from RGWMetadataManagaer::put() into the corresponding handler put() method, which in turn will call the manager put_entry(). The otp handler called the manager mutate() instead of put_entry() as it wasn't doing a simple system object write, but called a cls_otp method.
New handling works different by trying to make sure that RGWMetadataManager doesn't need to know anything about the metadata layout on one hand, and on the other hand the different random utility functions (e.g., rgw_put_bucket_store_info()) don't call into the metadata manager directly or indirectly. This responsibility was pushed down to a set of svc (I'll avoid stating the badly named term 'service', should have been 'module'; if anyone wants to run a find and replace and change everything be my guest). There are the meta and meta_be svcs. The meta_be (backend) svc is the base svc for meta backend handling. Then there are different meta_be implementations: meta_be_sobj, meta_be_otp (that extends from sobj).
A meta_be svc has a backend type associated with it (e.g., SOBJ, OTP). Each can have different type of data that it needs in order to access and control the backend. The abstract RGWSI_MetaBackend::Context is being used to hold that data, and each backend type extends it. However, the meta_be svc is generic, and doesn't know anything about buckets and users. For each metadata type we need to create a meta-backend handler instance. The meta-backend handler can generate a type specific context that will be used by the specific backend. For the sobj backend there is a "module" that the handler holds and has a set of methods that can be used to translate between meta keys and the sobj {pool, oid}. Each metadata handler that wants to use the sobj backend implements a module instance that does these translations. At the moment things are explicit, and everything is created on initialization and ad-hoc. The metadata handlers at the moment know that they will be used with sobj (or otp) backends. In the future we can do things a bit differently in the way these things are constructed, but this structure should still hold.
Now that everything was pushed down below the metadata manager and metadata handlers, the utility functions don't need to call into them for writing certain metadata entries. However, there was a need to create new utility code that would use the new scheme. Note that when creating a user (for example), we don't just create the metadata entry, but there are a bunch of other objects that we create (the different indexes -- access_key, swift, email). These are also very specific to the backend that is being used. I created new base svcs for user, and for bucket, and created implementation svcs: user_rados, bucket_sobj. Note that the user implementation has rados specific calls, whereas bucket only does sobj specific stuff (which is still only rados, but in theory can be replaced).
It became clear to me that the svc layer is not where we really want to keep all the application apis. It should serve as a a lower abstraction layer for modular entities. One example for why this is needed is that calls that create a user's bucket, need to interact with both user svc and bucket svc. Having the two svcs know about each other would be problematic. Instead I created 'controls' (RGWBucketCtl, RGWUserCtl, RGWOTPCtl) that provide higher level apis and call themselves into the different svcs. The lower level svcs need to be provided with an appropriate backend context. Some of those don't really need that context, but I made sure they get it anyway -- mostly so that it's explicit that those calls might be backend dependent. Also, the context passed to these calls needed to be explicitly typed so that we don't make a mistake and accidentally pass a wrong context. This was a real issue when dealing with svc.bucket that has two separate backends: one for bucket, and one for bucket.instance.
I tried to avoid introducing new explicit dynamic allocations. This was a bit challenging, since the meta backends require having a context passed into them from the top level, but the top level doesn't need to know anything about the specific implementation. One way to do it was to leverage ceph::static_ptr<>, however, that required exposing all context implementations to the static_ptr<> definition, which I wasn't happy about. The solution I preferred was providing an abstract method on the backend that would get a lambda that receives a context pointer. The backends will then implement it by putting a context (of their type) on the stack, and calling that lambda. Hopefully that prevents dynamic allocations and is actually useful. The same was done for the backend handlers. With the latter there were cases where it was needed to pass two different context types (in the bucket + bucket.instance case).
Other notable things:
TBD:
There are still a few #warnings that need to be handled. The two main issues left behind are the metadata and chained cache that when I looked at I thought it needed some rework (looks like there are paths where we don't go to the metadata cache when dealing with bucket instance).
Since code is more generic and avoids being backend specific, the new ctl methods don't accept RGWObjectCtx (which is sobj specific). However, by removing that we lose something, and there needs to be a (good) way to add it back.
There is an unrelated includes cleanup work that snuck in and should be removed (and be sent separately).
rebase
lots of testing
References tracker ticket
Updates documentation if necessary
Includes tests for new functionality or reproducer for bug