Skip to content

rgw: cls_fifo-based BILog, the updater part - #37108

Closed
rzarzynski wants to merge 46 commits into
ceph:masterfrom
rzarzynski:wip-rgw-bilog-in-cls_fifo2
Closed

rzarzynski wants to merge 46 commits into
ceph:masterfrom
rzarzynski:wip-rgw-bilog-in-cls_fifo2

Conversation

@rzarzynski

Copy link
Copy Markdown
Contributor

Checklist

  • References tracker ticket
  • Updates documentation if necessary
  • Includes tests for new functionality or reproducer for bug

Show available Jenkins commands
  • jenkins retest this please
  • jenkins test classic perf
  • jenkins test crimson perf
  • jenkins test signed
  • jenkins test make check
  • jenkins test make check arm64
  • jenkins test submodules
  • jenkins test dashboard
  • jenkins test api
  • jenkins test docs
  • jenkins render docs
  • jenkins test ceph-volume all
  • jenkins test ceph-volume tox

It's unnecessary as, after a change, BILog is not touched at
the "prepare" stage of a modification to Bucket Index anymore.
This commit preserves the exact marshalling compatibility.

Signed-off-by: Radoslaw Zarzynski <[email protected]>
It's unnecessary legacy which was blocking the refactor
of RGWRados::Bucket::UpdateIndex.

Signed-off-by: Radoslaw Zarzynski <[email protected]>
Signed-off-by: Radoslaw Zarzynski <[email protected]>
Before the commit `RGWRados::cls_obj_complete_cancel()` was
taking the `bilog_flags` parameter. However, this dependency
is superficial -- the input is never used on the cancelation
handling path in `cls_rgw`. Its presence was an artifact
coming from the fact that multiple variants of BI completion
share the same `rgw_cls_obj_complete_op` structure for client-
OSD transport.

Signed-off-by: Radoslaw Zarzynski <[email protected]>
This isn't actually class-specific information but
rather method-specific.

Signed-off-by: Radoslaw Zarzynski <[email protected]>
The complex, two-stage construction pattern is not
necessary. The commit replaces it with single stage
construction taking `rgw_zone_set` optionally.

Signed-off-by: Radoslaw Zarzynski <[email protected]>
It's unnecessary to have the declaration in the header as
all of its users are in the rgw_rados.cc we're moving to.

This commit ONLY moves the code. No additional changes here.

Signed-off-by: Radoslaw Zarzynski <[email protected]>
Signed-off-by: Radoslaw Zarzynski <[email protected]>
This enables further modifications towards making clients
of `rgw_cls` aware about the `RGWModifyOp` and other bilog's
details. We want the extra coupling there for the sake of
the cls_fifo-based BI logging which is going to happen at
the client layer.

Signed-off-by: Radoslaw Zarzynski <[email protected]>
This enables further modifications towards making clients
of `rgw_cls` aware about the `RGWModifyOp` and other bilog's
details. We want the extra coupling there for the sake of
the cls_fifo-based BI logging which is going to happen at
the client layer.

Signed-off-by: Radoslaw Zarzynski <[email protected]>
Clients of cls_rgw (RadosGW itself) need to have these
details exposed for the sake of separating BILog in
the future (a.k.a the BILog OMAP offload).

Signed-off-by: Radoslaw Zarzynski <[email protected]>
This commit is focused on switching to `bi_updater` the part
of `RGWRados::cls_obj_complete_op()` that is responsible
for handling AIO completions. It's necessary as `bi_updater`
is the only component responsible for orchestrating BILog
updates. At the moment this boils down to just:

  `svc.zone->get_zone().log_data`

but will be extended by further commits to dispatch between
the cls_fifo-based and omap-based BILog's backends.

Signed-off-by: Radoslaw Zarzynski <[email protected]>
Signed-off-by: Radoslaw Zarzynski <[email protected]>
@rzarzynski
rzarzynski force-pushed the wip-rgw-bilog-in-cls_fifo2 branch from f4a9bda to 98971b0 Compare September 11, 2020 14:56
The idea is to use a compiler to ensure there is no data
modification between the place an operation is decoded
and the call to `log_index_operation()`.

Signed-off-by: Radoslaw Zarzynski <[email protected]>
This is the part for `rgw_bucket_unlink_instance()`.

Signed-off-by: Radoslaw Zarzynski <[email protected]>
The motivation is to the have `op_type` member variable
available also at run-time in contrast to the already
existing, compile-time handled `OpType`. This enables
making CLSRGWBILogOp's derivates constructible from
the low-level, wire-related bits:

  * rgw_cls_unlink_instance_op,
  * rgw_cls_link_olh_op,
  * rgw_cls_obj_complete_op.

Signed-off-by: Radoslaw Zarzynski <[email protected]>
@rzarzynski
rzarzynski requested a review from ivancich September 15, 2020 12:08
Signed-off-by: Radoslaw Zarzynski <[email protected]>
The rationale is to unify the naming convention with
other, bilog-related call operations. This will come
handy when dissecting the common part.

Signed-off-by: Radoslaw Zarzynski <[email protected]>
Let's unify the naming convention for the sake of
upcoming rework.

Signed-off-by: Radoslaw Zarzynski <[email protected]>
* rgw_cls_obj_complete_op
* rgw_cls_link_olh_op
* rgw_cls_unlink_instance_op

Signed-off-by: Radoslaw Zarzynski <[email protected]>
This allows the unification with cls_rgw_bi_log_related_op.

Signed-off-by: Radoslaw Zarzynski <[email protected]>
Signed-off-by: Radoslaw Zarzynski <[email protected]>

@adamemerson adamemerson left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I approve of this so far!

Comment thread src/rgw/rgw_rados.h
int cls_obj_complete_op(BucketShard& bs, const rgw_obj& obj, RGWModifyOp op, string& tag, int64_t pool, uint64_t epoch,
rgw_bucket_dir_entry& ent, RGWObjCategory category, list<rgw_obj_index_key> *remove_objs, uint16_t bilog_flags, rgw_zone_set *zones_trace = nullptr);
int cls_obj_complete_add(BucketShard& bs, const rgw_obj& obj, string& tag, int64_t pool, uint64_t epoch, rgw_bucket_dir_entry& ent,
const rgw_bucket_dir_entry& ent, RGWObjCategory category, list<rgw_obj_index_key> *remove_objs, uint16_t bilog_flags, rgw_zone_set *zones_trace = nullptr);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A lot of stuff being mutable that didn't need to be was annoying me, so I appreciate this.

Comment thread src/rgw/rgw_service.cc
// BILog as well?
// Liekly we would need to introduce use `bilog_rados->init()`
// as `datalog_rados` does with its `start()`.
bilog_rados = std::make_unique<RGWSI_BILog_RADOS>(cct);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I appreciate this elucidation of design inline.

Comment thread src/rgw/rgw_service.cc
bucket_sync_sobj = std::make_unique<RGWSI_Bucket_Sync_SObj>(cct);
bi_rados = std::make_unique<RGWSI_BucketIndex_RADOS>(cct);
// Q: will we have the bucket layout available here?
// A: metadata log uses the `neorados` along the path to determine

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We won't be using neorados in this run, though. The current plan is to use the interface in cls_fifo_legacy for ease of backporting, and then it can be updated to neorados for better Aio support later.

Comment thread src/rgw/rgw_rados.cc
{
constexpr bool is_inindex = true;
if (is_inindex) {
return std::move(on_flushed)(

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor nit: Use std::forward here, not std::move.

Comment thread src/rgw/rgw_rados.cc
AioCompletion *rados_completion{nullptr};
int manager_shard_id{-1};
RGWIndexCompletionManager *manager{nullptr};
std::function<void(librados::ObjectWriteOperation& o)> bi_update;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you don't need to copy it, you might prefer fu2::unique_function, since then our functions can include unique_ptrs and other uncopyable stuff.

(unique_function will not be making it into C++20 because they couldn't agree on whether to rename it to any_invocable, apparently. Sheesh.)

Comment thread src/rgw/rgw_rados.cc
void RGWIndexCompletionManager::create_completion(const rgw_obj& obj,
RGWModifyOp op, string& tag,
static std::list<cls_rgw_obj_key>
maybe_copy_remove_objs(std::list<cls_rgw_obj_key>* const remove_objs)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If possible without gigantic scope creep, I would prefer to get rid of std::lists.

(But obviously getting things working quickly is a bigger priority.)

Comment thread src/rgw/rgw_rados.cc
remove_objs,
&arg);

// TODO: it would be really cool to knock the completion manager

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the purpose of the async-work-to-be.

@rzarzynski
rzarzynski force-pushed the wip-rgw-bilog-in-cls_fifo2 branch from 26e22b8 to 8f54ee4 Compare October 21, 2020 13:16
@rzarzynski

Copy link
Copy Markdown
Contributor Author

Continuing in the wip-rgw-bilog-in-cls_fifo_reader branch.

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