#include "include/compat.h"
#include "common/cmdparse.h"
+#include "mon/MonClient.h"
#include "osdc/Objecter.h"
#include "json_spirit/json_spirit_value.h"
PG(o, curmap, _pool, p, oid, ioid),
snapset_contexts_lock("ReplicatedPG::snapset_contexts"),
temp_created(false),
- temp_coll(coll_t::make_temp_coll(p)), snap_trimmer_machine(this)
+ temp_coll(coll_t::make_temp_coll(p)),
+ temp_seq(0),
+ snap_trimmer_machine(this)
{
snap_trimmer_machine.initiate();
}
return temp_coll;
}
+hobject_t ReplicatedPG::generate_temp_object()
+{
+ ostringstream ss;
+ ss << "temp_" << info.pgid << "_" << get_role() << "_" << osd->monc->get_global_id() << "_" << (++temp_seq);
+ hobject_t hoid(object_t(ss.str()), "", CEPH_NOSNAP, 0, -1, "");
+ dout(20) << __func__ << " " << hoid << dendl;
+ return hoid;
+}
+
int ReplicatedPG::prepare_transaction(OpContext *ctx)
{
assert(!ctx->ops.empty());
};
map<hobject_t, PullInfo> pulling;
- // Track contents of temp collection, clear on reset
- set<hobject_t> temp_contents;
-
ObjectRecoveryInfo recalc_subsets(const ObjectRecoveryInfo& recovery_info);
static void trim_pushed_data(const interval_set<uint64_t> ©_subset,
const interval_set<uint64_t> &intervals_received,
private:
bool temp_created;
coll_t temp_coll;
+ set<hobject_t> temp_contents; ///< contents of temp collection, clear on reset
+ uint64_t temp_seq; ///< last id for naming temp objects
coll_t get_temp_coll(ObjectStore::Transaction *t);
+ hobject_t generate_temp_object(); ///< generate a new temp object name
public:
bool have_temp_coll();
coll_t get_temp_coll() {