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:
authorPatrick Steinhardt <psteinhardt@gitlab.com>2023-06-01 14:46:22 +0300
committerPatrick Steinhardt <psteinhardt@gitlab.com>2023-06-02 15:05:59 +0300
commitd31812090b87984a86947c654faaae409a67fe17 (patch)
tree2b861121a8bc9d9b90baee55ab22cee1cec1b7b6
parentbf56aa362f18e5255248f4c34d221175ea9de474 (diff)
praefectutil: Move functionality relating to storage paths
The praefectutil package contains a set of functions that compute and classify repository paths for Praefect's rewritten replica paths. They had to be split out into a separate package given that they're also used by Gitaly code in order to figure out whether a repository is an object pool or not. Furthermore, the code to figure out whether a repository is an object pool or not is also partially contained in the stats package, which adds even more to the confusion as it is now split up across multiple packages. Move the computations for Praefect paths into our storage package. This makes for a better fit as this package should be the only source of truth for where repositories are located anyway, and is already used by both Praefect and Gitaly. The next commit will also move the code from the stats package in here to make the knowledge neatly contained in a single place.
-rw-r--r--internal/git/stats/object_pool.go3
-rw-r--r--internal/git/stats/object_pool_test.go6
-rw-r--r--internal/gitaly/service/repository/create_fork_test.go4
-rw-r--r--internal/gitaly/service/repository/create_repository_from_bundle_test.go4
-rw-r--r--internal/gitaly/service/repository/create_repository_from_snapshot_test.go4
-rw-r--r--internal/gitaly/service/repository/create_repository_from_url_test.go4
-rw-r--r--internal/gitaly/service/repository/create_repository_test.go4
-rw-r--r--internal/gitaly/storage/repository_path.go (renamed from internal/praefect/praefectutil/replica_path.go)16
-rw-r--r--internal/gitaly/storage/repository_path_test.go (renamed from internal/praefect/praefectutil/replica_path_test.go)19
-rw-r--r--internal/praefect/router_per_repository.go6
-rw-r--r--internal/praefect/router_per_repository_test.go28
11 files changed, 48 insertions, 50 deletions
diff --git a/internal/git/stats/object_pool.go b/internal/git/stats/object_pool.go
index 54d6b4c9c..3ca6b9f2c 100644
--- a/internal/git/stats/object_pool.go
+++ b/internal/git/stats/object_pool.go
@@ -5,7 +5,6 @@ import (
"strings"
"gitlab.com/gitlab-org/gitaly/v16/internal/gitaly/storage"
- "gitlab.com/gitlab-org/gitaly/v16/internal/praefect/praefectutil"
)
// railsPoolDirRegexp is used to validate object pool directory structure and name as generated by Rails.
@@ -23,5 +22,5 @@ func IsRailsPoolRepository(repo storage.Repository) bool {
// IsPoolRepository returns whether the repository is an object pool.
func IsPoolRepository(repo storage.Repository) bool {
- return IsRailsPoolRepository(repo) || praefectutil.IsPoolRepository(repo)
+ return IsRailsPoolRepository(repo) || storage.IsPraefectPoolRepository(repo)
}
diff --git a/internal/git/stats/object_pool_test.go b/internal/git/stats/object_pool_test.go
index 44c158caa..941351bb2 100644
--- a/internal/git/stats/object_pool_test.go
+++ b/internal/git/stats/object_pool_test.go
@@ -5,7 +5,7 @@ import (
"github.com/stretchr/testify/require"
"gitlab.com/gitlab-org/gitaly/v16/internal/git/gittest"
- "gitlab.com/gitlab-org/gitaly/v16/internal/praefect/praefectutil"
+ "gitlab.com/gitlab-org/gitaly/v16/internal/gitaly/storage"
"gitlab.com/gitlab-org/gitaly/v16/proto/go/gitalypb"
)
@@ -26,14 +26,14 @@ func TestIsPoolRepository(t *testing.T) {
{
desc: "praefect pool path",
repo: &gitalypb.Repository{
- RelativePath: praefectutil.DerivePoolPath(1),
+ RelativePath: storage.DerivePoolPath(1),
},
isPoolPath: true,
},
{
desc: "praefect replica path",
repo: &gitalypb.Repository{
- RelativePath: praefectutil.DeriveReplicaPath(1),
+ RelativePath: storage.DeriveReplicaPath(1),
},
},
{
diff --git a/internal/gitaly/service/repository/create_fork_test.go b/internal/gitaly/service/repository/create_fork_test.go
index 516ddcdb1..2239322b1 100644
--- a/internal/gitaly/service/repository/create_fork_test.go
+++ b/internal/gitaly/service/repository/create_fork_test.go
@@ -11,9 +11,9 @@ import (
"github.com/stretchr/testify/require"
"gitlab.com/gitlab-org/gitaly/v16/internal/git/gittest"
"gitlab.com/gitlab-org/gitaly/v16/internal/gitaly/config"
+ "gitlab.com/gitlab-org/gitaly/v16/internal/gitaly/storage"
"gitlab.com/gitlab-org/gitaly/v16/internal/helper/perm"
"gitlab.com/gitlab-org/gitaly/v16/internal/helper/text"
- "gitlab.com/gitlab-org/gitaly/v16/internal/praefect/praefectutil"
"gitlab.com/gitlab-org/gitaly/v16/internal/structerr"
"gitlab.com/gitlab-org/gitaly/v16/internal/testhelper"
"gitlab.com/gitlab-org/gitaly/v16/internal/testhelper/testcfg"
@@ -241,7 +241,7 @@ func TestCreateFork_targetExists(t *testing.T) {
// assign in order to ensure this repository creation conflicts even with Praefect in front of it.
// As the source repository created in the setup is the first one, this would get the repository
// ID 2.
- RelativePath: praefectutil.DeriveReplicaPath(2),
+ RelativePath: storage.DeriveReplicaPath(2),
StorageName: repo.StorageName,
}
diff --git a/internal/gitaly/service/repository/create_repository_from_bundle_test.go b/internal/gitaly/service/repository/create_repository_from_bundle_test.go
index e25ada641..7278be7ce 100644
--- a/internal/gitaly/service/repository/create_repository_from_bundle_test.go
+++ b/internal/gitaly/service/repository/create_repository_from_bundle_test.go
@@ -17,10 +17,10 @@ import (
"gitlab.com/gitlab-org/gitaly/v16/internal/git/gittest"
"gitlab.com/gitlab-org/gitaly/v16/internal/git/localrepo"
"gitlab.com/gitlab-org/gitaly/v16/internal/gitaly/config"
+ "gitlab.com/gitlab-org/gitaly/v16/internal/gitaly/storage"
"gitlab.com/gitlab-org/gitaly/v16/internal/gitaly/transaction"
"gitlab.com/gitlab-org/gitaly/v16/internal/grpc/metadata"
"gitlab.com/gitlab-org/gitaly/v16/internal/helper/text"
- "gitlab.com/gitlab-org/gitaly/v16/internal/praefect/praefectutil"
"gitlab.com/gitlab-org/gitaly/v16/internal/tempdir"
"gitlab.com/gitlab-org/gitaly/v16/internal/testhelper"
"gitlab.com/gitlab-org/gitaly/v16/internal/testhelper/testserver"
@@ -267,7 +267,7 @@ func TestCreateRepositoryFromBundle_existingRepository(t *testing.T) {
// we'll use the next replica path Praefect will assign in order to ensure this repository creation conflicts even
// with Praefect in front of it.
repo, _ := gittest.CreateRepository(t, ctx, cfg, gittest.CreateRepositoryConfig{
- RelativePath: praefectutil.DeriveReplicaPath(1),
+ RelativePath: storage.DeriveReplicaPath(1),
Seed: gittest.SeedGitLabTest,
})
diff --git a/internal/gitaly/service/repository/create_repository_from_snapshot_test.go b/internal/gitaly/service/repository/create_repository_from_snapshot_test.go
index 2b3eab4d6..170568b4b 100644
--- a/internal/gitaly/service/repository/create_repository_from_snapshot_test.go
+++ b/internal/gitaly/service/repository/create_repository_from_snapshot_test.go
@@ -18,7 +18,7 @@ import (
"github.com/stretchr/testify/require"
"gitlab.com/gitlab-org/gitaly/v16/internal/git/gittest"
"gitlab.com/gitlab-org/gitaly/v16/internal/gitaly/archive"
- "gitlab.com/gitlab-org/gitaly/v16/internal/praefect/praefectutil"
+ "gitlab.com/gitlab-org/gitaly/v16/internal/gitaly/storage"
"gitlab.com/gitlab-org/gitaly/v16/internal/testhelper"
"gitlab.com/gitlab-org/gitaly/v16/internal/testhelper/testcfg"
"gitlab.com/gitlab-org/gitaly/v16/proto/go/gitalypb"
@@ -135,7 +135,7 @@ func TestCreateRepositoryFromSnapshot_repositoryExists(t *testing.T) {
// we'll use the next replica path Praefect will assign in order to ensure this repository creation
// conflicts even with Praefect in front of it.
repo, _ := gittest.CreateRepository(t, ctx, cfg, gittest.CreateRepositoryConfig{
- RelativePath: praefectutil.DeriveReplicaPath(1),
+ RelativePath: storage.DeriveReplicaPath(1),
Seed: gittest.SeedGitLabTest,
})
diff --git a/internal/gitaly/service/repository/create_repository_from_url_test.go b/internal/gitaly/service/repository/create_repository_from_url_test.go
index f90a63c37..32364a2eb 100644
--- a/internal/gitaly/service/repository/create_repository_from_url_test.go
+++ b/internal/gitaly/service/repository/create_repository_from_url_test.go
@@ -13,9 +13,9 @@ import (
"github.com/stretchr/testify/require"
"gitlab.com/gitlab-org/gitaly/v16/internal/git"
"gitlab.com/gitlab-org/gitaly/v16/internal/git/gittest"
+ "gitlab.com/gitlab-org/gitaly/v16/internal/gitaly/storage"
"gitlab.com/gitlab-org/gitaly/v16/internal/helper/perm"
"gitlab.com/gitlab-org/gitaly/v16/internal/helper/text"
- "gitlab.com/gitlab-org/gitaly/v16/internal/praefect/praefectutil"
"gitlab.com/gitlab-org/gitaly/v16/internal/testhelper"
"gitlab.com/gitlab-org/gitaly/v16/internal/testhelper/testcfg"
"gitlab.com/gitlab-org/gitaly/v16/proto/go/gitalypb"
@@ -125,7 +125,7 @@ func TestCreateRepositoryFromURL_existingTarget(t *testing.T) {
cfg, client := setupRepositoryServiceWithoutRepo(t)
importedRepo := &gitalypb.Repository{
- RelativePath: praefectutil.DeriveReplicaPath(1),
+ RelativePath: storage.DeriveReplicaPath(1),
StorageName: cfg.Storages[0].Name,
}
importedRepoPath := filepath.Join(cfg.Storages[0].Path, importedRepo.GetRelativePath())
diff --git a/internal/gitaly/service/repository/create_repository_test.go b/internal/gitaly/service/repository/create_repository_test.go
index ed7b1130c..06828e213 100644
--- a/internal/gitaly/service/repository/create_repository_test.go
+++ b/internal/gitaly/service/repository/create_repository_test.go
@@ -12,10 +12,10 @@ import (
"gitlab.com/gitlab-org/gitaly/v16/internal/git/gittest"
"gitlab.com/gitlab-org/gitaly/v16/internal/gitaly/config"
"gitlab.com/gitlab-org/gitaly/v16/internal/gitaly/config/auth"
+ "gitlab.com/gitlab-org/gitaly/v16/internal/gitaly/storage"
"gitlab.com/gitlab-org/gitaly/v16/internal/gitaly/transaction"
"gitlab.com/gitlab-org/gitaly/v16/internal/grpc/metadata"
"gitlab.com/gitlab-org/gitaly/v16/internal/helper/text"
- "gitlab.com/gitlab-org/gitaly/v16/internal/praefect/praefectutil"
"gitlab.com/gitlab-org/gitaly/v16/internal/structerr"
"gitlab.com/gitlab-org/gitaly/v16/internal/testhelper"
"gitlab.com/gitlab-org/gitaly/v16/internal/testhelper/testcfg"
@@ -204,7 +204,7 @@ func TestCreateRepository_invalidArguments(t *testing.T) {
// Praefect in front of it, we'll use the next replica path Praefect will assign in
// order to ensure this repository creation conflicts even with Praefect in front of
// it.
- RelativePath: praefectutil.DeriveReplicaPath(1),
+ RelativePath: storage.DeriveReplicaPath(1),
})
for _, tc := range []struct {
diff --git a/internal/praefect/praefectutil/replica_path.go b/internal/gitaly/storage/repository_path.go
index a4380764d..84bf9f033 100644
--- a/internal/praefect/praefectutil/replica_path.go
+++ b/internal/gitaly/storage/repository_path.go
@@ -1,4 +1,4 @@
-package praefectutil
+package storage
import (
"crypto/sha256"
@@ -6,16 +6,14 @@ import (
"path/filepath"
"strconv"
"strings"
-
- "gitlab.com/gitlab-org/gitaly/v16/internal/gitaly/storage"
)
-// poolPathPrefix is the prefix directory where Praefect places object pools.
-const poolPathPrefix = "@cluster/pools/"
+// praefectPoolPathPrefix is the prefix directory where Praefect places object pools.
+const praefectPoolPathPrefix = "@cluster/pools/"
-// IsPoolRepository returns whether the repository is a Praefect generated object pool repository.
-func IsPoolRepository(repo storage.Repository) bool {
- return strings.HasPrefix(repo.GetRelativePath(), poolPathPrefix)
+// IsPraefectPoolRepository returns whether the repository is a Praefect generated object pool repository.
+func IsPraefectPoolRepository(repo Repository) bool {
+ return strings.HasPrefix(repo.GetRelativePath(), praefectPoolPathPrefix)
}
// DeriveReplicaPath derives a repository's disk storage path from its repository ID. The repository ID
@@ -31,7 +29,7 @@ func DeriveReplicaPath(repositoryID int64) string {
// have a different directory prefix from other repositories so Gitaly can identify them in OptimizeRepository
// and avoid pruning them.
func DerivePoolPath(repositoryID int64) string {
- return deriveDiskPath(poolPathPrefix, repositoryID)
+ return deriveDiskPath(praefectPoolPathPrefix, repositoryID)
}
func deriveDiskPath(prefixDir string, repositoryID int64) string {
diff --git a/internal/praefect/praefectutil/replica_path_test.go b/internal/gitaly/storage/repository_path_test.go
index 8b9b51310..fe1568a71 100644
--- a/internal/praefect/praefectutil/replica_path_test.go
+++ b/internal/gitaly/storage/repository_path_test.go
@@ -1,24 +1,25 @@
-package praefectutil
+package storage_test
import (
"testing"
"github.com/stretchr/testify/require"
"gitlab.com/gitlab-org/gitaly/v16/internal/git/gittest"
+ "gitlab.com/gitlab-org/gitaly/v16/internal/gitaly/storage"
"gitlab.com/gitlab-org/gitaly/v16/proto/go/gitalypb"
)
func TestDeriveReplicaPath(t *testing.T) {
- require.Equal(t, "@cluster/repositories/6b/86/1", DeriveReplicaPath(1))
- require.Equal(t, "@cluster/repositories/d4/73/2", DeriveReplicaPath(2))
+ require.Equal(t, "@cluster/repositories/6b/86/1", storage.DeriveReplicaPath(1))
+ require.Equal(t, "@cluster/repositories/d4/73/2", storage.DeriveReplicaPath(2))
}
func TestDerivePoolPath(t *testing.T) {
- require.Equal(t, "@cluster/pools/6b/86/1", DerivePoolPath(1))
- require.Equal(t, "@cluster/pools/d4/73/2", DerivePoolPath(2))
+ require.Equal(t, "@cluster/pools/6b/86/1", storage.DerivePoolPath(1))
+ require.Equal(t, "@cluster/pools/d4/73/2", storage.DerivePoolPath(2))
}
-func TestIsPoolRepository(t *testing.T) {
+func TestIsPraefectPoolRepository(t *testing.T) {
for _, tc := range []struct {
desc string
repo *gitalypb.Repository
@@ -38,14 +39,14 @@ func TestIsPoolRepository(t *testing.T) {
{
desc: "praefect pool path",
repo: &gitalypb.Repository{
- RelativePath: DerivePoolPath(1),
+ RelativePath: storage.DerivePoolPath(1),
},
isPoolPath: true,
},
{
desc: "praefect replica path",
repo: &gitalypb.Repository{
- RelativePath: DeriveReplicaPath(1),
+ RelativePath: storage.DeriveReplicaPath(1),
},
},
{
@@ -56,7 +57,7 @@ func TestIsPoolRepository(t *testing.T) {
},
} {
t.Run(tc.desc, func(t *testing.T) {
- require.Equal(t, tc.isPoolPath, IsPoolRepository(tc.repo))
+ require.Equal(t, tc.isPoolPath, storage.IsPraefectPoolRepository(tc.repo))
})
}
}
diff --git a/internal/praefect/router_per_repository.go b/internal/praefect/router_per_repository.go
index 56726e4e5..489319f47 100644
--- a/internal/praefect/router_per_repository.go
+++ b/internal/praefect/router_per_repository.go
@@ -6,9 +6,9 @@ import (
"fmt"
"gitlab.com/gitlab-org/gitaly/v16/internal/git/stats"
+ "gitlab.com/gitlab-org/gitaly/v16/internal/gitaly/storage"
"gitlab.com/gitlab-org/gitaly/v16/internal/praefect/datastore"
"gitlab.com/gitlab-org/gitaly/v16/internal/praefect/nodes"
- "gitlab.com/gitlab-org/gitaly/v16/internal/praefect/praefectutil"
"gitlab.com/gitlab-org/gitaly/v16/proto/go/gitalypb"
"google.golang.org/grpc"
)
@@ -461,12 +461,12 @@ func (r *PerRepositoryRouter) RouteRepositoryCreation(ctx context.Context, virtu
return RepositoryMutatorRoute{}, fmt.Errorf("reserve repository id: %w", err)
}
- replicaPath := praefectutil.DeriveReplicaPath(id)
+ replicaPath := storage.DeriveReplicaPath(id)
if stats.IsRailsPoolRepository(&gitalypb.Repository{
StorageName: virtualStorage,
RelativePath: relativePath,
}) {
- replicaPath = praefectutil.DerivePoolPath(id)
+ replicaPath = storage.DerivePoolPath(id)
}
return RepositoryMutatorRoute{
diff --git a/internal/praefect/router_per_repository_test.go b/internal/praefect/router_per_repository_test.go
index 0edebace0..75c67a941 100644
--- a/internal/praefect/router_per_repository_test.go
+++ b/internal/praefect/router_per_repository_test.go
@@ -8,10 +8,10 @@ import (
"github.com/stretchr/testify/require"
"gitlab.com/gitlab-org/gitaly/v16/internal/git/gittest"
+ "gitlab.com/gitlab-org/gitaly/v16/internal/gitaly/storage"
"gitlab.com/gitlab-org/gitaly/v16/internal/praefect/commonerr"
"gitlab.com/gitlab-org/gitaly/v16/internal/praefect/datastore"
"gitlab.com/gitlab-org/gitaly/v16/internal/praefect/nodes"
- "gitlab.com/gitlab-org/gitaly/v16/internal/praefect/praefectutil"
"gitlab.com/gitlab-org/gitaly/v16/internal/testhelper"
"gitlab.com/gitlab-org/gitaly/v16/internal/testhelper/testdb"
"google.golang.org/grpc"
@@ -727,7 +727,7 @@ func TestPerRepositoryRouterRouteRepositoryCreation(t *testing.T) {
expectedRoute: requireOneOf(
RepositoryMutatorRoute{
RepositoryID: 1,
- ReplicaPath: praefectutil.DeriveReplicaPath(1),
+ ReplicaPath: storage.DeriveReplicaPath(1),
Primary: RouterNode{Storage: "primary", Connection: primaryConn},
ReplicationTargets: []string{"secondary-1", "secondary-2"},
},
@@ -743,7 +743,7 @@ func TestPerRepositoryRouterRouteRepositoryCreation(t *testing.T) {
expectedRoute: requireOneOf(
RepositoryMutatorRoute{
RepositoryID: 1,
- ReplicaPath: praefectutil.DeriveReplicaPath(1),
+ ReplicaPath: storage.DeriveReplicaPath(1),
Primary: RouterNode{Storage: "primary", Connection: primaryConn},
Secondaries: []RouterNode{
{Storage: "secondary-1", Connection: secondary1Conn},
@@ -762,7 +762,7 @@ func TestPerRepositoryRouterRouteRepositoryCreation(t *testing.T) {
expectedRoute: requireOneOf(
RepositoryMutatorRoute{
RepositoryID: 1,
- ReplicaPath: praefectutil.DeriveReplicaPath(1),
+ ReplicaPath: storage.DeriveReplicaPath(1),
Primary: RouterNode{Storage: "primary", Connection: primaryConn},
Secondaries: []RouterNode{
{Storage: "secondary-1", Connection: secondary1Conn},
@@ -782,7 +782,7 @@ func TestPerRepositoryRouterRouteRepositoryCreation(t *testing.T) {
expectedRoute: requireOneOf(
RepositoryMutatorRoute{
RepositoryID: 1,
- ReplicaPath: praefectutil.DeriveReplicaPath(1),
+ ReplicaPath: storage.DeriveReplicaPath(1),
Primary: RouterNode{Storage: "primary", Connection: primaryConn},
},
),
@@ -799,13 +799,13 @@ func TestPerRepositoryRouterRouteRepositoryCreation(t *testing.T) {
expectedRoute: requireOneOf(
RepositoryMutatorRoute{
RepositoryID: 1,
- ReplicaPath: praefectutil.DeriveReplicaPath(1),
+ ReplicaPath: storage.DeriveReplicaPath(1),
Primary: RouterNode{Storage: "primary", Connection: primaryConn},
Secondaries: []RouterNode{{Storage: "secondary-1", Connection: secondary1Conn}},
},
RepositoryMutatorRoute{
RepositoryID: 1,
- ReplicaPath: praefectutil.DeriveReplicaPath(1),
+ ReplicaPath: storage.DeriveReplicaPath(1),
Primary: RouterNode{Storage: "primary", Connection: primaryConn},
Secondaries: []RouterNode{{Storage: "secondary-2", Connection: secondary1Conn}},
},
@@ -823,7 +823,7 @@ func TestPerRepositoryRouterRouteRepositoryCreation(t *testing.T) {
expectedRoute: requireOneOf(
RepositoryMutatorRoute{
RepositoryID: 1,
- ReplicaPath: praefectutil.DeriveReplicaPath(1),
+ ReplicaPath: storage.DeriveReplicaPath(1),
Primary: RouterNode{Storage: "primary", Connection: primaryConn},
Secondaries: []RouterNode{{Storage: "secondary-1", Connection: secondary1Conn}},
ReplicationTargets: []string{"secondary-2"},
@@ -876,7 +876,7 @@ func TestPerRepositoryRouterRouteRepositoryCreation(t *testing.T) {
expectedRoute: requireOneOf(
RepositoryMutatorRoute{
RepositoryID: 1,
- ReplicaPath: praefectutil.DeriveReplicaPath(1),
+ ReplicaPath: storage.DeriveReplicaPath(1),
AdditionalReplicaPath: "something",
Primary: RouterNode{Storage: "primary", Connection: primaryConn},
},
@@ -893,7 +893,7 @@ func TestPerRepositoryRouterRouteRepositoryCreation(t *testing.T) {
expectedRoute: requireOneOf(
RepositoryMutatorRoute{
RepositoryID: 1,
- ReplicaPath: praefectutil.DeriveReplicaPath(1),
+ ReplicaPath: storage.DeriveReplicaPath(1),
AdditionalReplicaPath: "something",
Primary: RouterNode{Storage: "primary", Connection: primaryConn},
},
@@ -913,7 +913,7 @@ func TestPerRepositoryRouterRouteRepositoryCreation(t *testing.T) {
expectedRoute: requireOneOf(
RepositoryMutatorRoute{
RepositoryID: 1,
- ReplicaPath: praefectutil.DeriveReplicaPath(1),
+ ReplicaPath: storage.DeriveReplicaPath(1),
AdditionalReplicaPath: "something",
Primary: RouterNode{Storage: "primary", Connection: primaryConn},
Secondaries: []RouterNode{
@@ -937,7 +937,7 @@ func TestPerRepositoryRouterRouteRepositoryCreation(t *testing.T) {
expectedRoute: requireOneOf(
RepositoryMutatorRoute{
RepositoryID: 1,
- ReplicaPath: praefectutil.DeriveReplicaPath(1),
+ ReplicaPath: storage.DeriveReplicaPath(1),
AdditionalReplicaPath: "something",
Primary: RouterNode{Storage: "primary", Connection: primaryConn},
Secondaries: []RouterNode{{Storage: "secondary-2", Connection: secondary2Conn}},
@@ -964,7 +964,7 @@ func TestPerRepositoryRouterRouteRepositoryCreation(t *testing.T) {
expectedRoute: requireOneOf(
RepositoryMutatorRoute{
RepositoryID: 1,
- ReplicaPath: praefectutil.DeriveReplicaPath(1),
+ ReplicaPath: storage.DeriveReplicaPath(1),
AdditionalReplicaPath: "something",
Primary: RouterNode{Storage: "primary", Connection: primaryConn},
Secondaries: []RouterNode{{Storage: "secondary-2", Connection: secondary2Conn}},
@@ -988,7 +988,7 @@ func TestPerRepositoryRouterRouteRepositoryCreation(t *testing.T) {
expectedRoute: requireOneOf(
RepositoryMutatorRoute{
RepositoryID: 1,
- ReplicaPath: praefectutil.DeriveReplicaPath(1),
+ ReplicaPath: storage.DeriveReplicaPath(1),
AdditionalReplicaPath: "something",
Primary: RouterNode{Storage: "primary", Connection: primaryConn},
Secondaries: []RouterNode{