Skip to content
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

pageserver config: ignore unknown fields (instead of deny_unknown_fields) #11275

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

problame
Copy link
Contributor

@problame problame commented Mar 17, 2025

Refs

Problem

Rejecting pageserver.tomls with unknown fields adds friction, especially when using pageserver.toml fields as feature flags that need to be decommissioned.

See the added paragraphs on pageserver_api::models::ConfigToml for details on what kind of friction it causes.

Also reed the corresponding internal docs update linked above to see a more imperative guide for using pageserver.toml flags as feature flags.

Solution

Remove serde(deny_unknown_fields) from all structs in pageserver_api::config::ConfigToml pageserver_api::config::TenantConfigToml.

I went through all the child fields and verified they don't use deny_unknown_fields either, including those shared with pageserver_api::models.

TODO

Future Work

Tooling to detect usage of unknown fields:

Copy link

github-actions bot commented Mar 17, 2025

7964 tests run: 7580 passed, 0 failed, 384 skipped (full report)


Flaky tests (3)

Postgres 17

Postgres 14

Code coverage* (full report)

  • functions: 32.4% (8722 of 26950 functions)
  • lines: 48.4% (74842 of 154539 lines)

* collected from Rust tests only


The comment gets automatically updated with the latest test results
13fa4b4 at 2025-03-19T19:14:14.763Z :recycle:

@problame problame force-pushed the problame/pageserver-conf-ignore-unknown-fields branch 2 times, most recently from fd5823e to 38510a6 Compare March 18, 2025 16:38
@problame problame changed the base branch from main to problame/dedupe-tenant-conf-opt-types March 18, 2025 16:38
@problame problame changed the title WIP: remove deny_unknown_fields pageserver config: ignore unknown fields (instead of deny_unknown_fields) Mar 18, 2025
Base automatically changed from problame/dedupe-tenant-conf-opt-types to main March 19, 2025 12:55
@problame problame force-pushed the problame/pageserver-conf-ignore-unknown-fields branch from a29d1ab to 13fa4b4 Compare March 19, 2025 17:37
@problame problame marked this pull request as ready for review March 20, 2025 07:45
@problame problame requested a review from a team as a code owner March 20, 2025 07:45
@problame problame requested a review from erikgrinaker March 20, 2025 07:45
Copy link
Contributor

@erikgrinaker erikgrinaker left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, but let's add warnings for unknown fields too, as discussed elsewhere.

@problame problame marked this pull request as draft March 20, 2025 10:01
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