fix: default Postgres to io_method=worker instead of io_uring#6630
Merged
Conversation
io_uring forces seccomp=unconfined and fails on hardened kernels (kernel.io_uring_disabled=2) or when RLIMIT_MEMLOCK is low, surfacing as "could not setup io_uring queue: Cannot allocate memory" regardless of available RAM. Switch both compose files to Postgres 18's default io_method=worker, which needs no io_uring syscalls, and drop the seccomp=unconfined security downgrade carried only to enable io_uring. Fixes: #6629
|
Claude finished @otavio's task in 54s —— View job Code Review CompleteReviewed 2 files across code quality, security, testing, language patterns, and architecture — no new issues found. The code looks good as-is. A few confirming notes on the change:
To request another review round, comment |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
We ship the Postgres service with
io_method=io_uringforced on, plusseccomp=unconfinedto allow the io_uring syscalls. On some hosts Postgres fails to start with:This
ENOMEMfromio_uring_setupis not a lack of RAM. The io_uring rings count against the container'sRLIMIT_MEMLOCK, and some kernels ship with io_uring disabled via sysctl (kernel.io_uring_disabled=2, now a default on several hardened distros). Either condition makes the syscall fail regardless of how much memory the box has.io_uringis a fragile default for a self-hosted product that runs on arbitrary kernels and container runtimes.Changes
Switch the default to Postgres 18's own default
io_method=worker(asynchronous I/O via worker processes, no io_uring syscalls) in bothdocker-compose.postgres.ymlanddocker-compose.postgres.test.yml. This also removes the need for thesecurity_opt: seccomp=unconfinedoverride, a security downgrade carried only to enable io_uring. The performance difference from io_uring is marginal for our workload and does not justify the support burden.Related
Fixes #6629
Reported by a self-hoster upgrading to v0.26.0 (#6627).