Skip to content
Snippets Groups Projects
Commit 0f12367f authored by Vladimir Davydov's avatar Vladimir Davydov Committed by Vladimir Davydov
Browse files

replication: pass uris instead of appliers to replicaset_connect

Historically, we create appliers in box.cc and then pass them to
replicaset_connect. Now, that we have struct uri_set, it's better
to pass URIs instead of appliers and let replicaset_connect create
appliers. It looks better because replicaset_connect may actually
delete some of the passed appliers on success, which makes the
function protocol difficult for understanding. Another reason to
pass URIs instead of appliers is that we need to store the configured
URIs in replication.cc so that we can detect the case when box.cfg
doesn't change box.cfg.replication (required for SSL certificate
update).

While we are at it,
 - Make replica_set_applier and replica_clear_applier static.
 - Mark the URI argument of applier_new as const and copy it instead
   of moving. This isn't a hot path and with copying it's easier to
   make assumptions about object lifetime.
 - Remove the error label from replicaset_connect. Use a guard instead.

Needed for tarantool/tarantool-ee#432

NO_DOC=refactoring
NO_TEST=refactoring
NO_CHANGELOG=refactoring
parent b56a7ead
No related branches found
No related tags found
No related merge requests found
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment