compatible.

This commit is contained in:
zhangxiao871 2022-02-22 11:10:14 +08:00
parent b7c3327d5b
commit ad124a4d10
3 changed files with 4 additions and 3 deletions

View File

@ -264,8 +264,8 @@ nuraft::ptr<nuraft::buffer> getZooKeeperLogEntry(int64_t session_id, int64_t tim
{
DB::WriteBufferFromNuraftBuffer buf;
DB::writeIntBinary(session_id, buf);
DB::writeIntBinary(time, buf);
request->write(buf);
DB::writeIntBinary(time, buf);
return buf.getBuffer();
}

View File

@ -22,7 +22,6 @@ namespace
ReadBufferFromNuraftBuffer buffer(data);
KeeperStorage::RequestForSession request_for_session;
readIntBinary(request_for_session.session_id, buffer);
readIntBinary(request_for_session.time, buffer);
int32_t length;
Coordination::read(length, buffer);
@ -37,6 +36,8 @@ namespace
request_for_session.request = Coordination::ZooKeeperRequestFactory::instance().get(opnum);
request_for_session.request->xid = xid;
request_for_session.request->readImpl(buffer);
readIntBinary(request_for_session.time, buffer);
return request_for_session;
}
}

View File

@ -1218,10 +1218,10 @@ nuraft::ptr<nuraft::buffer> getBufferFromZKRequest(int64_t session_id, const Coo
{
DB::WriteBufferFromNuraftBuffer buf;
DB::writeIntBinary(session_id, buf);
request->write(buf);
using namespace std::chrono;
auto time = duration_cast<milliseconds>(system_clock::now().time_since_epoch()).count();
DB::writeIntBinary(time, buf);
request->write(buf);
return buf.getBuffer();
}