diff options
author | Sami Hiltunen <shiltunen@gitlab.com> | 2020-11-11 21:57:22 +0300 |
---|---|---|
committer | Sami Hiltunen <shiltunen@gitlab.com> | 2020-11-19 18:39:49 +0300 |
commit | 720fe6dd7dd7429f5ee91f4eef37fffc872a3018 (patch) | |
tree | 8518601a7fa6937d512fa696867689e7ccadef5e /cmd/praefect/main.go | |
parent | 381df30b1b49b9fcfbc1e4107a106a70f1403c7d (diff) |
fetch host node assignments from the database
In preparation for variable replication factor, Praefect gained support
for assigning host nodes for repositories in 243dc385.
The PerRepositoryRouter uses host assignments to determine which nodes
should participate in transactions or get replicated to a given write.
This commit adds a Postgres implementation of AssignmentGetter interface.
This allows the PerRepositoryRouter to get host node assignments from
the database to only include assigned nodes in transactions and
replications.
Diffstat (limited to 'cmd/praefect/main.go')
-rw-r--r-- | cmd/praefect/main.go | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/cmd/praefect/main.go b/cmd/praefect/main.go index 78f597443..df4505bb9 100644 --- a/cmd/praefect/main.go +++ b/cmd/praefect/main.go @@ -300,7 +300,7 @@ func run(cfgs []starter.Config, conf config.Config) error { hm, praefect.NewLockedRandom(rand.New(rand.NewSource(time.Now().UnixNano()))), rs, - praefect.StaticStorageAssignments(conf.StorageNames()), + datastore.NewAssignmentStore(db, conf.StorageNames()), ) } else { healthChecker = praefect.HealthChecker(nodeManager) |