diff --git a/CHANGELOG.md b/CHANGELOG.md index 9c7a3a06..d7cee7ed 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,10 @@ # Changelog +## Unreleased + +- Gemini now tries to perform mutation on both systems regardless of + if one of them fail. + ## [1.0.1] - 2019-05-16 - Gemini ensures that primary key buckets do not overflow int32. diff --git a/session.go b/session.go index 6984ea32..a628a318 100644 --- a/session.go +++ b/session.go @@ -54,14 +54,14 @@ func (s *Session) Close() { s.oracleSession.Close() } -func (s *Session) Mutate(query string, values ...interface{}) error { +func (s *Session) Mutate(query string, values ...interface{}) (e error) { if err := s.testSession.Query(query, values...).Exec(); err != nil { - return fmt.Errorf("%v [cluster = test, query = '%s']", err, query) + e = multierr.Append(e, fmt.Errorf("%v [cluster = test, query = '%s']", err, query)) } if err := s.oracleSession.Query(query, values...).Exec(); err != nil { - return fmt.Errorf("%v [cluster = oracle, query = '%s']", err, query) + e = multierr.Append(e, fmt.Errorf("%v [cluster = oracle, query = '%s']", err, query)) } - return nil + return } func (s *Session) Check(table Table, query string, values ...interface{}) (err error) { @@ -69,10 +69,10 @@ func (s *Session) Check(table Table, query string, values ...interface{}) (err e oracleIter := s.oracleSession.Query(query, values...).Iter() defer func() { if e := testIter.Close(); e != nil { - err = multierr.Append(err, errors.Errorf("test system failed: %s", err.Error())) + err = multierr.Append(err, errors.Errorf("test system failed: %s", e.Error())) } if e := oracleIter.Close(); e != nil { - err = multierr.Append(err, errors.Errorf("oracle failed: %s", err.Error())) + err = multierr.Append(err, errors.Errorf("oracle failed: %s", e.Error())) } }()