-
Notifications
You must be signed in to change notification settings - Fork 5.6k
fix: bump cache sqlite dbs to v2 for WAL journal mode change #24030
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
Conversation
use super::cache_db::CacheFailure; | ||
use deno_ast::ModuleSpecifier; | ||
use deno_core::error::AnyError; | ||
use deno_runtime::deno_webstorage::rusqlite::params; | ||
|
||
pub static TYPE_CHECK_CACHE_DB: CacheDBConfiguration = CacheDBConfiguration { | ||
table_initializer: concat!( | ||
"CREATE TABLE IF NOT EXISTS checkcache ( | ||
check_hash TEXT PRIMARY KEY |
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.
These are now stored as integers.
@@ -28,40 +28,19 @@ WHERE | |||
LIMIT 1"; | |||
|
|||
pub static MODULE_INFO_CACHE_DB: CacheDBConfiguration = CacheDBConfiguration { | |||
table_initializer: "CREATE TABLE IF NOT EXISTS moduleinfocache ( | |||
specifier TEXT PRIMARY KEY, | |||
media_type TEXT NOT NULL, |
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.
Now an integer.
@@ -3,16 +3,17 @@ | |||
use std::hash::Hasher; | |||
|
|||
/// A very fast insecure hasher that uses the xxHash algorithm. | |||
#[derive(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.
Now forces someone to decide whether to include the deno version in the hash or not.
.query_row(query, params![key.as_u64().to_string()], |row| { | ||
let res = self.conn.query_row( | ||
query, | ||
params![CacheDBHash::new(key.as_u64())], |
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.
Opened denoland/deno_graph#491 to make the hash have the deno_graph version in it.
Edit: Included that 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.
LGTM again
In #23955 we changed the sqlite db journal mode to WAL. This causes issues when someone is running an old version of Deno using TRUNCATE and a new version because the two fight against each other.