-
Notifications
You must be signed in to change notification settings - Fork 468
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
*: Rename "default" cluster to "quickstart" #24019
*: Rename "default" cluster to "quickstart" #24019
Conversation
0c7b1fd
to
a8f61a5
Compare
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.
Glad to see you triggered nightly already, I'm expected lots of related failures. If that's green, ok
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.
The "Detect references to already closed issues" can be ignored, but platform-checks looks like a new issue:
Running manipulate() from <materialize.checks.all_checks.identifiers.Identifiers object at 0x7ff8495ce250>
--- docker compose exec -T testdrive testdrive --kafka-addr=kafka:9092 --schema-registry-url=http://schema-registry:8081 --materialize-url=postgres://materialize@materialized:6875 --materialize-internal-url=postgres://materialize@materialized:6877 --aws-endpoint=http://localstack:4566 --no-reset --default-timeout=300s --seed=1 --persist-blob-url=file:///mzdata/persist/blob --persist-consensus-url=postgres://root@materialized:26257?options=--search_path=consensus --var=replicas=1 --var=default-replica-size=4-4 --var=default-storage-size=4-1 --source=/var/lib/buildkite-agent/builds/buildkite-builders-d43b1b5-i-092248735da8c3952-1/materialize/nightlies/misc/python/materialize/checks/all_checks/identifiers.py:150
> SET CLUSTER=identifiers;
rows match; continuing at ts 1703179510.3750253
> SET DATABASE=" � …             ​

 � ";
rows match; continuing at ts 1703179510.3760698
> CREATE MATERIALIZED VIEW "../../../../../../../../../../../etc/hosts"." " IN CLUSTER quickstart AS
SELECT "<foo val=“bar� />", c2 as "<foo val=“bar� />" FROM "../../../../../../../../../../../etc/hosts"."<a href=""javascript\x0D:javascript:alert(1)"" id=""fuzzelement1"">test</a>";
^^^ +++
4:1: error: executing query failed: db error: ERROR: column "<foo val=“bar� />" specified more than once: ERROR: column "<foo val=“bar� />" specified more than once
I'm wondering why that is failing now
There were a lot of test failures, but I've been iterating :)
I'm not sure why this is failing either, I changed some strings to f-strings but not this one. I was going to dig into it |
a8f61a5
to
1ca6a4e
Compare
@def- it seems like these two lines have the same exact content, was that intentional?. I copied them into Rust Playground and inspected their byte representation. So it seems possible that this conflict could happen, because |
Oooh, that is indeed not supposed to happen. Let me scan that file for other duplicates, thanks! |
Since our tests depend on them being unique, thanks to ParkMyCar for noticing: MaterializeInc#24019 (comment)
if self.base_version >= MzVersion.parse_mz("v0.81.0-dev"): | ||
return "quickstart" | ||
else: | ||
return "default" |
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.
Nice
src/adapter/src/catalog/migrate.rs
Outdated
_conn_catalog: &ConnCatalog<'_>, | ||
_connection_context: &ConnectionContext, | ||
) -> Result<(), anyhow::Error> { | ||
txn.upsert_system_config("cluster", "default".to_string())?; |
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.
Do we need to check if they've already overwritten their cluster
var and not upsert
in that case?
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.
#23903 has yet to be included in a release, so it wouldn't have been previously possible for users to overwrite their cluster
var in this case
src/adapter/src/catalog/state.rs
Outdated
@@ -220,7 +220,7 @@ impl CatalogState { | |||
state: Cow::Borrowed(self), | |||
unresolvable_ids: BTreeSet::new(), | |||
conn_id: SYSTEM_CONN_ID.clone(), | |||
cluster: "default".into(), | |||
cluster: "quickstart".into(), |
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.
Can we use mz_catalog::durable::initialize::DEFAULT_USER_CLUSTER_NAME
here?
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.
This made me realize we shouldn't use a static value for a session-less user, and instead we should use whatever value is in the system vars, updated!
id: 6, | ||
event_type: Grant, | ||
object_type: Database, | ||
user: None, | ||
occurred_at: Some( | ||
EpochMillis { | ||
millis: 0, | ||
}, | ||
), | ||
details: Some( | ||
IdNameV1( | ||
IdNameV1 { | ||
id: "u1", | ||
name: "default", | ||
UpdatePrivilegeV1( | ||
UpdatePrivilegeV1 { | ||
object_id: "Du1", | ||
grantee_id: "p", | ||
grantor_id: "s1", | ||
privileges: "U", |
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.
What happened here? There's a lot more changes than I was expecting.
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.
Turns out the snapshot isn't sorted, so the large amount of changes comes from audit log events being ordered differently in the formatting of the snapshot. If you'd like I can fix the ordering in this PR, or in a follow up!
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.
No that's ok. As long as it's just ordering it's fine.
|
||
# to make it easier to run the test again, let's recreate the default cluster | ||
# to make it easier to run the test again, let's recreate the defaquickstartult cluster |
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.
# to make it easier to run the test again, let's recreate the defaquickstartult cluster | |
# to make it easier to run the test again, let's recreate the quickstart cluster |
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.
Whoops, updated!
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.
LGTM
rename default cluster to quickstart add catalog migration so existing users' cluster is 'default' fix catalog migration
update sqllogictests, again
update testdrive to pick cluster name based on db version
python test fmt update python tests, again update python tests, again again update python tests, again python fmt python type fixes python, use base version not current version
update dbt tests, again update dbt tests, again
rust test fmt update rust tests, again
b966ba0
to
236d460
Compare
This PR renames the "default" cluster to "quickstart" for new environments, existing environments will not have their cluster renamed. To keep the default value for the "cluster" variable to "default" we add a Catalog migration that runs for existing environments.
Motivation
Fixes https://github.com/MaterializeInc/database-issues/issues/6755
Tips for reviewer
There are a large number of changes here, but the majority of them are test-only changes. The PR is broken up into commits that can ideally be review independently:
The accompanying changes to our user documentation is here: #24035
Checklist
$T ⇔ Proto$T
mapping (possibly in a backwards-incompatible way), then it is tagged with aT-proto
label.