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:
authorWill Chandler <wchandler@gitlab.com>2021-05-27 21:41:01 +0300
committerjramsay <wchandler@gitlab.com>2021-05-28 06:15:55 +0300
commit7f7273e5ff35d99feefec87260495d22bfc7682d (patch)
tree052de5166c25d05634fb276393136a32d873ead1
parent7da5e5123d3ce18d45f60f101109c4aeafecc958 (diff)
nodes: Mention gitaly in 'ErrPrimaryNotHealthy'
Gitaly errors messages will be shown to end-users in the web UI. Without knowing that the error message for 'ErrPrimaryNotHealthy' is from Praefect, it's difficult for users to understand what 'primary' is referring to. Let's mention that Gitaly is the source of the failure to make this less confusing. Changelog: changed
-rw-r--r--internal/praefect/coordinator_test.go6
-rw-r--r--internal/praefect/nodes/manager.go2
2 files changed, 4 insertions, 4 deletions
diff --git a/internal/praefect/coordinator_test.go b/internal/praefect/coordinator_test.go
index 0b3c28b7a..371046653 100644
--- a/internal/praefect/coordinator_test.go
+++ b/internal/praefect/coordinator_test.go
@@ -1293,7 +1293,7 @@ func TestStreamDirectorStorageScopeError(t *testing.T) {
require.Equal(t, "virtual storage does not exist", result.Message())
})
- t.Run("primary is not healthy", func(t *testing.T) {
+ t.Run("primary gitaly is not healthy", func(t *testing.T) {
t.Run("accessor", func(t *testing.T) {
mgr := &nodes.MockManager{
GetShardFunc: func(s string) (nodes.Shard, error) {
@@ -1323,7 +1323,7 @@ func TestStreamDirectorStorageScopeError(t *testing.T) {
result, ok := status.FromError(err)
require.True(t, ok)
require.Equal(t, codes.Internal, result.Code())
- require.Equal(t, `accessor storage scoped: route storage accessor "fake": primary is not healthy`, result.Message())
+ require.Equal(t, `accessor storage scoped: route storage accessor "fake": primary gitaly is not healthy`, result.Message())
})
t.Run("mutator", func(t *testing.T) {
@@ -1354,7 +1354,7 @@ func TestStreamDirectorStorageScopeError(t *testing.T) {
result, ok := status.FromError(err)
require.True(t, ok)
require.Equal(t, codes.Internal, result.Code())
- require.Equal(t, `mutator storage scoped: get shard "fake": primary is not healthy`, result.Message())
+ require.Equal(t, `mutator storage scoped: get shard "fake": primary gitaly is not healthy`, result.Message())
})
})
}
diff --git a/internal/praefect/nodes/manager.go b/internal/praefect/nodes/manager.go
index 87351e56e..7966a740d 100644
--- a/internal/praefect/nodes/manager.go
+++ b/internal/praefect/nodes/manager.go
@@ -113,7 +113,7 @@ type leaderElectionStrategy interface {
// ErrPrimaryNotHealthy indicates the primary of a shard is not in a healthy state and hence
// should not be used for a new request
-var ErrPrimaryNotHealthy = errors.New("primary is not healthy")
+var ErrPrimaryNotHealthy = errors.New("primary gitaly is not healthy")
const dialTimeout = 10 * time.Second