From 720fe6dd7dd7429f5ee91f4eef37fffc872a3018 Mon Sep 17 00:00:00 2001 From: Sami Hiltunen Date: Wed, 11 Nov 2020 19:57:22 +0100 Subject: 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. --- cmd/praefect/main.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'cmd/praefect/main.go') 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) -- cgit v1.2.3