diff options
author | Patrick Steinhardt <psteinhardt@gitlab.com> | 2020-09-24 14:36:14 +0300 |
---|---|---|
committer | Patrick Steinhardt <psteinhardt@gitlab.com> | 2020-09-24 14:41:07 +0300 |
commit | aa59dc2b5b730c9d68e5fc904d4289ae2b7bb55a (patch) | |
tree | 3d57049c788b011666d502f7a525d7f6b844daed /internal/praefect | |
parent | 7a7acd2b436329310dfb3b8d8b730a4d632d04b2 (diff) |
transactions: Remove service-specific feature flags
When implementing transactions initially, we not only added a feature
flag for reference transactions in total, but also service-specific ones
to allow for additional flexibility in case any of the services got
broken by transactions. Turns out we had at least one of those cases,
but those feature flags ended up unused and haven't been used ever
since.
Given that those flags don't seem to be that useful and that impacted
services work just fine with reference transactions enabled, this commit
completely removes those service-specific flags. The flag disabling
transactions altogether is left intact.
Diffstat (limited to 'internal/praefect')
-rw-r--r-- | internal/praefect/coordinator.go | 29 |
1 files changed, 10 insertions, 19 deletions
diff --git a/internal/praefect/coordinator.go b/internal/praefect/coordinator.go index 4d13dd54e..3d752512b 100644 --- a/internal/praefect/coordinator.go +++ b/internal/praefect/coordinator.go @@ -192,31 +192,22 @@ func (c *Coordinator) accessorStreamParameters(ctx context.Context, call grpcCal }, nil, nil, nil), nil } -var transactionRPCs = map[string]featureflag.FeatureFlag{ - "/gitaly.OperationService/UserCreateBranch": featureflag.ReferenceTransactionsOperationService, - "/gitaly.OperationService/UserCreateTag": featureflag.ReferenceTransactionsOperationService, - "/gitaly.OperationService/UserDeleteBranch": featureflag.ReferenceTransactionsOperationService, - "/gitaly.OperationService/UserDeleteTag": featureflag.ReferenceTransactionsOperationService, - "/gitaly.OperationService/UserUpdateBranch": featureflag.ReferenceTransactionsOperationService, - "/gitaly.SSHService/SSHReceivePack": featureflag.ReferenceTransactionsSSHService, - "/gitaly.SmartHTTPService/PostReceivePack": featureflag.ReferenceTransactionsSmartHTTPService, +var transactionRPCs = map[string]interface{}{ + "/gitaly.OperationService/UserCreateBranch": nil, + "/gitaly.OperationService/UserCreateTag": nil, + "/gitaly.OperationService/UserDeleteBranch": nil, + "/gitaly.OperationService/UserDeleteTag": nil, + "/gitaly.OperationService/UserUpdateBranch": nil, + "/gitaly.SSHService/SSHReceivePack": nil, + "/gitaly.SmartHTTPService/PostReceivePack": nil, } func shouldUseTransaction(ctx context.Context, method string) bool { if !featureflag.IsEnabled(ctx, featureflag.ReferenceTransactions) { return false } - - flag, ok := transactionRPCs[method] - if !ok { - return false - } - - if !featureflag.IsEnabled(ctx, flag) { - return false - } - - return true + _, ok := transactionRPCs[method] + return ok } func (c *Coordinator) registerTransaction(ctx context.Context, primary Node, secondaries []Node) (*transactions.Transaction, transactions.CancelFunc, error) { |