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

fix(meta): do not release connection to in-memory SQLite for meta store #19605

Merged
merged 1 commit into from
Dec 11, 2024

Conversation

BugenZhao
Copy link
Member

I hereby agree to the terms of the RisingWave Labs, Inc. Contributor License Agreement.

What's changed and what's your intention?

Resolve #19522.

The connection options to meta store exposed in #19040 do not apply to in-memory SQLite (typically used by playground). Therefore, default values from sea-orm or sqlx were used, where max_lifetime is set to 30 minutes. This means that #19522 will always occur after launching playground and waiting for 30 minutes, no matter whether there is any activity or not.

Checklist

  • I have written necessary rustdoc comments
  • I have added necessary unit tests and integration tests
  • All checks passed in ./risedev check (or alias, ./risedev c)

Documentation

  • My PR needs documentation updates. (Please use the Release note section below to summarize the impact on users)

Release note

If this PR includes changes that directly affect users or other significant modifications relevant to the community, kindly draft a release note to provide a concise summary of these changes. Please prioritize highlighting the impact these changes will have on users.

Copy link
Member Author

BugenZhao commented Nov 28, 2024

let conn = sea_orm::Database::connect(IN_MEMORY_STORE).await?;
const IN_MEMORY_STORE: &str = "sqlite::memory:";

let mut options = sea_orm::ConnectOptions::new(IN_MEMORY_STORE);
Copy link
Member

@fuyufjh fuyufjh Nov 28, 2024

Choose a reason for hiding this comment

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

A more elegant solution might be "Temporary Databases"? No additional options are needed.

https://www.sqlite.org/inmemorydb.html (Scroll down to the "Temporary Databases" section)

Copy link
Member Author

Choose a reason for hiding this comment

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

Temporary databases are automatically deleted when the connection that created them closes.

Seems that this still holds.

No additional options are needed.

Actually those options are for the connection pool by sqlx, not SQLite.

@BugenZhao BugenZhao force-pushed the bz/extract-sql-meta-store-connect branch from 6d649e0 to fb9573e Compare November 29, 2024 03:49
@BugenZhao BugenZhao force-pushed the bz/in-mem-meta-store-do-not-release branch from 613c35c to 8d1fcec Compare November 29, 2024 03:50
@BugenZhao BugenZhao force-pushed the bz/extract-sql-meta-store-connect branch from fb9573e to 926ae81 Compare December 9, 2024 05:18
@BugenZhao BugenZhao force-pushed the bz/in-mem-meta-store-do-not-release branch from 8d1fcec to d0acbe1 Compare December 9, 2024 05:18
Base automatically changed from bz/extract-sql-meta-store-connect to main December 9, 2024 09:33
@BugenZhao BugenZhao force-pushed the bz/in-mem-meta-store-do-not-release branch from d0acbe1 to 0cb233b Compare December 10, 2024 09:48
@BugenZhao BugenZhao enabled auto-merge December 10, 2024 09:48
@BugenZhao BugenZhao added this pull request to the merge queue Dec 10, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Dec 10, 2024
@BugenZhao BugenZhao added this pull request to the merge queue Dec 11, 2024
Merged via the queue into main with commit 5954c98 Dec 11, 2024
32 of 33 checks passed
@BugenZhao BugenZhao deleted the bz/in-mem-meta-store-do-not-release branch December 11, 2024 04:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

playground fails due to in-memory meta store loss after running a while
3 participants