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

feature(views-with-tablets): enable testing materialized views with tablets #9615

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

wmitros
Copy link

@wmitros wmitros commented Dec 24, 2024

We plan to disallow materialized views in tablet keyspaces, until the remaining issues with them are resolved. For that, we've introduced the "views-with-tablets" experimental feature, so that they can be enabled regardless, for example for testing. Currently, the feature has no effect, but we want to prepare the cluster tests to use it, so that they won't start failing when it starts actually having an effect.

While improving views with tablets, we should make sure that the existing tests keep passing, so we should run materialized view (and index) tests with tablets using the experimental feature.

The feature doesn't affect tests ran on vnodes. For tablets, the tests would fail without the feature due to unsupported configuration.

Considering that, we should enable the feature by default for all tests (with a special consideration to upgrade tests).

The change includes:

  • modifying the default experimental_features in defaults/test_default.yaml
  • updating json results for YAML tests accordingly to the new default
  • updating upgrade tests - for upgrades, the first version with this experimental feature will be 2025.1, so the upgrade tests are updated to remove this feature from the defaults and to set it when upgrading to 2025.1 or higher. When testing upgrades to future versions, we'll need to keep the experimental_feature also for base version, with an exception for sequential upgrades, (currently we only have 2021.1->2022.1->2023.1 test in test_custom_profile_sequential_rolling_upgrade) where the base version of the sequence might not have this experimental feature, so we'll need to adjust it accordingly.

@wmitros wmitros added the backport/none Backport is not required label Dec 24, 2024
@wmitros
Copy link
Author

wmitros commented Dec 24, 2024

Looks like yaml tests aren't using the default configurations, fixed in rebase

@wmitros
Copy link
Author

wmitros commented Jan 7, 2025

Refs scylladb/scylladb#21832

@piodul
Copy link
Contributor

piodul commented Jan 13, 2025

@wmitros why is this PR a draft? What is missing?

@wmitros wmitros marked this pull request as ready for review January 13, 2025 10:39
@wmitros
Copy link
Author

wmitros commented Jan 13, 2025

@wmitros why is this PR a draft? What is missing?

I think it's ready, forgot to change the type

@wmitros wmitros requested a review from fruch January 13, 2025 22:00
@@ -110,6 +110,8 @@ skip_download: false
authenticator_user: ''
authenticator_password: ''

experimental_features: ['views-with-tablets']
Copy link
Contributor

Choose a reason for hiding this comment

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

Materialized views are currently not allowed in tablet keyspaces, due to some
pending issues. However, they can be enabled using the "views-with-tablets" experimental feature.

This is not technically true, they can be created in tablet keyspaces right now but we want to forbid this. We introduced an experimental feature first, now we want to adjust the test and, finally, we will forbid creating materialized views without the experimental feature being enabled.

Just clarifying so that other reviewers won't get confused why tests that use MVs are still working. I recommend updating the description.

Copy link
Contributor

Choose a reason for hiding this comment

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

When testing upgrades to future versions, we'll need to
keep the experimental_feature also for base version, with an exception for sequential upgrades,
(currently we only have 2021.1->2022.1->2023.1 test in test_custom_profile_sequential_rolling_upgrade)
where the base version of the sequence might not have this experimental feature, so we'll need
to adjust it accordingly.

It would be great if the feature were enabled programmatically for the base version as well, but I'm not familiar with SCT enough to tell you how to do that. @fruch perhaps you will know?

If it's not feasible, alternatively you could add a comment near the experimental_features key which explains when the views-with-tablets feature needs to be provided and when not.

Copy link
Author

Choose a reason for hiding this comment

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

Materialized views are currently not allowed in tablet keyspaces, due to some
pending issues. However, they can be enabled using the "views-with-tablets" experimental feature.

This is not technically true, they can be created in tablet keyspaces right now but we want to forbid this.

I updated the description for the current state

It would be great if the feature were enabled programmatically for the base version as well, but I'm not familiar with SCT enough to tell you how to do that. @fruch perhaps you will know?

I'm not sure there is such a way in general for all tests. I saw that when tablets were introduced, we added a enable_tablets_on_upgrade config option that we used on specific test pipelines - we could probably do something like that here as well, but currently no tests would use it, as we don't have tests for upgrading to 2025.1, and the developers that were adding these tests would have to remember about it.

If it's not feasible, alternatively you could add a comment near the experimental_features key which explains when the views-with-tablets feature needs to be provided and when not.

For now I added a comment for the experimental_features configuration option

Copy link
Contributor

Choose a reason for hiding this comment

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

The only downside of using this in default for everything, that is gonna block people from using older versions

And it's gonna waste lots of people's time,

We are using older releases during development

I think this is different from the regular extra configuration in scylla yaml that wasn't there before, and existence of it does not break anything

I think moving it into the with the same version logic you used in upgrade tests

Copy link
Contributor

Choose a reason for hiding this comment

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

Older versions of scylla which do not support this experimental feature will not recognize it, and will fail to start. If we are using SCT with older versions of scylla then it sounds like it will be a problem.

@fruch is there a way to adjust the configuration programmatically?

I found an old PR which removed the experimental "tablets" feature from SCT (#7512). It looks like the approach there was to modify Jenkinsfiles (configurations/raft/enable_raft_experimental.yaml). Would it be a viable approach here instead of adding "views-with-tablets" to the list of default features?

Copy link
Contributor

Choose a reason for hiding this comment

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

@piodul
I agree with @fruch that defaults must not limit us to only one scylla version.
For example, I use various scylla versions with the master SCT branch all the time.

Yes, additional small file in the configurations is good solution.

Also, note that each CI job can be provided with the updated SCT config option in the jenkins pipeline extra_environment_variables parameter.
One of the recent examples:
Screenshot from 2025-01-16 20-08-09

In this case it is not needed to update SCT configs.

So, choose whatever fits your needs better.

Copy link
Contributor

Choose a reason for hiding this comment

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

By the way, today I was hit with the same problem in test/cqlpy/run's "--release" feature which is supposed to allow running old versions of Scylla, but the newly added views-with-tablets doesn't work on old versions. My fix is scylladb/scylladb#22350. Basically test/cqlpy/run.py has a rather-ugly list of configuration "overrides", specific options that need to be added or removed from specific past versions. This list is ugly, but isn't long or hard, and I'm rather please with the power it gives me to run tests against old versions (e.g., just today in scylladb/scylladb#22354 I wrote a test and then ran it against 10 different versions of Scylla).

Copy link
Contributor

Choose a reason for hiding this comment

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

@piodul

there two place we can do it programmatically:

  1. in proposed_scylla_yaml, where we read append_scylla_yaml and use it
  2. in sct_config.py after sct_config.get_version_based_on_conf() is called, and we have the version information

the first is the simplest, but it's buried in not so clear place
the 2nd might be better and clear place for more changes per release we need to do in SCT configuration.

Comment on lines +225 to +227
version = ComparableScyllaVersion(self.scylla_version)
if self.is_enterprise and version >= "2025.1.0~dev" or not self.is_enterprise and version >= "6.3.0~dev":
scylla_yaml_updates.update({"experimental_features": ["views-with-tablets"]})
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we need something similar in _rollback_node, too?

Copy link
Author

Choose a reason for hiding this comment

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

I assumed we reused the original scylla.yaml after rollback because we don't revert other updates (like enable_tablets) to it either, but I don't see it explicitly so @scylladb/qa-maintainers please confirm or deny

Copy link
Contributor

Choose a reason for hiding this comment

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

I don't know, someone need to cross check it in the code

Anyhow I would recommend appending to the flags, now the code is override anything that any might have put in there before

Copy link
Contributor

Choose a reason for hiding this comment

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

@wmitros wmitros force-pushed the forbid-tablet-mv branch 2 times, most recently from 8b5e8ef to 573509a Compare January 15, 2025 22:07
…ablets

We plan to disallow materialized views in tablet keyspaces, until the remaining issues with them
are resolved. For that, we've introduced the "views-with-tablets" experimental feature, so that
they can be enabled regardless, for example for testing. Currently, the feature has no effect,
but we want to prepare the cluster tests to use it, so that they won't start failing when it
starts actually having an effect.

While improving views with tablets, we should make sure that the existing tests keep passing,
so we should run materialized view (and index) tests with tablets using the experimental feature.

The feature doesn't affect tests ran on vnodes. For tablets, the tests would fail without the feature
due to unsupported configuration.

Considering that, we should enable the feature by default for all tests (with a special consideration
to upgrade tests).

The change includes:
* modifying the default experimental_features in defaults/test_default.yaml
* updating upgrade tests - for upgrades, the first version with this experimental feature will
be 2025.1, so the upgrade tests are updated to remove this feature from the defaults and to set
it when upgrading to 2025.1 or higher. When testing upgrades to future versions, we'll need to
keep the experimental_feature also for base version, with an exception for sequential upgrades,
(currently we only have 2021.1->2022.1->2023.1 test in test_custom_profile_sequential_rolling_upgrade)
where the base version of the sequence might not have this experimental feature, so we'll need
to adjust it accordingly.
@@ -221,7 +222,9 @@ def _upgrade_node(self, node, upgrade_sstables=True, new_scylla_repo=None, new_v

if self.params.get("enable_tablets_on_upgrade"):
scylla_yaml_updates.update({"enable_tablets": True})

version = ComparableScyllaVersion(self.scylla_version)
if self.is_enterprise and version >= "2025.1.0~dev" or not self.is_enterprise and version >= "6.3.0~dev":
Copy link
Contributor

Choose a reason for hiding this comment

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

According to the upcoming versioning changes, the6.3 is not planned to appear.
So, the 2025.1.0~dev must be the only version to be checked here.

Copy link
Contributor

Choose a reason for hiding this comment

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

6.3.0-dev does exists, it never gonna be released
since today master is 2025.1.0-dev, so we can drop it now

@@ -110,6 +110,8 @@ skip_download: false
authenticator_user: ''
authenticator_password: ''

experimental_features: ['views-with-tablets']
Copy link
Contributor

Choose a reason for hiding this comment

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

@piodul
I agree with @fruch that defaults must not limit us to only one scylla version.
For example, I use various scylla versions with the master SCT branch all the time.

Yes, additional small file in the configurations is good solution.

Also, note that each CI job can be provided with the updated SCT config option in the jenkins pipeline extra_environment_variables parameter.
One of the recent examples:
Screenshot from 2025-01-16 20-08-09

In this case it is not needed to update SCT configs.

So, choose whatever fits your needs better.

@@ -737,7 +737,8 @@ Set type of ssh library to use. Could be 'fabric' (default) or 'libssh2'

## **experimental_features** / SCT_EXPERIMENTAL_FEATURES

unlock specified experimental features
Unlock specified experimental features. The 'views-with-tablets` feature is enabled in the default configuration, but it should not be enabled when testing versions older than 2025.1-dev or 6.3-dev
Copy link
Contributor

Choose a reason for hiding this comment

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

6.3-dev won't exist

Comment on lines +225 to +227
version = ComparableScyllaVersion(self.scylla_version)
if self.is_enterprise and version >= "2025.1.0~dev" or not self.is_enterprise and version >= "6.3.0~dev":
scylla_yaml_updates.update({"experimental_features": ["views-with-tablets"]})
Copy link
Contributor

Choose a reason for hiding this comment

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport/none Backport is not required
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants