- exponential backoff on monitor resend attempts (actually, this should go outside the messenger!)
objectcacher
+- merge clean bh's
- ocacher caps transitions vs locks
- test read locks
}
+
+//char *hackbuf = 0;
+
+
// blocking osd interface
int Client::read(int fd, char *buf, off_t size, off_t offset)
if (g_conf.client_oc) {
// object cache ON
rvalue = r = in->fc.read(offset, size, *bl, client_lock); // may block.
+
+ /*
+ if (in->inode.ino == 0x10000000075 && hackbuf) {
+ int s = MIN(size, bl->length());
+ char *v = bl->c_str();
+ for (int a=0; a<s; a++)
+ if (v[a] != hackbuf[offset+a])
+ dout(1) << "** hackbuf differs from read value at offset " << a
+ << " hackbuf[a] = " << (int)hackbuf[a] << ", read got " << (int)v[a]
+ << endl;
+ }
+ */
+
} else {
// object cache OFF -- legacy inconsistent way.
return r;
}
+
int Client::_write(Fh *f, off_t offset, off_t size, const char *buf)
{
//dout(7) << "write fh " << fh << " size " << size << " offset " << offset << endl;
if (g_conf.client_oc) { // buffer cache ON?
assert(objectcacher);
+ /*
+ if (f->inode->inode.ino == 0x10000000075) {
+ if (!hackbuf) {
+ dout(7) << "alloc and zero new hackbuf" << endl;
+ hackbuf = new char[16384];
+ memset(hackbuf, 0, 16384);
+ }
+ dout(7) << "hackbuf copying " << offset << "~" << size << " first is " << (int)buf[0] << endl;
+ memcpy(hackbuf+offset, buf, size);
+ for (int a=0; a<size; a++)
+ dout(10) << "hackbuf[" << (a+offset) << " = " << (int)hackbuf[a+offset] << " = " << (int)buf[a] << endl;
+ }
+ */
+
// write (this may block!)
in->fc.write(offset, size, blist, client_lock);
-
+
} else {
// legacy, inconsistent synchronous write.
dout(7) << "synchronous write" << endl;
osd_pad_pg_log: false,
// --- fakestore ---
- fakestore_fake_sync: 2, // 2 seconds
+ fakestore_fake_sync: .5, // seconds
fakestore_fsync: false,//true,
fakestore_writesync: false,
fakestore_syncthreads: 4,
int osd_max_pull;
bool osd_pad_pg_log;
- int fakestore_fake_sync;
+ double fakestore_fake_sync;
bool fakestore_fsync;
bool fakestore_writesync;
int fakestore_syncthreads; // such crap
if (bl.length() == 0) {
zleft += len;
left = 0;
+ } else {
+ assert(bl.length() == len);
}
if (zleft)
- dout(10) << "apply_write zeroing first " << zleft << " bytes of " << *on << endl;
+ dout(10) << "apply_write zeroing " << zleft << " bytes before " << off << "~" << len
+ << " in " << *on << endl;
block_t blast = (len+off-1) / EBOFS_BLOCK_SIZE;
block_t blen = blast-bstart+1;
bufferlist zb;
zb.push_back(zp);
bh->add_partial(off_in_bh, zb);
- zleft -= z;
+ zleft -= z;
opos += z;
}
// start up fuse
// use my argc, argv (make sure you pass a mount point!)
- cout << "starting fuse on pid " << getpid() << endl;
client[i]->mount();
char *oldcwd = get_current_dir_name(); // note previous wd
+ cout << "starting fuse on pid " << getpid() << endl;
if (g_conf.fuse_ll)
ceph_fuse_ll_main(client[i], argc, argv);
else
ceph_fuse_main(client[i], argc, argv);
+ cout << "fuse finished on pid " << getpid() << endl;
::chdir(oldcwd); // return to previous wd
free(oldcwd);
client[i]->unmount();
- cout << "fuse finished on pid " << getpid() << endl;
client[i]->shutdown();
}
last_sent(s),
last_recv(s),
suppress(false) {
- //cap_history[last_sent] = 0;
}
Capability(Export& other) :
wanted_caps(other.wanted),
out << "osd_op(" << st.reqid
<< " " << get_opname(st.op)
<< " " << st.oid;
+ if (st.length) out << " " << st.offset << "~" << st.length;
if (st.retry_attempt) out << " RETRY";
out << ")";
}
out << "osd_op_reply(" << st.reqid
<< " " << MOSDOp::get_opname(st.op)
<< " " << st.oid;
+ if (st.length) out << " " << st.offset << "~" << st.length;
if (st.commit)
out << " commit";
else
void FakeStore::sync(Context *onsafe)
{
- if (g_conf.fakestore_fake_sync) {
+ if (g_conf.fakestore_fake_sync > 0.0) {
g_timer.add_event_after((float)g_conf.fakestore_fake_sync,
new C_FakeSync(onsafe, &unsync, &synclock, &synccond));