#include "common/Clock.h"
#include "common/strtol.h"
#include "common/escape.h"
+#include "common/config_proxy.h"
#include "include/compat.h"
#include <boost/lexical_cast.hpp>
{
CLS_LOG(1, "entered %s", __func__);
+ const ConfigProxy& conf = cls_get_config(hctx);
+
bufferlist header_bl;
rgw_bucket_dir_header header;
bool header_changed = false;
return rc;
}
+ const uint64_t config_op_expiration =
+ conf->rgw_pending_bucket_index_op_expiration;
+
+ // priority order -- 1) bucket header, 2) global config, 3) DEFAULT;
+ // a value of zero indicates go down the list
timespan tag_timeout(
std::chrono::seconds(
- header.tag_timeout ? header.tag_timeout : CEPH_RGW_TAG_TIMEOUT));
+ header.tag_timeout ?
+ header.tag_timeout :
+ (config_op_expiration ?
+ config_op_expiration :
+ CEPH_RGW_DEFAULT_TAG_TIMEOUT)));
auto in_iter = in->cbegin();
if (header_changed) {
return write_bucket_header(hctx, &header);
}
+
return 0;
-}
+} // rgw_dir_suggest_changes
static int rgw_obj_remove(cls_method_context_t hctx, bufferlist *in, bufferlist *out)
{
#define CEPH_RGW_REMOVE 'r'
#define CEPH_RGW_UPDATE 'u'
-#define CEPH_RGW_TAG_TIMEOUT 120
#define CEPH_RGW_DIR_SUGGEST_LOG_OP 0x80
#define CEPH_RGW_DIR_SUGGEST_OP_MASK 0x7f
+constexpr uint64_t CEPH_RGW_DEFAULT_TAG_TIMEOUT = 120; // in seconds
+
class JSONObj;
using ceph::operator <<;
services:
- rgw
with_legacy: true
+- name: rgw_pending_bucket_index_op_expiration
+ type: uint
+ level: advanced
+ default: 120
+ desc: Number of seconds a pending operation can remain in bucket index shard.
+ long_desc: Number of seconds a pending operation can remain in bucket
+ index shard before it expires. Used for transactional bucket index
+ operations, and if the operation does not complete in this time
+ period, the operation will be dropped.
+ services:
+ - rgw
+ - osd
+ with_legacy: true
#define dout_context g_ceph_context
#define dout_subsys ceph_subsys_rgw
-#define BUCKET_TAG_TIMEOUT 30
+// seconds for timeout during RGWBucket::check_object_index
+constexpr uint64_t BUCKET_TAG_QUICK_TIMEOUT = 30;
using namespace std;
return -EINVAL;
}
- bucket->set_tag_timeout(dpp, BUCKET_TAG_TIMEOUT);
+ // use a quicker/shorter tag timeout during this process
+ bucket->set_tag_timeout(dpp, BUCKET_TAG_QUICK_TIMEOUT);
rgw::sal::Bucket::ListResults results;
results.is_truncated = true;
formatter->close_section();
+ // restore normal tag timeout for bucket
bucket->set_tag_timeout(dpp, 0);
return 0;