Exemplo n.º 1
0
// InternalResolveIntent resolves a write intent from the specified key
// according to the status of the transaction which created it.
func (r *Range) InternalResolveIntent(batch engine.Engine, ms *engine.MVCCStats, args *proto.InternalResolveIntentRequest, reply *proto.InternalResolveIntentResponse) {
	if args.Txn == nil {
		reply.SetGoError(util.Errorf("no transaction specified to InternalResolveIntent"))
		return
	}
	reply.SetGoError(engine.MVCCResolveWriteIntent(batch, ms, args.Key, args.Timestamp, args.Txn))
}
Exemplo n.º 2
0
// InternalResolveIntent updates the transaction status and heartbeat
// timestamp after receiving transaction heartbeat messages from
// coordinator.  The range will return the current status for this
// transaction to the coordinator.
func (r *Range) InternalResolveIntent(args *proto.InternalResolveIntentRequest, reply *proto.InternalResolveIntentResponse) {
	if len(args.EndKey) == 0 || bytes.Equal(args.Key, args.EndKey) {
		reply.SetGoError(r.mvcc.ResolveWriteIntent(args.Key, args.Txn))
	} else {
		_, err := r.mvcc.ResolveWriteIntentRange(args.Key, args.EndKey, 0, args.Txn)
		reply.SetGoError(err)
	}
}
Exemplo n.º 3
0
// InternalResolveIntent updates the transaction status and heartbeat
// timestamp after receiving transaction heartbeat messages from
// coordinator.  The range will return the current status for this
// transaction to the coordinator.
func (r *Range) InternalResolveIntent(args *proto.InternalResolveIntentRequest, reply *proto.InternalResolveIntentResponse) {
	reply.SetGoError(util.Error("unimplemented"))
}
Exemplo n.º 4
0
// InternalResolveIntent updates the transaction status and heartbeat
// timestamp after receiving transaction heartbeat messages from
// coordinator.  The range will return the current status for this
// transaction to the coordinator.
func (r *Range) InternalResolveIntent(args *proto.InternalResolveIntentRequest, reply *proto.InternalResolveIntentResponse) {
	reply.SetGoError(r.mvcc.ResolveWriteIntent(args.Key, args.Txn, args.Commit))
}