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

adapter: save system_parameter_defaults to disk #25924

Closed
wants to merge 2 commits into from

Conversation

aalexandrov
Copy link
Contributor

@aalexandrov aalexandrov commented Mar 11, 2024

Save system_parameter_defaults to disk and revert back the hard-coded default for enable_equivalence_propagation to false.

Motivation

  • This PR refactors existing code.

This addresses an issue observed while trying to merge #24155.

More specifically, since system_parameter_defaults are not persisted to disk, Testdrive tests that run consistency checks re-hydrate the in-memory catalog without respecting the feature flags defined in DEFAULT_SYSTEM_PARAMETERS and consequently fail with the following error:

error: catalog inconsistency: catalog state

For example, see this Buildkite run.

We will always hit these issues when introducing a feature flag that affects the optimizer pipeline across the board, so it's better to come up with a more general solution than "add ALTER SYSTEM SET <optimizer feature> = true to all affected *.td files".

Tips for reviewer

If this causes issues outside of our Testdrive tests (in other CI tests or in production, I suggest to parameterize the behavior of the system_parameter_defaults loop in load_system_configuration by another boolean parameter persist_system_parameter_defaults: bool.

Checklist

  • This PR has adequate test coverage / QA involvement has been duly considered.
  • This PR has an associated up-to-date design doc, is a design doc (template), or is sufficiently small to not require a design.
  • If this PR evolves an existing $T ⇔ Proto$T mapping (possibly in a backwards-incompatible way), then it is tagged with a T-proto label.
  • If this PR will require changes to cloud orchestration or tests, there is a companion cloud PR to account for those changes that is tagged with the release-blocker label (example).
  • This PR includes the following user-facing behavior changes:
    • There are no user-facing behavior changes.

@aalexandrov aalexandrov requested a review from a team as a code owner March 11, 2024 13:00
@aalexandrov aalexandrov requested review from jkosh44 and removed request for jkosh44 March 11, 2024 13:00
@aalexandrov aalexandrov self-assigned this Mar 11, 2024
@aalexandrov aalexandrov requested a review from jkosh44 March 11, 2024 13:00
@aalexandrov aalexandrov added the A-ADAPTER Topics related to the ADAPTER layer label Mar 11, 2024
@aalexandrov aalexandrov requested a review from a team March 11, 2024 13:00
@aalexandrov aalexandrov force-pushed the eq_prop_fix_ci branch 2 times, most recently from 4fbe944 to 28dbfe7 Compare March 11, 2024 13:47
Change the `testdrive` and `legacy-upgrad` mzcompose scripts to run

```sql
ALTER SYSTEM SET {key} = '{value}'
```

for each (key, value) pair from the `system_parameter_defaults`
associated with a `Materialized` service. This is needed in order to
force these values durably to disk and avoid the failures seen in
BuildKite runs like https://buildkite.com/materialize/tests/builds/77990.
…lue"

This reverts commit f70b2946a8108bed6830ce032e6147a32c732752.
@jkosh44
Copy link
Contributor

jkosh44 commented Mar 11, 2024

I think we should create a new argument for materialized to save some variables to disk on boot instead of re-using the system_parameter_defaults argument since system_parameter_defaults has different semantics.

else:
c.up("materialized")

for key, value in DEFAULT_SYSTEM_PARAMETERS.items():
Copy link
Contributor Author

Choose a reason for hiding this comment

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

The CI and also my local testdrive run

bin/mzcompose --find testdrive run default array.td

still fail the consistency check, even though I'm now seeing an

ALTER SYSTEM SET enable_connection_validation_syntax = true

corresponding to this call when I run the test locally. However with this line added directly to array.td the test passes.

$ postgres-execute connection=postgres://mz_system:materialize@${testdrive.materialize-internal-sql-addr}
ALTER SYSTEM SET enable_connection_validation_syntax = true;

@aalexandrov
Copy link
Contributor Author

Closing in favor of #25950.

@aalexandrov aalexandrov deleted the eq_prop_fix_ci branch March 13, 2024 11:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-ADAPTER Topics related to the ADAPTER layer
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants