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
Showing
- src/box/applier.cc 2 additions, 2 deletionssrc/box/applier.cc
- src/box/applier.h 1 addition, 1 deletionsrc/box/applier.h
- src/box/box.cc 1 addition, 15 deletionssrc/box/box.cc
- src/box/replication.cc 24 additions, 21 deletionssrc/box/replication.cc
- src/box/replication.h 3 additions, 10 deletionssrc/box/replication.h
Loading
Please register or sign in to comment