Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP: Standalone mode #201

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

hashbrowncipher
Copy link
Contributor

@jolynch: this branch implements something we had discussed a little while ago, namely a standalone or "oneshot" execution mode for Synapse. This is for situations where you would like to know what information is in Synapse's backing datastore, but you don't want to read it out of the datastore directly in order to preserve separation of concerns. By adding this standalone operation, we can use the same code paths that Synapse would use to read the data.

My initial use-case is monitoring scripts. I would like to deploy a container with the Synapse gem, and run it as a script that produces a list of backends as output. My monitoring script will process this output, check it for sanity, and report issues to my monitoring system if the results are insane.

This change makes use of a new method on watchers, that I've called read. As far as I can tell, right now watchers don't implement any method which provides the list of backends as output without mutating other state. read is designed for that purpose.

So far I've just touched the Zookeeper watcher. Please review for initial feasibility.

Example invocation:

synapse_standalone.rb '{"method":"zookeeper","path":"/nerve/services/postgres_main_read","hosts":["10.74.4.104:2181","10.74.4.70:2181","10.74.1.43:2181"]}'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant