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

Web service to sync server's repo with github's repo #174

Open
jar398 opened this issue Apr 14, 2016 · 3 comments
Open

Web service to sync server's repo with github's repo #174

jar398 opened this issue Apr 14, 2016 · 3 comments

Comments

@jar398
Copy link
Member

jar398 commented Apr 14, 2016

Inspired by the Unix 'sync' system call, I think it would be nice if there were a method that atomically
(a) flushed out object (study, collection, etc.) state to server's disk
(b) did a 'git pull' (or fetch+merge) to bring changes made on github back to server's repos + mirrors
The return value would tell you whether there were merge conflicts.

This can be unprivileged - it is safe to do and fairly low cost.

Not sure what to do if there are merge conflicts. Then someone who can log in to the server needs to do a synchronous shutdown (or lock acquire), manually fix the merge, and restart (or unlock).

Part of this discussion on gitter

@mtholder
Copy link
Member

There really isn't any state to be stored to disk (that I am aware of). We'd just need to recreate the in memory indexes after the pull.
This should not be too hard to implement. But given that redeploying should be a reasonable workaround for this behavior (and we rarely need it), this does not seem like a high priority to me.

@jar398
Copy link
Member Author

jar398 commented Apr 15, 2016 via email

@mtholder
Copy link
Member

I don't see how an apache restart would do it. The git_refresh part of the full deploy seems like it would be crucial.

There is locking of the phylesystem-1 repo during write operations. So I don't think we'd interrupt a transaction.The call could come between the lag between committing to the working repo and the push from the mirror to GH. Presumably this web service would be written to lock and attempt a fast-forward merge only, so that if the master on GH was not up-to-date the call would fail. That would probably mean that the lagging push from the mirror would also fail (because presumably this web service would be called when someone had pushed new content to the master branch of GitHub via some tool other than the API). It seems like we'd need a human to sort out such cases, and the phylesystem-api would be blocked from sharing data to GitHub until that happened. A side effect of that would be the OTI index getting stale.

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

No branches or pull requests

2 participants