-
Notifications
You must be signed in to change notification settings - Fork 853
Start up server HTTP interface earlier #16181
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
Conversation
* Start up HTTP interface of servers earlier, so that ping probes from tools can already be responded to when the server is not fully started. Previously, the HTTP interface of a server was only openend after a successful recovery procedure, but the recovery procedure can take time proportional to the amount of data to recover. In order to make servers respond to probes quickly after a restart, the HTTP interface is now opened earlier in the startup sequence. When a server is not through the successful recovery procedure yet, it will respond to _all_ requests with an HTTP response code 503 and an "errorNum" value of 503 as well, so that callers can see that the server is not fully ready.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Provisionally, this look good to me. I have to look a bit more closely tomorrow, for example, I would like to inspect the feature dependency graph in this branch to see where the GeneralServerFeature
now sits. But all in all, this looks good. We should now talk to Adam to find out what information we should deliver in what way during the startup.
@@ -129,6 +129,8 @@ std::shared_ptr<RestHandler> RestHandlerFactory::createHandler( | |||
|
|||
void RestHandlerFactory::addHandler(std::string const& path, create_fptr func, | |||
void* data) { | |||
WRITE_LOCKER(locker, _lock); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh je, war das ungeschützter Verkehr?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It was fine before, because previously we added all handlers before the HTTP interface was opened.
So no other thread could concurrently access the list of handlers.
…n-http-interface-earlier
…n-http-interface-earlier
…n-http-interface-earlier
…n-http-interface-earlier
…n-http-interface-earlier
…n-http-interface-earlier
…n-http-interface-earlier
…n-http-interface-earlier
…n-http-interface-earlier
…godb/arangodb into feature/open-http-interface-earlier
…n-http-interface-earlier
…n-http-interface-earlier
…n-http-interface-earlier
…n-http-interface-earlier
…n-http-interface-earlier
…n-http-interface-earlier
…n-http-interface-earlier
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. See one comment about an additional comment. Can be ignored.
…n-http-interface-earlier
…n-http-interface-earlier
* docs PR for arangodb/arangodb#16181 * Update 3.10/release-notes-api-changes310.md Co-authored-by: Max Neunhöffer <max@arangodb.com> * Update general.md * adding suggested change to 3.10/release-notes-api-changes310.md Co-authored-by: Simran <Simran-B@users.noreply.github.com> * adding suggested change to 3.10/release-notes-api-changes310.md Co-authored-by: Simran <Simran-B@users.noreply.github.com> * adding suggested changes to 3.10/release-notes-api-changes310.md Co-authored-by: Simran <Simran-B@users.noreply.github.com> * Review, shorten release notes * Remove JSF_ prefix from DocuBlock name * moved detailed description to the main doc * removed duplicated info from the release notes * Update release-notes-api-changes310.md * Update examples for 3.10 in feature/open-http-interface-earlier at 2022-06-29T09:14:37+00:00 Co-authored-by: Max Neunhöffer <max@arangodb.com> Co-authored-by: ansoboleva <93702078+ansoboleva@users.noreply.github.com> Co-authored-by: Simran <Simran-B@users.noreply.github.com> Co-authored-by: Simran Spiller <simran@arangodb.com> Co-authored-by: arangodb-release-bot <anastasia.soboleva@arangodb.com>
Scope & Purpose
Docs PR: arangodb/docs#994
Enterprise companion PR: https://github.com/arangodb/enterprise/pull/931
from tools can already be responded to when the server is not fully started.
By default, the HTTP interface is opened at the same point during the startup
sequence as before, but it can optionally be opened earlier by setting the
new startup option
--server.early-connections
totrue
. This willopen the HTTP interface early in the startup, so that the server can respond
to a limited set of REST APIs even during recovery. This can be useful
because the recovery procedure can take time proportional to the amount of
data to recover.
When the
--server.early-connections
option is set totrue
, theserver will respond to requests to the following APIs during the startup
already:
/_api/version
/_admin/version
/_admin/status
All other APIs will be responded to with an HTTP response code 503, so that
callers can see that the server is not fully ready.
If authentication is used, then only JWT authentication can be used during
the early startup phase. Incoming requests relying on other authentication
mechanisms that require access to the database data will also be responded to
with HTTP 503 errors, even if correct credentials are used.
The API
/_admin/status
now also returns aprogress
attribute that shows the server's current state (starting, stopping, etc.), with details about which feature is currently started, stopped. If the server spends a long time in the WAL recovery, the current WAL recovery sequence number is also reported in a sub-attribute. Clients can query the attribute to track the progress of the WAL recovery.Checklist
Related Information