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

Tracking: Introduce Sqlancer #3364

Open
7 of 8 tasks
lmatz opened this issue Jun 21, 2022 · 9 comments
Open
7 of 8 tasks

Tracking: Introduce Sqlancer #3364

lmatz opened this issue Jun 21, 2022 · 9 comments
Assignees
Labels
component/test Test related issue. help wanted Issues that need help from contributors needs-investigation type/tracking Tracking issue.

Comments

@lmatz
Copy link
Contributor

lmatz commented Jun 21, 2022

https://github.com/sqlancer/sqlancer has already supported Postgres.
We can run the test against batch queries first.

Running it for each PR seems unnecessary, maybe set it up as a daily job? Probably also allow people to manually trigger it.

Running it for stream queries? Require some extra effort by extending the existing Postgres module of Sqlancer.

Prerequisite:

References:
See: https://github.com/sqlancer/sqlancer/blob/78506a83a4b77d2c9536980a4d3b4d47eb7e9317/src/sqlancer/postgres/PostgresGlobalState.java#L44-L94

@lmatz lmatz added component/test Test related issue. help wanted Issues that need help from contributors needs-investigation labels Jun 21, 2022
@liurenjie1024
Copy link
Contributor

+1 for running daily job against batch query.

For streaming query, does it support materialized view?

@lmatz
Copy link
Contributor Author

lmatz commented Jun 21, 2022

For streaming query, does it support materialized view?

Yes(at least in code), https://github.com/sqlancer/sqlancer/blob/master/src/sqlancer/postgres/gen/PostgresViewGenerator.java

When I use 8 threads for testing PG with Sqlancer, the throughput is around 6000 queries per second.

Suspect that if we wait for the mv's flush synchronously by blocking, the throughput won't be this high.

@liurenjie1024
Copy link
Contributor

cc @sumittal

@mrigger
Copy link

mrigger commented Jun 21, 2022

Let me know if you have any questions or need input from my side about integrating SQLancer!

@skyzh
Copy link
Contributor

skyzh commented Jun 21, 2022

Suspect that if we wait for the mv's flush synchronously by blocking, the throughput won't be this high.

You may adjust checkpoint interval to a relatively small value (or just using the mock frontend / compute node as we've done in most unit tests). This might lead to better throughput.

Suspect that if we wait for the mv's flush synchronously by blocking, the throughput won't be this high.

Absolutely, we're even not done with parallel ddl! #2692 #3084

@lmatz lmatz changed the title Introduce Sqlancer Tracking: Introduce Sqlancer Jun 23, 2022
@lmatz lmatz added the type/tracking Tracking issue. label Jun 23, 2022
@lmatz lmatz added this to the release-0.1.14 milestone Oct 18, 2022
@kwannoel
Copy link
Contributor

kwannoel commented Nov 2, 2022

Few more system tables needed:

  • pg_collation
  • pg_operator
  • pg_am

See: https://github.com/sqlancer/sqlancer/blob/78506a83a4b77d2c9536980a4d3b4d47eb7e9317/src/sqlancer/postgres/PostgresGlobalState.java#L44-L94

Updated the description.

@lmatz
Copy link
Contributor Author

lmatz commented Nov 2, 2022

Few more system tables needed:

  • pg_collation
  • pg_operator
  • pg_am

See: https://github.com/sqlancer/sqlancer/blob/78506a83a4b77d2c9536980a4d3b4d47eb7e9317/src/sqlancer/postgres/PostgresGlobalState.java#L44-L94

Updated the description.

Thanks for the info!

We can also hard-code these PG system tables just enough to support SQLancer.
We try to spend as little effort as possible on the compatibility of these PG system tables.

@mrigger
Copy link

mrigger commented Nov 6, 2022

I think none of these three system tables is essential for testing. As an alternative, you could also consider adding a flag to the SQLancer Postgres implementation that specifies whether these system tables are supported (see https://github.com/sqlancer/sqlancer/blob/master/src/sqlancer/postgres/PostgresOptions.java).

@kwannoel
Copy link
Contributor

kwannoel commented Jan 10, 2023

Have continued work on this, you may follow the progress here:

Plan:

  1. (WIP in first two branches above) First try to get minimal working with NoREC since it seems simplest to support. This is just investigative, may hardcode some things in sqlancer:postgres, just to get it running first.
  2. Once we know all limitations etc... we can include a variant e.g. https://github.com/sqlancer/sqlancer/blob/master/src/sqlancer/citus/CitusProvider.java since there are differences in SQL features.

Many thanks to @mrigger for providing his thoughts and suggestions on these.

@kwannoel kwannoel removed this from the release-0.18 milestone Mar 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component/test Test related issue. help wanted Issues that need help from contributors needs-investigation type/tracking Tracking issue.
Projects
None yet
Development

No branches or pull requests

6 participants