} else {
prefix = rule.get_prefix();
}
-
if (rule.get_filter().has_tags()){
op.obj_tags = rule.get_filter().get_tags();
}
+ op.rule_flags = rule.get_filter().get_flags();
prefix_map.emplace(std::move(prefix), std::move(op));
return true;
}
worker->workpool->drain();
return 0;
-}
+} /* RGWLC::handle_multipart_expiration */
static int read_obj_tags(const DoutPrefixProvider *dpp, rgw::sal::Object* obj, bufferlist& tags_bl)
{
|| !op.noncur_transitions.empty()));
}
+static bool zone_check(const lc_op& op, rgw::sal::Zone* zone)
+{
+
+ if (zone->get_tier_type() == "archive") {
+ return (op.rule_flags & uint32_t(LCFlagType::ArchiveZone));
+ } else {
+ return (! (op.rule_flags & uint32_t(LCFlagType::ArchiveZone)));
+ }
+}
+
static inline bool has_all_tags(const lc_op& rule_action,
const RGWObjTags& object_tags)
{
return -1;
}
+ /* fetch information for zone checks */
+ rgw::sal::Zone* zone = store->get_zone();
+
auto pf = [](RGWLC::LCWorker* wk, WorkQ* wq, WorkItem& wi) {
auto wt =
boost::get<std::tuple<LCOpRule, rgw_bucket_dir_entry>>(wi);
LCObjsLister ol(store, bucket.get());
ol.set_prefix(prefix_iter->first);
+ if (! zone_check(op, zone)) {
+ ldpp_dout(this, 7) << "LC rule not executable in " << zone->get_tier_type()
+ << " zone, skipping" << dendl;
+ continue;
+ }
+
ret = ol.init(this);
if (ret < 0) {
if (ret == (-ENOENT))
return 0;
- ldpp_dout(this, 0) << "ERROR: store->list_objects():" <<dendl;
+ ldpp_dout(this, 0) << "ERROR: store->list_objects():" << dendl;
return ret;
}
return obj_tags;
}
- const uint32_t get_flags() {
+ const uint32_t get_flags() const {
return flags;
}
boost::optional<RGWObjTags> obj_tags;
std::map<std::string, transition_action> transitions;
std::map<std::string, transition_action> noncur_transitions;
+ uint32_t rule_flags;
/* ctors are nice */
lc_op() = delete;