#define CEPH_OSD_PROTOCOL 5 /* cluster internal */
#define CEPH_MDS_PROTOCOL 9 /* cluster internal */
#define CEPH_MON_PROTOCOL 4 /* cluster internal */
-#define CEPH_OSDC_PROTOCOL 10 /* public/client */
+#define CEPH_OSDC_PROTOCOL 11 /* public/client */
#define CEPH_MDSC_PROTOCOL 20 /* public/client */
#define CEPH_MONC_PROTOCOL 12 /* public/client */
CEPH_OSD_FLAG_ONNVRAM = 2, /* want (or is) "onnvram" ack */
CEPH_OSD_FLAG_ONDISK = 4, /* want (or is) "ondisk" ack */
CEPH_OSD_FLAG_RETRY = 8, /* resend attempt */
- CEPH_OSD_FLAG_INCLOCK_FAIL = 16, /* fail on inclock collision */
CEPH_OSD_FLAG_MODIFY = 32, /* op is/was a mutation */
CEPH_OSD_FLAG_ORDERSNAP = 64, /* EOLDSNAP if snapc is out of order */
CEPH_OSD_FLAG_PEERSTAT = 128, /* msg includes osd_peer_stat */
__le32 osdmap_epoch;
__le32 flags;
- __le32 inc_lock;
struct ceph_timespec mtime;
struct ceph_eversion reassert_version;
// tell objecter my incarnation
if (objecter->get_client_incarnation() != incarnation)
objecter->set_client_incarnation(incarnation);
- // and inc_lock
- objecter->set_inc_lock(mdsmap->get_last_failure());
// for debug
if (g_conf.mds_dump_cache_on_map)
// base map
epoch_t epoch;
epoch_t client_epoch; // incremented only when change is significant to client.
- epoch_t last_failure; // epoch of last failure. for inclocks
+ epoch_t last_failure; // epoch of last failure
utime_t created, modified;
int32_t tableserver; // which MDS has anchortable, snaptable
*
*/
-#define EINCLOCKED 100
-
class MOSDOp : public Message {
private:
ceph_osd_request_head head;
bool is_modify() { return head.flags & CEPH_OSD_FLAG_MODIFY; }
- unsigned get_inc_lock() const { return head.inc_lock; }
-
void set_peer_stat(const osd_peer_stat_t& stat) {
peer_stat = stat;
head.flags = (head.flags | CEPH_OSD_FLAG_PEERSTAT);
}
MOSDOp() {}
- void set_inc_lock(__u32 l) { head.inc_lock = l; }
void set_layout(const ceph_object_layout& l) { head.layout = l; }
void set_version(eversion_t v) { head.reassert_version = v; }
void set_mtime(utime_t mt) { head.mtime = mt; }
state = STATE_PROBING;
C_ProbeEnd *fin = new C_ProbeEnd(this);
filer.probe(ino, &layout, CEPH_NOSNAP,
- h.write_pos, (__u64 *)&fin->end, 0, true, CEPH_OSD_FLAG_INCLOCK_FAIL, fin);
+ h.write_pos, (__u64 *)&fin->end, 0, true, 0, fin);
}
void Journaler::_finish_probe_end(int r, __s64 end)
filer.write(ino, &layout, snapc,
flush_pos, len, write_bl, g_clock.now(),
- CEPH_OSD_FLAG_INCLOCK_FAIL,
+ 0,
onack, onsafe);
flush_pos += len;
<< dendl;
filer.read(ino, &layout, CEPH_NOSNAP,
- requested_pos, len, &reading_buf, CEPH_OSD_FLAG_INCLOCK_FAIL,
+ requested_pos, len, &reading_buf, 0,
new C_Read(this));
requested_pos += len;
}
SnapContext snapc;
filer.remove(ino, &layout, snapc,
- trimming_pos, trim_to-trimming_pos, g_clock.now(), CEPH_OSD_FLAG_INCLOCK_FAIL,
+ trimming_pos, trim_to-trimming_pos, g_clock.now(), 0,
NULL, new C_Trim(this, trim_to));
trimming_pos = trim_to;
}
m->set_snapid(rd->snap);
m->ops = rd->ops;
m->set_data(rd->bl);
- if (inc_lock > 0) {
- rd->inc_lock = inc_lock;
- m->set_inc_lock(inc_lock);
- }
m->set_retry_attempt(rd->attempts++);
int who = pg.acker();
pg.active_tids.erase(tid);
if (pg.active_tids.empty()) close_pg( m->get_pg() );
- // fail?
- if (m->get_result() == -EINCLOCKED &&
- rd->flags & CEPH_OSD_FLAG_INCLOCK_FAIL) {
- dout(7) << " got -EINCLOCKED, failing" << dendl;
- if (rd->onfinish) {
- rd->onfinish->finish(-EINCLOCKED);
- delete rd->onfinish;
- }
- delete rd;
- delete m;
- return;
- }
-
// success?
- if (m->get_result() == -EAGAIN ||
- m->get_result() == -EINCLOCKED) {
- dout(7) << " got -EAGAIN or -EINCLOCKED, resubmitting" << dendl;
+ if (m->get_result() == -EAGAIN) {
+ dout(7) << " got -EAGAIN resubmitting" << dendl;
read_submit(rd);
delete m;
return;
m->set_mtime(wr->mtime);
m->set_snap_seq(wr->snapc.seq);
m->get_snaps() = wr->snapc.snaps;
- if (inc_lock > 0) {
- wr->inc_lock = inc_lock;
- m->set_inc_lock(inc_lock);
- }
m->set_retry_attempt(wr->attempts++);
if (wr->version != eversion_t())
}
int rc = 0;
- if (m->get_result() == -EINCLOCKED && wr->flags & CEPH_OSD_FLAG_INCLOCK_FAIL) {
- dout(7) << " got -EINCLOCKED, failing" << dendl;
- rc = -EINCLOCKED;
- if (wr->onack) {
- onack = wr->onack;
- wr->onack = 0;
- num_unacked--;
- }
- if (wr->oncommit) {
- oncommit = wr->oncommit;
- wr->oncommit = 0;
- num_uncommitted--;
- }
- goto done;
- }
- if (m->get_result() == -EAGAIN ||
- m->get_result() == -EINCLOCKED) {
- dout(7) << " got -EAGAIN or -EINCLOCKED, resubmitting" << dendl;
+ if (m->get_result() == -EAGAIN) {
+ dout(7) << " got -EAGAIN, resubmitting" << dendl;
if (wr->onack) num_unacked--;
if (wr->oncommit) num_uncommitted--;
modify_submit(wr);
num_uncommitted--;
}
- // done?
- done:
-
// done with this tid?
if (!wr->onack && !wr->oncommit) {
assert(pg.active_tids.count(tid));
private:
tid_t last_tid;
int client_inc;
- int inc_lock; // optional
int num_unacked;
int num_uncommitted;
tid_t tid;
int attempts;
- int inc_lock;
bool paused;
ReadOp(object_t o, ceph_object_layout& ol, vector<ceph_osd_op>& op, snapid_t s, int f, Context *of) :
oid(o), layout(ol), snap(s),
pbl(0), flags(f), onfinish(of),
- tid(0), attempts(0), inc_lock(-1),
+ tid(0), attempts(0),
paused(false) {
ops.swap(op);
}
tid_t tid;
int attempts;
- int inc_lock;
eversion_t version;
bool paused;
ModifyOp(object_t o, ceph_object_layout& l, vector<ceph_osd_op>& op, utime_t mt,
const SnapContext& sc, int f, Context *ac, Context *co) :
oid(o), layout(l), snapc(sc), mtime(mt), flags(f), onack(ac), oncommit(co),
- tid(0), attempts(0), inc_lock(-1),
+ tid(0), attempts(0),
paused(false) {
ops.swap(op);
}
public:
Objecter(Messenger *m, MonMap *mm, OSDMap *om, Mutex& l) :
messenger(m), monmap(mm), osdmap(om),
- last_tid(0), client_inc(-1), inc_lock(0),
+ last_tid(0), client_inc(-1),
num_unacked(0), num_uncommitted(0),
last_epoch_requested(0),
client_lock(l), timer(l)
int get_client_incarnation() const { return client_inc; }
void set_client_incarnation(int inc) { client_inc = inc; }
- //int get_inc_lock() const { return inc_lock; }
- void set_inc_lock(int l) { inc_lock = l; }
-
// low-level
tid_t read_submit(ReadOp *rd);
tid_t modify_submit(ModifyOp *wr);