Skip to content
This repository was archived by the owner on Jan 13, 2022. It is now read-only.

Add a method of specifying multiple upstream hosts in a Network store#77

Merged
mdordal merged 1 commit intofacebookarchive:masterfrom
chrisjbray:multi_upstream
Dec 20, 2013
Merged

Add a method of specifying multiple upstream hosts in a Network store#77
mdordal merged 1 commit intofacebookarchive:masterfrom
chrisjbray:multi_upstream

Conversation

@chrisjbray
Copy link
Contributor

A small extension to NetworkStore to allow SMC-like multiple upstreams, but specified as a space-delimited list in the config file.

scribed will connect to one of the upstreams and continue to use it until it fails, then reconnect to a different one and backfill from the secondary store automatically.

src/store.cpp Outdated
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can do iter->find() here, which is probably clearer.

@mdordal
Copy link
Contributor

mdordal commented Dec 10, 2013

Also, more generally, what did you do to test this?

@chrisjbray
Copy link
Contributor Author

As for testing, I just built it and ran it, saw that it connected to a random machine each time I started scribed, I used a slightly modified scribecat to tail a file to it, confirmed it was passing traffic, then killed the scribed on the upstream machine, saw that scribed reconnected to a different upstream, repeated a few times then left it tailing for ~12 hours. As far as I can tell no ill effects.

src/store.cpp Outdated
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It might be clearer if though if loadFromList took an out parameter like network_config::getService does above.

@chrisjbray
Copy link
Contributor Author

I agree, changed to out parameters like the getService

mdordal added a commit that referenced this pull request Dec 20, 2013
Add a method of specifying multiple upstream hosts in a Network store
@mdordal mdordal merged commit 6483913 into facebookarchive:master Dec 20, 2013
@anton-povarov
Copy link

this doesn't work when you only have default store, because NetworkStore::copy() never copes serviceList member.
fix:

  • store->serviceList = serviceList;

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants