Browse Source

clientv3: retry remote connection on txn write failure

Anthony Romano 10 years ago
parent
commit
a6008f41e2
1 changed files with 3 additions and 2 deletions
  1. 3 2
      clientv3/txn.go

+ 3 - 2
clientv3/txn.go

@@ -143,11 +143,12 @@ func (txn *txn) Commit() (*TxnResponse, error) {
 			return (*TxnResponse)(resp), nil
 		}
 
-		if txn.isWrite {
+		if isRPCError(err) {
 			return nil, err
 		}
 
-		if isRPCError(err) {
+		if txn.isWrite {
+			go kv.switchRemote(err)
 			return nil, err
 		}