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

Add basic remote storage test #1079

Merged
merged 7 commits into from
Jan 11, 2022
Merged

Add basic remote storage test #1079

merged 7 commits into from
Jan 11, 2022

Conversation

SomeoneToIgnore
Copy link
Contributor

@SomeoneToIgnore SomeoneToIgnore commented Jan 1, 2022

Part of #755

All fixes and improvements are put as different commits in the same PR for simplicity and better context, but I can split them off, if needed, but the changes are rather small combined IMO and depend on each other anyway, so I'd left it all as is now.

Fixes:

  • sync loop blocking and not letting pageserver to shutdown properly

Improves:

  • Zenith CLI now passes RUST_LOG env var to safekpeer and pageserver CLI commands, python tests can also specify the same env var to automatically propagate it into the CLI or programmatically set a rust_log_override property to enable the same for a certain test
  • Zenith CLI now accepts --pageserver-config-override params that get passed into pageserver as -c (--config-override), which is used to specify remote storage params to pageserver via Zenith CLI.
    Also, ZENITH_PAGESERVER_OVERRIDES env var can be used to set those config values globally for all python tests (so that all existing tests could be run with overrides, e.g. remote storage enabled)

Adds:

  • a bit more tests on new pageserver's timeline http endpoints
  • a way to programmaticaly enable remote storage and RUST_LOG overrides in python tests
  • simple remote storage timeline restoration test

The remote storage test is not finished yet, it requires more fixes to properly read the WAL after the timeline data got restored, I will do that later: right now the test is useful already, since it brings the remote storage code needed by #995 and tests that pageserver is capable to upload, download and load a timeline into its memory correctly.
Also, all remote storage tests now use local fs as a storage, so future improvements are needed to bring some form of S3 into the tests.

Copy link
Contributor

@hlinnaka hlinnaka left a comment

Choose a reason for hiding this comment

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

The config option changes look good to me, I didn't look at the rest of the patch

let cmd = cmd.env_clear().env("RUST_BACKTRACE", "1");

const RUST_LOG_KEY: &str = "RUST_LOG";
if let Ok(rust_log_value) = std::env::var(RUST_LOG_KEY) {
Copy link
Contributor

Choose a reason for hiding this comment

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

What does RUST_LOG_KEY do?

Would it make sense to pass through all env variables with RUST_* prefix?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

What does RUST_LOG_KEY do?

That's just a variable to hold the RUST_LOG value to use it twice on the next lines. const forces it to BE_NAMED_THIS_WAY , so might be a bit confusing. I can define it as let rust_log_key = ..., would that reduce the confusion?

Would it make sense to pass through all env variables with RUST_* prefix?

I'm not aware of any others that start with such prefix, actually.
Seems that the RUST_LOG one emerged from env_logger crate and still isn't a standard really, since has to be supported in every logging backend separately. For instance, the slog one we've used before tracing did not support such variable.

Lastly, the only documentation about any rust-related env vars I was able to find is about cargo:
https://doc.rust-lang.org/cargo/reference/environment-variables.html

So, I'd rather keep the RUST_LOG one only for now.

control_plane/src/storage.rs Outdated Show resolved Hide resolved
@SomeoneToIgnore SomeoneToIgnore force-pushed the kb/remote-storage-tests branch 2 times, most recently from 55032e2 to 8588f26 Compare January 5, 2022 15:47
Copy link
Contributor

@LizardWizzard LizardWizzard left a comment

Choose a reason for hiding this comment

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

Nice! Looks good to me, left few minor comments

I plan to use pageserver related utilities in a tenant migration tests

control_plane/src/storage.rs Outdated Show resolved Hide resolved
pageserver/src/remote_storage/storage_sync.rs Outdated Show resolved Hide resolved
test_runner/batch_others/test_remote_storage.py Outdated Show resolved Hide resolved
test_runner/batch_others/test_remote_storage.py Outdated Show resolved Hide resolved
test_runner/fixtures/zenith_fixtures.py Outdated Show resolved Hide resolved
test_runner/fixtures/zenith_fixtures.py Show resolved Hide resolved
@SomeoneToIgnore SomeoneToIgnore force-pushed the kb/remote-storage-tests branch from e4a7cda to 75cada5 Compare January 11, 2022 12:40
@SomeoneToIgnore SomeoneToIgnore force-pushed the kb/remote-storage-tests branch from 75cada5 to 654992e Compare January 11, 2022 12:56
@SomeoneToIgnore SomeoneToIgnore merged commit 8ab4c8a into main Jan 11, 2022
@SomeoneToIgnore SomeoneToIgnore deleted the kb/remote-storage-tests branch January 11, 2022 13:44
@SomeoneToIgnore SomeoneToIgnore restored the kb/remote-storage-tests branch January 11, 2022 13:44
@SomeoneToIgnore SomeoneToIgnore deleted the kb/remote-storage-tests branch January 11, 2022 13:44
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.

3 participants