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

Add backup mongo URLs #213

Merged
merged 7 commits into from Sep 9, 2020
Merged

Add backup mongo URLs #213

merged 7 commits into from Sep 9, 2020

Conversation

JoranAngevaare
Copy link
Contributor

@JoranAngevaare JoranAngevaare commented Sep 8, 2020

What is the problem / what does the code in this PR do
Use Chicago and xenon1t-daq.lngs.infn.it as backup mongo instances for fried-rice.

Use fried-rice always as the first default as that is accessible outside dali

Can you briefly describe how it works?
Try to connect to fried-rice, if it doesn't use a backup_mongo_url

Can you give a minimal working example (or illustrate with a figure)?

import strax
import straxen

RunDB = <see PR>

st = strax.Context(
        config=straxen.contexts.xnt_common_config,
        **straxen.contexts.common_opts)
username = straxen.get_secret('rundb_username')
password = straxen.get_secret('rundb_password')
st.storage = [RunDB(
        readonly=True,
        runid_field='number',
        new_data_path='./strax_data',
)
             ]
st.storage[0].client['xenonnt'].command('ping')

Difference with #212
Rather than having all tree in a single URL we split it to a to stage initialization. Otherwise if not on dali it cannot find the primary host.

@ershockley
Copy link
Contributor

If we want to go this route it makes more sense to use the Chicago mirror as the default IMO -- it's much closer to midway/dali. I also don't get why this is a preferred method to #212?

@JoranAngevaare
Copy link
Contributor Author

Evan and I had a chat, here is an example showing that the approach in #212 fails because mongo cannot decide on who is primary. This PR (213) is a patch rather than the solution to the problem that is shown in the appended gist.

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.

None yet

2 participants