Skip to content
Snippets Groups Projects
Commit c5444ac4 authored by Irene Y Zhang's avatar Irene Y Zhang
Browse files

piping proposed transaction timestimp through to server and back for TAPIR

parent cd3706f4
No related branches found
No related tags found
No related merge requests found
......@@ -75,14 +75,20 @@ Server::ExecConsensusUpcall(const string &str1, string &str2)
Request request;
Reply reply;
int status;
Timestamp proposed;
request.ParseFromString(str1);
switch (request.op()) {
case tapirstore::proto::Request::PREPARE:
status = store->Prepare(request.txnid(),
Transaction(request.prepare().txn()));
Transaction(request.prepare().txn()),
Timestamp(request.prepare().timestamp()),
proposed);
reply.set_status(status);
if (proposed.isValid()) {
reply.set_timestamp(proposed.getTimestamp());
}
reply.SerializeToString(&str2);
break;
default:
......
......@@ -157,6 +157,7 @@ ShardClient::Prepare(uint64_t id, const Transaction &txn,
request.set_op(Request::PREPARE);
request.set_txnid(id);
txn.serialize(request.mutable_prepare()->mutable_txn());
timestamp.serialize(request.mutable_prepare()->mutable_timestamp());
request.SerializeToString(&request_str);
transport->Timer(0, [=]() {
......
......@@ -9,7 +9,7 @@ message GetMessage {
message PrepareMessage {
required TransactionMessage txn = 1;
optional uint64 timestamp = 2;
optional TimestampMessage timestamp = 2;
}
message CommitMessage {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment