Add secondary lag message on Git push over HTTP
Perhaps it is possible during git-push-over-HTTP for a primary to know the push request came via a redirect from the secondary.
If so, we could add the replication lag there, along with a message like:
Current replication lag to SECONDARYNAME is 2 minutes. This message is not sent on git pull over HTTP due to protocol limitations. You can change your remote to use git over SSH to receive current replication lag on git pull. See DOCUMENTATION_LINK for more information.
We could possibly add a query string param / different endpoint as the URL to redirect to which would allow us to detect the original request was directed at the secondary. It should be possible. Definitely add as a follow up issue IMO as this issue is about fetch/pull so it would make sense to have one specifically for push.
- Add a current replication lag message on push to secondary
What does success look like, and how can we measure that?
$ git push [master b7e3005] Update README.md 1 file changed, 1 insertion(+) warning: redirecting to http://localhost:3001/-/geo-node-referrer/4/twitter/typeahead-js.git/ Enumerating objects: 5, done. Counting objects: 100% (5/5), done. Delta compression using up to 8 threads Compressing objects: 100% (3/3), done. Writing objects: 100% (3/3), 969 bytes | 969.00 KiB/s, done. Total 3 (delta 2), reused 0 (delta 0) remote: remote: Current replication lag: 9 seconds remote: To http://localhost:3002/twitter/typeahead-js.git 1e8b0c6..b7e3005 master -> master