#define CEPH_FEATURE_OSD_FADVISE_FLAGS (1ULL<<46)
#define CEPH_FEATURE_OSD_REPOP (1ULL<<46) /* overlap with fadvise */
#define CEPH_FEATURE_OSD_OBJECT_DIGEST (1ULL<<46) /* overlap with fadvise */
+#define CEPH_FEATURE_OSD_TRANSACTION_MAY_LAYOUT (1ULL<<46) /* overlap w/ fadvise */
#define CEPH_FEATURE_MDS_QUOTA (1ULL<<47)
#define CEPH_FEATURE_RESERVED2 (1ULL<<61) /* slow down, we are almost out... */
CEPH_FEATURE_OSD_FADVISE_FLAGS | \
CEPH_FEATURE_OSD_REPOP | \
CEPH_FEATURE_OSD_OBJECT_DIGEST | \
+ CEPH_FEATURE_OSD_TRANSACTION_MAY_LAYOUT | \
CEPH_FEATURE_MDS_QUOTA | \
0ULL)
void set_fadvise_flag(uint32_t flag) {
data.fadvise_flags = data.fadvise_flags | flag;
}
-
uint32_t get_fadvise_flags() { return data.fadvise_flags; }
+ void set_use_tbl(bool value) {
+ use_tbl = value;
+ }
+ bool get_use_tbl() {
+ return use_tbl;
+ }
+
void swap(Transaction& other) {
std::swap(data, other.data);
std::swap(on_applied, other.on_applied);
// etc.
Transaction() :
osr(NULL),
- use_tbl(true),
+ use_tbl(false),
coll_id(0),
object_id(0) { }
Transaction(bufferlist::iterator &dp) :
osr(NULL),
- use_tbl(true),
+ use_tbl(false),
coll_id(0),
object_id(0) {
decode(dp);
Transaction(bufferlist &nbl) :
osr(NULL),
- use_tbl(true),
+ use_tbl(false),
coll_id(0),
object_id(0) {
bufferlist::iterator dp = nbl.begin();
i != get_parent()->get_actingbackfill_shards().end();
++i) {
trans[i->shard];
+ trans[i->shard].set_use_tbl(parent->transaction_use_tbl());
}
op->t->generate_transactions(
op->unstable_hash_infos,
virtual uint64_t min_peer_features() const = 0;
+ virtual bool transaction_use_tbl() = 0;
+
virtual void send_message_osd_cluster(
int peer, Message *m, epoch_t from_epoch) = 0;
virtual void send_message_osd_cluster(
return coll;
}
public:
- RPGTransaction(coll_t coll, coll_t temp_coll)
+ RPGTransaction(coll_t coll, coll_t temp_coll, bool use_tbl)
: coll(coll), temp_coll(temp_coll), t(new ObjectStore::Transaction), written(0)
- {}
+ {
+ t->set_use_tbl(use_tbl);
+ }
/// Yields ownership of contained transaction
ObjectStore::Transaction *get_transaction() {
PGBackend::PGTransaction *ReplicatedBackend::get_transaction()
{
- return new RPGTransaction(coll, get_temp_coll());
+ return new RPGTransaction(coll, get_temp_coll(), parent->transaction_use_tbl());
}
class C_OSD_OnOpCommit : public Context {
op_t);
ObjectStore::Transaction local_t;
+ local_t.set_use_tbl(op_t->get_use_tbl());
if (t->get_temp_added().size()) {
get_temp_coll(&local_t);
add_temp_objs(t->get_temp_added());
bufferlist::iterator p = m->get_data().begin();
::decode(rm->opt, p);
+ rm->localt.set_use_tbl(rm->opt.get_use_tbl());
if (m->new_temp_oid != hobject_t()) {
dout(20) << __func__ << " start tracking temp " << m->new_temp_oid << dendl;
return get_min_peer_features();
}
+ bool transaction_use_tbl() {
+ uint64_t min_features = get_min_peer_features();
+ return !(min_features & CEPH_FEATURE_OSD_TRANSACTION_MAY_LAYOUT);
+ }
+
void send_message_osd_cluster(
int peer, Message *m, epoch_t from_epoch);
void send_message_osd_cluster(