|
@@ -481,21 +481,21 @@ func (s *Session) executeBatch(batch *Batch) (*Iter, error) {
|
|
|
iter, err = conn.executeBatch(batch)
|
|
iter, err = conn.executeBatch(batch)
|
|
|
batch.totalLatency += time.Now().Sub(t).Nanoseconds()
|
|
batch.totalLatency += time.Now().Sub(t).Nanoseconds()
|
|
|
batch.attempts++
|
|
batch.attempts++
|
|
|
- //Exit loop if operation executed correctly
|
|
|
|
|
|
|
+
|
|
|
|
|
+ // Update host
|
|
|
|
|
+ host.Mark(err)
|
|
|
|
|
+
|
|
|
|
|
+ // Exit loop if operation executed correctly
|
|
|
if err == nil {
|
|
if err == nil {
|
|
|
- host.Mark(err)
|
|
|
|
|
- return iter, err
|
|
|
|
|
|
|
+ break
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- // Mark host as OK
|
|
|
|
|
- host.Mark(nil)
|
|
|
|
|
-
|
|
|
|
|
if batch.rt == nil || !batch.rt.Attempt(batch) {
|
|
if batch.rt == nil || !batch.rt.Attempt(batch) {
|
|
|
break
|
|
break
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- return nil, err
|
|
|
|
|
|
|
+ return iter, err
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
// ExecuteBatch executes a batch operation and returns nil if successful
|
|
// ExecuteBatch executes a batch operation and returns nil if successful
|