8000 Start up server HTTP interface earlier by jsteemann · Pull Request #16181 · arangodb/arangodb · GitHub
[go: up one dir, main page]

Skip to content

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

Merged
merged 41 commits into from
May 19, 2022

Conversation

jsteemann
Copy link
Contributor
@jsteemann jsteemann commented Apr 27, 2022

Scope & Purpose

Docs PR: arangodb/docs#994
Enterprise companion PR: https://github.com/arangodb/enterprise/pull/931

  • Optionally 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.
    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 to true. This will
    open 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 to true, the
    server 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 a progress 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.

  • 💩 Bugfix
  • 🍕 New feature
  • 🔥 Performance improvement
  • 🔨 Refactoring/simplification

Checklist

  • Tests
    • Regression tests
    • C++ Unit tests
    • integration tests
    • resilience tests
  • 📖 CHANGELOG entry made
  • 📚 documentation written (release notes, API changes, ...)
  • Backports
    • Backport for 3.9: -
    • Backport for 3.8: -
    • Backport for 3.7: -

Related Information

* 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.
@jsteemann jsteemann added this to the devel milestone Apr 27, 2022
Copy link
Member
@neunhoef neunhoef left a 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);
Copy link
Member

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?

Copy link
Contributor Author

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.

…godb/arangodb into feature/open-http-interface-earlier
@jsteemann jsteemann marked this pull request as ready for review May 17, 2022 14:19
@jsteemann jsteemann requested review from a team as code owners May 17, 2022 14:19
jsteemann added a commit to arangodb/docs that referenced this pull request May 17, 2022
@jsteemann jsteemann requested a review from a team May 18, 2022 16:18
Copy link
Member
@neunhoef neunhoef left a 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.

@jsteemann jsteemann merged commit f7c63f8 into devel May 19, 2022
@jsteemann jsteemann deleted the feature/open-http-interface-earlier branch May 19, 2022 13:42
ansoboleva added a commit to arangodb/docs that referenced this pull request Jun 29, 2022
* 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>
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.

2 participants
0