Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitaly.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Okstad <pokstad@gitlab.com>2020-07-03 18:55:05 +0300
committerPaul Okstad <pokstad@gitlab.com>2020-07-03 18:55:05 +0300
commit4411f8ef16dc6a77c705e048e10dfc924ad48a34 (patch)
tree871d1734201384d836d37057d3a5b22d3e674faa /internal/praefect/transactions
parentde246fc4268b1db216a348f01f37f54907b21635 (diff)
Error forwarded mutator RPCs on replication job enqueue failure
Diffstat (limited to 'internal/praefect/transactions')
-rw-r--r--internal/praefect/transactions/manager.go5
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
}