-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Log when MAP_POPULATE gets disabled #28526
Conversation
CI Results: |
Build Results: |
@@ -447,6 +451,7 @@ func NewRaftBackend(conf map[string]string, logger log.Logger) (physical.Backend | |||
} | |||
} | |||
|
|||
// Create the log store. |
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.
I added this to match the comment up above where we explain that we're creating the FSM. Helps people like me who are new to the concept that Vault has two different databases that need to be created.
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.
Looks good! Just a few small comments about one of the tests.
…corp/vault into VAULT-23020/log_when_mmap_disabled
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.
Description
This PR adds a log line during the log store and FSM setup process that warns when Linux's MAP_POPULATE flag for mmap has been disabled. (That flag populates page tables ahead of time before we try to open a database file, which helps limit page faults and thus speeds up the process.)
Without this log message, the Vault process appears to hang for a long period of time while it tries to open up a large database. This log line will help warn users so they don't just think Vault is being broken and unresponsive.
Note that the
unix.MAP_POPULATE
flag is only available on Linux, so Go won't compile if I reference it in files that don't end in_linux.go
, hence the slight gymnastics.I've also added some comments to help noobs to these concepts like myself understand how this flag is used.
TODO only if you're a HashiCorp employee
to N, N-1, and N-2, using the
backport/ent/x.x.x+ent
labels. If this PR is in the CE repo, you should only backport to N, using thebackport/x.x.x
label, not the enterprise labels.of a public function, even if that change is in a CE file, double check that
applying the patch for this PR to the ENT repo and running tests doesn't
break any tests. Sometimes ENT only tests rely on public functions in CE
files.
in the PR description, commit message, or branch name.
description. Also, make sure the changelog is in this PR, not in your ENT PR.