while (1) {
lock_protocol::lockid_t lid;
revoke_fifo.deq(&lid);
- LOG("Revoking " << lid);
+ LOG << "Revoking " << lid;
if (rsm_ && !rsm_->amiprimary())
continue;
if (proxy) {
int r;
auto ret = (rlock_protocol::status)proxy->call(rlock_protocol::revoke, r, lid, held_by.second);
- LOG("Revoke returned " << ret);
+ LOG << "Revoke returned " << ret;
}
}
}
if (rsm_ && !rsm_->amiprimary())
continue;
- LOG("Sending retry for " << lid);
+ LOG << "Sending retry for " << lid;
lock_state & st = get_lock_state(lid);
holder_t front;
{
if (proxy) {
int r;
auto ret = (rlock_protocol::status)proxy->call(rlock_protocol::retry, r, lid, front.second);
- LOG("Retry returned " << ret);
+ LOG << "Retry returned " << ret;
}
}
}
lock_protocol::status lock_server::acquire(int &, lock_protocol::lockid_t lid, const callback_t & id, lock_protocol::xid_t xid) {
- LOG("lid=" << lid << " client=" << id << "," << xid);
+ LOG << "lid=" << lid << " client=" << id << "," << xid;
holder_t h = holder_t(id, xid);
lock_state & st = get_lock_state(lid);
lock sl(st.m);
return lock_protocol::RPCERR;
else if (old_xid == xid) {
if (st.held && st.held_by == h) {
- LOG("Client " << id << " sent duplicate acquire xid=" << xid);
+ LOG << "Client " << id << " sent duplicate acquire xid=" << xid;
return lock_protocol::OK;
}
}
st.held = true;
st.held_by = h;
- LOG("Lock " << lid << " held by " << h.first);
+ LOG << "Lock " << lid << " held by " << h.first;
if (st.wanted_by.size())
revoke_fifo.enq(lid);
return lock_protocol::OK;
if (p.first == id) {
// make sure client is obeying serialization
if (p.second != xid) {
- LOG("Client " << id << " sent acquire xid=" << xid << " with in-progress xid=" << p.second);
+ LOG << "Client " << id << " sent acquire xid=" << xid << " with in-progress xid=" << p.second;
return lock_protocol::RPCERR;
}
found = true;
if (!found)
st.wanted_by.push_back(h);
- LOG("wanted_by=" << st.wanted_by);
+ LOG << "wanted_by=" << st.wanted_by;
// send revoke if we're first in line
if (st.wanted_by.front() == h)
}
lock_protocol::status lock_server::release(int &, lock_protocol::lockid_t lid, const callback_t & id, lock_protocol::xid_t xid) {
- LOG("lid=" << lid << " client=" << id << "," << xid);
+ LOG << "lid=" << lid << " client=" << id << "," << xid;
lock_state & st = get_lock_state(lid);
lock sl(st.m);
if (st.held && st.held_by == holder_t(id, xid)) {
st.held = false;
- LOG("Lock " << lid << " not held");
+ LOG << "Lock " << lid << " not held";
}
if (st.wanted_by.size())
retry_fifo.enq(lid);
}
lock_protocol::status lock_server::stat(int & r, lock_protocol::lockid_t lid, const callback_t &) {
- LOG("stat request for " << lid);
+ LOG << "stat request for " << lid;
VERIFY(0);
r = nacquire;
return lock_protocol::OK;