-
Notifications
You must be signed in to change notification settings - Fork 457
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
use less neon_local --pageserver-config-override
/ pageserver -c
#7613
Merged
problame
merged 22 commits into
main
from
problame/test-suite-narrow-pageserver-config-override
May 6, 2024
Merged
use less neon_local --pageserver-config-override
/ pageserver -c
#7613
problame
merged 22 commits into
main
from
problame/test-suite-narrow-pageserver-config-override
May 6, 2024
Conversation
This file contains 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
…side of `neon_local init` The `NeonCli.init()` persists the non-default pageserver config values for remote storage & `NeonEnvBuilder.pageserver_config_override` in `pageserver.toml`. We don't need to repeat them on each pageserver start after that.
…blame/test-suite-narrow-pageserver-config-override
This allows inlining append_pageserver_param_overrides into NeonCli.init()
…ng init, not start
2904 tests run: 2784 passed, 0 failed, 120 skipped (full report)Code coverage* (full report)
* collected from Rust tests only The comment gets automatically updated with the latest test results
35b23cb at 2024-05-06T17:56:22.283Z :recycle: |
…age during init, not start" This reverts commit 511f593.
problame
changed the title
refactor(test_suite): rely less on
refactor: use less May 4, 2024
--pageserver-config-override
outside of neon_local init
--pageserver-config-override
problame
changed the title
refactor: use less
refactor!: use less May 5, 2024
--pageserver-config-override
--pageserver-config-override
problame
changed the title
refactor!: use less
use less May 5, 2024
--pageserver-config-override
neon_local --pageserver-config-override
/ pageserver -c
koivunej
approved these changes
May 6, 2024
koivunej
reviewed
May 6, 2024
Base automatically changed from
problame/remove-pageserver-update-config-flag
to
main
May 6, 2024 14:40
skyzh
approved these changes
May 6, 2024
problame
added a commit
that referenced
this pull request
May 7, 2024
Preceding PR #7613 reduced the usage of `--pageserver-config-override`. This PR builds on top of that work and fully removes the `neon_local --pageserver-config-override`. Tests that need a non-default `pageserver.toml` control it using two options: 1. Specify `NeonEnvBuilder.pageserver_config_override` before `NeonEnvBuilder.init_start()`. This uses a new `neon_local init --pageserver-config` flag. 2. After `init_start()`: `env.pageserver.stop()` + `NeonPageserver.edit_config_toml()` + `env.pageserver.start()` A few test cases were using `env.pageserver.start(overrides=("--pageserver-config-override...",))`. I changed them to use one of the options above. Future Work ----------- The `neon_local init --pageserver-config` flag still uses `pageserver --config-override` under the hood. In the future, neon_local should just write the `pageserver.toml` directly. The `NeonEnvBuilder.pageserver_config_override` field should be renamed to `pageserver_initial_config`. Let's save this churn for a separate refactor commit.
conradludgate
pushed a commit
that referenced
this pull request
May 8, 2024
conradludgate
pushed a commit
that referenced
this pull request
May 8, 2024
Preceding PR #7613 reduced the usage of `--pageserver-config-override`. This PR builds on top of that work and fully removes the `neon_local --pageserver-config-override`. Tests that need a non-default `pageserver.toml` control it using two options: 1. Specify `NeonEnvBuilder.pageserver_config_override` before `NeonEnvBuilder.init_start()`. This uses a new `neon_local init --pageserver-config` flag. 2. After `init_start()`: `env.pageserver.stop()` + `NeonPageserver.edit_config_toml()` + `env.pageserver.start()` A few test cases were using `env.pageserver.start(overrides=("--pageserver-config-override...",))`. I changed them to use one of the options above. Future Work ----------- The `neon_local init --pageserver-config` flag still uses `pageserver --config-override` under the hood. In the future, neon_local should just write the `pageserver.toml` directly. The `NeonEnvBuilder.pageserver_config_override` field should be renamed to `pageserver_initial_config`. Let's save this churn for a separate refactor commit.
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.
Background
The
pageserver
binary provides a-c
/--config-override
flag.During PS startup, the argument is parsed as TOML and merged non-recursively into the in-memory representation of
pageserver.toml
.The merge result is then turned into the global
PageServerConfig
(parse_and_validate()
).The
pageserver
binary provides an--init
flag.It is used by
neon_local init
to write out the initialpageserver.toml
.I.e.,
neon_local init
under the hood callspageserver --init
.neon_local init
uses thepageserver
binary's--config-override
flag to customize thepageserver.toml
that is written bypageserver --init
.I.e.,
neon_local init
under the hood callspageserver --init --config-override ...
.Last,
neon_local init
itself has a--pageserver-config-override
, allowingneon_local
users to pass through additional overrides to thepageserver
binary invocation.I.e.,
neon_local init --pageserver-config-override X
maps topageserver --init --config-override X
.The
neon_local start
also has a--pageserver-config-override
flag, which is likewise passed through to thepageserver
binary.Problem
neon_local
uses--pageserver-config-override
to propagate some configuration values from its.neon/config
file.For example, it does that for
pg_distrib_dir
or the defaultremote_storage
settings.Presumably, the idea back in the days was that this allows changing variables like listen IP and port "centrally" in the
.neon/config
, and then a simpleneon_local stop
&& neon_local start` would suffice to make the effect happen.I argue that we should remove this functionality, and this PR takes the first step.
The rationale is that, while it's a nice convenience feature, I think it's very rarely used in practice, and thus it does not justify the maintenance burden / cognitive complexity.
Additional arguments in favor of removal:
.neon/config
. It's not a generic mechansim. New code has to be written for each field..neon/config +
neon_local stop && neon_local_start, the change to
.neon/configgets applied *at runtime*, but
pageserver.tomlon disk doesn't get updated. One has to inspect the pageserver command line to understand what's going on, e.g., using
ps -ef | grep pageserver`.Changes
This PR makes changes to the test suite and
neon_local
such that--pageserver-config-override
is used only duringNeonCli.init
/neon_local init
.As pointed out in the "Background" section, any overrides specified during init are stored in the
pageserver.toml
.This means they don't need to repeated when starting the Pageserver with
NeonCli.pageserver_start
/neon_local start
/neon_local pageserver start
.This is a BREAKING CHANGE with regard to
neon_local
semantics in the sense that the variables in the.neon/config
pertaining Pageserver are no longer the source of truth. Instead, they are mere copies that, if there's a need to change them, must be changed in both places.neon_local
changes:PageServerNode::start_node
, only pass through the--pageserver-config-override
flags provided on the command line, not the ones derived from.neon/config
.neon_local_overrides()
is now only used byPageServerNode::pageserver_init()
. We don't inline it because it bloats the diff in an ugly way, can be done in a future commit.--config-override
instead of-c
for better greppability.Test suite changes:
append_pageserver_param_overrides
fromNeonCli.pageserver_start()
append_pageserver_param_overrides
intoNeonCli.init()
NEON_PAGESERVER_OVERRIDES
is no longer supported (it's not used in any committed code in the GitHub Neon org anyways)Future Work
Item A: In a following PR, I will remove the remaining use of
neon_local --pageserver-config-overrides
in the test suite, replacing it with simple rewriting of thepageserver.toml
.Item B: The neon_local's
PageServerNode::init()
can do the TOML patching itself, instead of using the clunkypageserver --config-override
That is the ultimate goal of my PR series: removing
--config-override
entirely.