diff options
author | Paul Okstad <pokstad@gitlab.com> | 2020-07-03 18:55:05 +0300 |
---|---|---|
committer | Paul Okstad <pokstad@gitlab.com> | 2020-07-03 18:55:05 +0300 |
commit | 4411f8ef16dc6a77c705e048e10dfc924ad48a34 (patch) | |
tree | 871d1734201384d836d37057d3a5b22d3e674faa /internal/praefect/transactions | |
parent | de246fc4268b1db216a348f01f37f54907b21635 (diff) |
Error forwarded mutator RPCs on replication job enqueue failure
Diffstat (limited to 'internal/praefect/transactions')
-rw-r--r-- | internal/praefect/transactions/manager.go | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/internal/praefect/transactions/manager.go b/internal/praefect/transactions/manager.go index 25248caac..9f7b5f8ae 100644 --- a/internal/praefect/transactions/manager.go +++ b/internal/praefect/transactions/manager.go @@ -103,7 +103,7 @@ func (mgr *Manager) log(ctx context.Context) logrus.FieldLogger { // CancelFunc is the transaction cancellation function returned by // `RegisterTransaction`. Calling it will cause the transaction to be removed // from the transaction manager. -type CancelFunc func() +type CancelFunc func() error // RegisterTransaction registers a new reference transaction for a set of nodes // taking part in the transaction. `threshold` is the threshold at which an @@ -136,8 +136,9 @@ func (mgr *Manager) RegisterTransaction(ctx context.Context, voters []Voter, thr mgr.counterMetric.WithLabelValues("registered").Inc() - return transactionID, func() { + return transactionID, func() error { mgr.cancelTransaction(transactionID, transaction) + return nil }, nil } |